Richard Russon [Fri, 12 May 2017 13:09:29 +0000 (14:09 +0100)]
merge: upstream fixes (mutt/default)
* Convert all exec calls to use mutt_envlist(), remove setenv function.
* Note that mbox-hooks are dependent on $move.
* Refresh header color when updating label. (closes #3935)
* Remove glibc-specific execvpe() call in sendlib.c. (see #3937)
* Add color commands for the compose menu headers and security status. (closes #3915).
* Fix sidebar count updates when closing mailbox. (closes #3938)
* Don't modify LastFolder/CurrentFolder upon aborting a change folder operation.
* Change message modifying operations to additively set redraw flags.
* Improve maildir and mh to report flag changes in mx_check_mailbox() (closes #3865)
* Add $header_color_partial to allow partial coloring of headers.
* Rename REDRAW_SIGWINCH to REDRAW_FLOW.
* Create R_PAGER_FLOW config variable flag.
Kevin McCarthy [Tue, 9 May 2017 23:07:46 +0000 (16:07 -0700)]
Create R_PAGER_FLOW config variable flag.
Use this for $header_color_partial, $markers, and $smart_wrap. When
these options are changed in the pager, this flag will force a
recalculation of lineInfo.
Remove the manual checks in OP_ENTER_COMMAND for $markers and
$smart_wrap, and instead use the same REDRAW_FLOW processing used for
a SigWinch.
Kevin McCarthy [Tue, 9 May 2017 23:07:42 +0000 (16:07 -0700)]
Rename REDRAW_SIGWINCH to REDRAW_FLOW.
The next patch will attach this redraw flag to pager settings. The
former name becomes somewhat confusing with the expanded usage, so
rename it to something more relevant to what is being redrawn.
Kevin McCarthy [Tue, 9 May 2017 01:48:25 +0000 (18:48 -0700)]
Add $header_color_partial to allow partial coloring of headers.
When set, a regexp match will color only the matched text in the
header. When unset (the default), the entire header will have color
applied.
With appropriate regexps, this allows coloring of just the header
field name. Of course, it can also be used to highlight arbitrary
phrases in the headers too.
Kevin McCarthy [Sun, 7 May 2017 22:11:43 +0000 (15:11 -0700)]
Improve maildir and mh to report flag changes in mx_check_mailbox() (closes #3865)
mx_check_mailbox() would update the header flags, but was not
returning MUTT_FLAGS back to the index loop. That meant a screen
redraw was needed to be notified of externally modified flags.
Change maildir_update_flags() to return 1 if the flags were actually
changed. Change maildir_check_mailbox() and mh_check_mailbox() to
return MUTT_FLAGS when that happens.
Thanks to jcdenton and mike-burns for the original patch.
Kevin McCarthy [Fri, 5 May 2017 19:46:36 +0000 (12:46 -0700)]
Change message modifying operations to additively set redraw flags.
With the ability to set redraw flags with the menu stack operations,
some operations internally modify the current menu redraw flag.
For instance, _mutt_set_flag() can now set REDRAW_SIDEBAR.
Change the ops that modify messages to use 'redraw |= REDRAW_X'
instead of overwriting the flag value.
Kevin McCarthy [Fri, 5 May 2017 20:55:31 +0000 (13:55 -0700)]
Don't modify LastFolder/CurrentFolder upon aborting a change folder operation.
Set LastFolder and CurrentFolder after mx_close_mailbox() has
successfully completed. Otherwise, if the close is aborted, they will
have incorrect values.
Kevin McCarthy [Fri, 5 May 2017 01:05:06 +0000 (18:05 -0700)]
Fix sidebar count updates when closing mailbox. (closes #3938)
The context unread and flagged counts were being updated too early in
mx_close_mailbox(). Cancelling at any of the following prompts would
leave them in an incorrect state. Additionally, $move could increase
the delete count (for flagged messages), and $delete, if answered no,
could turn off message deletion.
Move all the sidebar buffy stat updating to the bottom of the
function, after all the prompts and processing.
Richard Russon [Fri, 12 May 2017 13:07:11 +0000 (14:07 +0100)]
merge: always build features which have no build deps
* configure: drop --enable-compressed
* configure: drop --enable-imap
* configure: need_md5 is now always built-in
* configure: drop need_imap
* configure: drop need_socket
* configure: drop --enable-pop
* configure: drop --enable-nntp
* drop: --enable-smtp
* Makefile.am: reflow lists of files
* remove preprocessor else clauses
Richard Russon [Tue, 2 May 2017 13:15:53 +0000 (14:15 +0100)]
remove preprocessor else clauses
Remove the #else clauses from the preprocessor now that these symbols
are always defined:
USE_COMPRESSED
USE_IMAP
USE_NNTP
USE_POP
USE_SIDEBAR
USE_SMTP
USE_SOCKET
Stefan Assmann [Fri, 24 Mar 2017 07:48:27 +0000 (08:48 +0100)]
add %z format strings to index_format
The %Z format string consists of three columns.
Split those up into individual columns to allow more fine grained
control over which flags should be displayed.
%zs message status flags
%zc message crypto flags
%zt message tag flags
There's a small difference compared to %Z which is that the delete flags
have been moved from the crypto column to the status column. %Z will not
be removed for backwards compatibility reasons.
Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Richard Russon [Fri, 12 May 2017 13:01:34 +0000 (14:01 +0100)]
fix bind error messages
Some messages were displayed that shouldn't have been (when bind
succeeded). Some errors weren't getting reported (they were overwritten
by other messages).
Richard Russon [Wed, 3 May 2017 12:39:34 +0000 (13:39 +0100)]
merge: configure.ac improvements
* remove check on unix.h
* remove check on stdarg.h
* remove check on inline and const
* remove check on wide chars
* remove check on fgetpos
* remove check on memmove
* remove check on strerror
* remove check on srand48
* remove check on long long int
* signal: remove test on SYS_SIGLIST_DECLARED
* simplify sig_atomic_t check
* remove check for <dirent.h> d_ino
* drop LANGINFO checks
* remove stuff defined in POSIX:2001
* use basic getopt from unistd.h
* drop HAVE_UNISTD_H
* unused prototypes - unsupported systems
* sys/types.h
* sys/select.h
* inttypes.h includes stdint.h
* Drop obsolete iconv check
* Drop another obsolete iconv check
* tidy md5
Richard Russon [Sat, 29 Apr 2017 16:00:00 +0000 (17:00 +0100)]
tidy md5
No code changes.
This code is imported from the GNU Library.
It contained a lot of definitions and compatability code that we don't
need. Also, tidy some comment blocks.
@gahr
Leverage on AC_C_BIGENDIAN instead of glibc's endian.h
Richard Russon [Fri, 28 Apr 2017 23:44:14 +0000 (00:44 +0100)]
build: change gpgme requirement back to 1.1.0
RHEL6 is still using GPGME 1.1.8, which doesn't have the function
`gpgme_op_export_keys`. Revert the GPGME requirement to 1.1.0 and put
back the #ifdef's around the missing function.
Richard Russon [Sat, 29 Apr 2017 11:23:10 +0000 (12:23 +0100)]
build: remove check_sec.sh
This script looked for mistakes when using mutt functions such as
safe_free(). It was crude. Coverity can do a better job without us
having to litter the code with /* __FREE_CHECKED__ */ comments.
Most of the diff is reworking how notmuch is built. It used an extra
AM_CONDITIONAL but was the only component to do so, so change that to
make it consistent with the rest of the configure.
Lua picked the same thing but BUILD_LUA is actually never used, so it
could be dropped too.
Rest of the commit cleans up some pollution between MUTTLIBS and LIBS.
It was decided to keep the USE_SIDEBAR tests in the codebase to make it
easier to find code related to that feature, but that requires
USE_SIDEBAR to be defined, or it breaks compilation because some symbol
definitions depend on that config option.
Kevin McCarthy [Fri, 28 Apr 2017 04:22:08 +0000 (21:22 -0700)]
Fix km_error_key() infinite loop and unget buffer pollution.
'bind pager \Ch help' produces an infinite loop when an unbound key is
pressed in the pager. The reason is because km_error_key() tries to
verify that the key sequence is really bound to the OP_HELP operation.
It does this by using km_expand_key(), tokenize_unget_string() on the
resulting buffer, then checking if the next km_dokey() returns OP_HELP.
The problem is that km_expand_key() does not always produce a string
that is properly reparsed by tokenize_unget_string(). Control-h
sequences are expanded to ^H. tokenize_unget_string() recognizes this
as two characters '^' and 'H'. km_error_key() checks the OP returned,
which is OP_PAGER_TOP for the '^'. This is not OP_HELP, so it prints
a generic error and returns. This leaves the 'H' in the input buffer!
Since 'H' (by default) is unbound in the pager, it retriggers
km_error_key(), resulting in an infinite loop.
The same issues can occur without control sequences:
bind generic ? noop
bind generic dq help
In the index, hitting an unbound key will end up leaving 'q' in the unget
buffer, because 'd' is bound in the index menu and will be read by km_dokey().
A simple approach to fix this would be to just use the same code as in
mutt_make_help(), which has no double-check. This would be no worse
than the help menu, but can generate an inaccurate error message (e.g
if '?' were bound to noop)
This patch instead uses OP_END_COND as a barrier in the unget buffer.
It directly inserts the keys in the OP_HELP keymap, instead of using
km_expand_key() + tokenize_unget_string(). After calling km_dokey()
it flushes the unget buffer to the OP_END_COND barrier.
Thanks to Walter Alejandro Iglesias for reporting the bug.
Roger Cornelius [Wed, 26 Apr 2017 22:40:34 +0000 (15:40 -0700)]
Fix error message when opening a mailbox with no read permission. (closes #3934)
ctx->mx_ops ends up being NULL for both the case that ctx->magic is 0
and -1. This meant the mutt_perror() error message was never being
printed, because the check for ctx->mx_ops == NULL was taking place
first.
Move the "ctx->magic == -1" check first, so mutt will print out an
appropriate perror message in that case.
Pietro Cerutti [Mon, 24 Apr 2017 15:57:15 +0000 (16:57 +0100)]
Fix and simplify handling of GPGME in configure.ac (#545)
* Fix
When GPGME is not installed, the m4 macro AM_PATH_GPGME is not defined,
which causes autoconf to fail. The fix adds an `ifdef` around the block
to skip expanding the macro, if it's not defined.
* Enhancement
The enhancement is to assume that we have at leat GPGME 1.2.0 (released
in 2009). This allows us to simplify the configure.ac code block by
avoiding checks for functionalities we know to be there.