Richard Russon [Sun, 9 Apr 2017 19:43:22 +0000 (20:43 +0100)]
merge: upstream fixes (mutt/default)
* Remove redraw flag setting after mutt_endwin().
* Change km_dokey() to pass SigWinch on for the MENU_EDITOR. (see #3877)
* Separate out the compose menu redrawing. (see #3877)
* Separate out the index menu redrawing. (see #3877)
* Prepare for pager redraw separation. (see #3877)
* Separate out the pager menu redrawing. (see #3877)
* Don't create query menu until after initial prompt. (see #3877)
* Silence imap progress messages for pipe-message. (see #3929)
* Ensure mutt stays in endwin during calls to pipe_msg() (closes #3929)
Kevin McCarthy [Sat, 8 Apr 2017 21:21:15 +0000 (14:21 -0700)]
Ensure mutt stays in endwin during calls to pipe_msg() (closes #3929)
The previous commit solved the problem reported in #3929: progressbar
output while downloading a message via IMAP was refreshing the mutt
ncurses session after launching the pipe program.
To ensure another place in the code doesn't inadvertantly generate
output, wrap OPTKEEPQUIET around the calls to
pipe_msg()/mutt_wait_filter() too.
Kevin McCarthy [Sat, 8 Apr 2017 21:18:26 +0000 (14:18 -0700)]
Silence imap progress messages for pipe-message. (see #3929)
_mutt_pipe_message() calls endwin(), and then calls pipe_msg(). If an
imap message body hasn't already been downloaded, this can end up
calling imap_fetch_message().
The progress messages in imap_fetch_message() were restoring curses,
just after extract_url was running. This was leading to a condition
where mutt curses didn't think the screen had changed after
extract_url exited.
There was already a check for isendwin() inside imap_fetch_message(),
but it wasn't wrapped around the progressbar creation/usage. Add a
check for those places too.
Kevin McCarthy [Wed, 5 Apr 2017 23:09:39 +0000 (16:09 -0700)]
Don't create query menu until after initial prompt. (see #3877)
A resize in the prompt will trigger a redraw, but the data won't be
loaded yet, displaying a blank screen instead of the previous menu.
Once the query is done, the data is loaded, but the menu->redraw state
has been changed by the resize.
We could manually flag a redraw, but it makes more sense visually
logically to just create the menu after the query and results are
loaded.
Richard Russon [Sun, 2 Apr 2017 01:31:28 +0000 (02:31 +0100)]
merge: upstream fixes (mutt/default)
* Fix mutt_refresh() pausing during macro events.
* Add a menu stack to track current and past menus.
* Change CurrentMenu to be controlled by the menu stack.
* Set refresh when popping the menu stack.
* Remove redraw parameter from crypt send_menus.
* Don't full redraw the index when handling a command from the pager.
* Filter other directional markers that corrupt the screen.
* Remove the OPTFORCEREDRAW options.
* Remove SidebarNeedsRedraw.
* Change reflow_windows() to set full redraw.
* Create R_MENU redraw option.
* Remove refresh parameter from mutt_enter_fname().
Kevin McCarthy [Sat, 1 Apr 2017 01:15:31 +0000 (18:15 -0700)]
Remove refresh parameter from mutt_enter_fname().
Also remove it from mutt_save_message(), which used it to pass through
to mutt_enter_fname(). The callers of this already had redraw logic,
to which REDRAW_STATUS merely needed to be added.
Kevin McCarthy [Sat, 1 Apr 2017 01:15:28 +0000 (18:15 -0700)]
Create R_MENU redraw option.
Previously, the R_INDEX option meant both the index as well as all
other menus. The removal of the OPTFORCEREDRAWINDEX option caused problems
with redrawing other menus for options such as arrow_cursor.
One solution would be change R_INDEX back to meaning "everything"
except pager, but there are only a handful of options that affect
other menus.
Instead, create R_MENU to indicate options that affect either all
menus or one of the other menus beside the index and pager.
Kevin McCarthy [Mon, 27 Mar 2017 01:31:43 +0000 (18:31 -0700)]
Remove redraw parameter from crypt send_menus.
The parameter was used to notify the caller if the sign (a)s menu was
invoked, which displayed the key selection menu. This is no longer
necessary with the menu stack pop operation.
Kevin McCarthy [Mon, 27 Mar 2017 01:31:41 +0000 (18:31 -0700)]
Set refresh when popping the menu stack.
This removes the need for the OPTNEEDREDRAW option and MAYBE_REDRAW
macro previously used to communicate back the need to refresh after
exiting a menu.
Remove the redraw parameter from ci_bounce_message() and
mix_make_chain() which served the same purpose.
Kevin McCarthy [Sun, 26 Mar 2017 19:27:15 +0000 (12:27 -0700)]
Fix mutt_refresh() pausing during macro events.
Changeset a07e8215a0ef split input buffering into two pools.
Unfortunately, the mutt_refresh() was not changed to check the correct
buffer count, resulting in unnecessary refreshes during macros.
The SSL interactive certificate prompts set OPTIGNOREMACROEVENTS and
then put up a confirmation menu. Perhaps we've just been lucky, but
it seems we should refresh the screen in those cases if we're in the
middle of a macro. Add a check for this option in mutt_refresh() too.
Richard Russon [Wed, 22 Mar 2017 16:44:02 +0000 (16:44 +0000)]
merge: Tidy the code - Part 2
* build: force OPS to be rebuild after a reconfigure
* build: fix minor code warnings / style
* tidy: be specific about void functions
* build: expand a few more alloc macros
* tidy: add argument names to function prototypes
* build: drop local copy of regex code
* tidy: indent the docbook manual
* tidy: rearrange code to avoid forward declarations
* tidy: limit the scope of some functions
* build: give the compress functions a unique name
* tidy: use snake_case for function names
* build: add missing newlines to mutt_debug
Richard Russon [Thu, 16 Mar 2017 02:35:05 +0000 (02:35 +0000)]
build: give the compress functions a unique name
The compressed mailbox functions are passed as pointers to mutt.
Their names, e.g. "open_mailbox" are OK for compilation, but they are
ambiguous when debugging.
Richard Russon [Wed, 15 Mar 2017 18:39:10 +0000 (18:39 +0000)]
build: force OPS to be rebuild after a reconfigure
A common problem is getting build errors after running ./configure for
the second time, e.g.
./configure [FEW OPTIONS]; make
./configure [MANY OPTIONS]; make
This commit forces keymap_defs.h to be rebuilt after a configure.
Richard Russon [Tue, 21 Mar 2017 16:12:39 +0000 (16:12 +0000)]
merge: upstream fixes (mutt/default)
* Add SNI support for OpenSSL. (see #3923)
* Add SNI support for GnuTLS. (closes #3923)
* Add shortcuts for IMAP and POP mailboxes in the file browser
* Change OpenSSL to use SHA-256 for cert comparison. (closes #3924)
* Fix conststrings type mismatches. (closes #3926)
* Pass envlist to filter children too. (closes #3922)
* Fix mutt_envlist_set() for the case that envlist is null. (see #3922)
* Fix setenv overwriting to not truncate the envlist. (see #3922)
Kevin McCarthy [Mon, 20 Mar 2017 17:16:03 +0000 (10:16 -0700)]
Fix setenv overwriting to not truncate the envlist. (see #3922)
The refactor in 2b9c40f13e13 exposed a bug I hadn't noticed. The
match loop performed a FREE() on the slot. Then, below, it was
checking if (*envp) to see whether it was overwriting or creating a
new slot. However, FREE() nulls out *envp. This would end up
truncating the envlist just after the set slot!
Move the free down, using a mutt_str_replace(), when overwriting the
slot.
Kevin McCarthy [Sat, 18 Mar 2017 20:38:20 +0000 (13:38 -0700)]
Fix conststrings type mismatches. (closes #3926)
The generation programs for conststrings.c: txt2c.c and txt2c.sh,
specified the resultant types as "unsigned char[]" while version.c
declared them as "const char[]".
txt2.c generates 0xXX hex codes for each individual character, thus
the "unsigned" definition. With link-time optimization, some versions
of gcc notice the mismatch and emit a warning.
Change the declarations to match the definitions and cast to char[]
when they are used.
Add shortcuts for IMAP and POP mailboxes in the file browser
Mailbox list may not be properly displayed in a standard 80-column
terminal window if the $folder variable contains a long URL. In such
a case only left part of each entry name can be visible with the default
value of $folder_format. What's worse, this visible part may not be
enough to distinguish between the entries.
Thus in this case mutt_pretty_mailbox() will be just as useful as for
local mailboxes.
Kevin McCarthy [Thu, 9 Mar 2017 21:00:10 +0000 (13:00 -0800)]
Add SNI support for OpenSSL. (see #3923)
The original patch for this is by Phil Pennock at:
https://people.spodhuis.org/phil.pennock/software/mutt-patches/
I have removed the OpenSSL version check and defined(OPENSSL_NO_TLSEXT)
check because:
* SSL_set_tlsext_host_name() was added in 0.9.8f [11 Oct 2007]
* OpenSSL 1.1 no longer has the OPENSSL_NO_TLSEXT compilation option
* https://rt.openssl.org/Ticket/Display.html?id=2788&user=guest&pass=guest
shows that the no-tlsext compilation option has been broken for some time.
* Going forward, I'd like to minimize and start removing cruft required
to support ancient/insecure versions of libraries.