Florian Klink [Thu, 31 Aug 2017 02:21:26 +0000 (04:21 +0200)]
mutt_notmuch: fix setting custom query_type in notmuch query
nm_normalize_uri re-builds notmuch queries, but nm_uri_from_query
doesn't set query_type back again, so fix that.
Also, use the NmQueryType enum where possible instead of int.
Richard Russon [Wed, 6 Sep 2017 01:41:47 +0000 (02:41 +0100)]
merge: tidying in preparation for config changes
* lib: move more functions into the library
* rename DT_ consts
* rename: rx -> regex
* rename: Unify the multi-byte char table naming
* rename: OPT_* to match their config item
* rename: Global variables to match their config item
Richard Russon [Mon, 4 Sep 2017 18:16:37 +0000 (19:16 +0100)]
rename: Global variables to match their config item
Rename lots of constants to match the user-facing config names.
e.g.
"certificate_file" SslCertFile -> CertificateFile
"nm_open_timeout" NotmuchOpenTimeout -> NmOpenTimeout
Richard Russon [Mon, 4 Sep 2017 17:12:10 +0000 (18:12 +0100)]
rename: OPT_* to match their config item
Rename lots of constants to match the user-facing config names.
e.g.
"forward_decode" OPT_FORW_DECODE -> OPT_FORWARD_DECODE
"imap_servernoise" OPT_IMAP_SERVER_NOISE -> OPT_IMAP_SERVERNOISE
Kevin McCarthy [Mon, 4 Sep 2017 20:26:55 +0000 (13:26 -0700)]
Add warning about using inline pgp with format=flowed. (closes #3963)
The reporter noted that when trying to use inline signing with
format=flowed, the flowed was turned off.
After some research, this appears to be deliberate, probably because
of strange interactions between inline PGP and format=flowed. In fact
the RFC strongly discourages their combined use:
https://tools.ietf.org/html/rfc3676#section-4.6
Add a warning and prompt to use PGP/MIME in mutt_protect().
Kevin McCarthy [Sat, 2 Sep 2017 16:36:52 +0000 (09:36 -0700)]
Fix the new certificate prompt translations.
The Esperanto, Dutch, and Czech po files weren't updated in time for
1.9. Fix the certificate prompt translations by adding a "(s)kip"
choice. Otherwise the prompts would not be functional.
Richard Russon [Fri, 1 Sep 2017 12:45:23 +0000 (13:45 +0100)]
merge: upstream fixes (mutt/default)
* Create ATTACH_CONTEXT to hold attachment index. (see #3728)
* Change helpers functions to pass actx. (see #3728)
* Add helpers to add and remove actx entries. (see #3728)
* Change recvattach to allow nested encryption. (see #3728)
* Add virtual index to actx. (see #3728)
* Fix the expand/collapse code to use the virtual index. (see #3728)
* Fix shared attachment functions. (see #3728)
* Fix attachment check_traditional and extract_keys operations. (see #3728)
* Add edit-content-type helper and warning for decrypted attachments. (closes #3728)
* Fix parent_hdr usage in mutt_attach_reply(). (see #3728)
* Add option to run command to query attachment mime type. (closes #2933) (closes #3959)
Kevin McCarthy [Fri, 11 Aug 2017 16:04:48 +0000 (09:04 -0700)]
Fix parent_hdr usage in mutt_attach_reply(). (see #3728)
If the selected attachments are not messages and no (common) parent is
found, parent_hdr is set to the passed in hdr. In that case, parent
will still be NULL, but parent_hdr and parent_fp will be set.
Change the test to parent_hdr being NULL, not parent, to check for
this case.
Kevin McCarthy [Fri, 11 Aug 2017 01:18:28 +0000 (18:18 -0700)]
Add edit-content-type helper and warning for decrypted attachments. (closes #3728)
Regenerating the actx index will overwrite any changes made to a
decrypted attachment. Change the mutt_edit_content_type() function to
return 1 when a structural change is made. Add a warning message when
that is the case and a decrypted message was edited, so the user is
not surprised.
Note: mutt_edit_content_type() appeared to regenerate multipart
subparts every time, leading to a memory leak. I believe this was an
oversite, and it should have regenerated only when there were no
subparts, so have "fixed" this.
Kevin McCarthy [Fri, 11 Aug 2017 01:18:25 +0000 (18:18 -0700)]
Fix shared attachment functions. (see #3728)
With nested decryption, the correct FP is associated with the
ATTACHPTR entry. Also, the BODY entries are not continguous, so the
functions need to iterate over the actx index, not the BODY structure.
Kevin McCarthy [Fri, 11 Aug 2017 01:18:20 +0000 (18:18 -0700)]
Add helpers to add and remove actx entries. (see #3728)
Use the helper in compose update_idx(), to consolidate the resize
logic and simplify the code.
Separate out the actx "free" routine from a routine to empty out the
idx. The index regeneration routines should flush and rebuild the
index without having to renerate the actx structure.
Kevin McCarthy [Fri, 11 Aug 2017 01:18:18 +0000 (18:18 -0700)]
Create ATTACH_CONTEXT to hold attachment index. (see #3728)
Move the idx and idxlen into ATTACH_CONTEXT. In subsequence patches,
this structure will hold more useful items, such as the virtual index.
The swap out is straightforward, except for:
* update_idx() in compose.c, which post-increments the idxlen in the
call and again in the function.
* mutt_gen_attach_list() which doesn't need to returns the new values.
Damien Riegel [Tue, 22 Aug 2017 16:24:27 +0000 (12:24 -0400)]
move HelpStrings to help.c
HelpStrings was only defined when included in help.c (with the
`#ifdef HELP_C` guard), and it's only used there so move it to where it
belongs and make it static.
Damien Riegel [Tue, 22 Aug 2017 16:22:30 +0000 (12:22 -0400)]
use opcodes.h instead of keymap_defs.h
keymap_defs.h is a generated header and sometimes it falls out of the
sync with config.h, which leads to weird errors about opcodes being
undefined. Using a static header prevents that.
As both keymap_defs.h and keymap_alldefs.h are now gone, gen_defs is no
longer necessary and can be removed as well.
By passing a different formator to `OPS`, one can keep only parts of the
definition she/he is interested in. See the end of opcodes.h for example
usages.
By introducing this new header, it is no longer necessary to generate
keymap_alldefs.h, which was used only for consumption by gettext.
Damien Riegel [Tue, 22 Aug 2017 16:33:59 +0000 (12:33 -0400)]
define USE_NOTMUCH when creating the documentation
Header makedoc_defs.h is used in functions.h and init.h to define some
symbols when generating the documentation. Other mailbox backends are
defined (IMAP, POP), but notmuch was missing.
Fabrice Bellet [Fri, 4 Aug 2017 19:16:53 +0000 (21:16 +0200)]
color: call use_default_colors() in a single location
we call use_default_colors() when parsing colors in rc files only, and
unconditionally when defining the color of the tree element, because the
foreground color of the tree element may be combined dynamically with
the default background color of another element, not explicitely defined
in an rc file. This patch fixes a bug visible with some versions of the
ncurses library: use_default_colors() was used too late, and generated
color leakage effects. (#689)
Richard Russon [Mon, 7 Aug 2017 09:23:55 +0000 (10:23 +0100)]
merge: Standardise the handling of Lists
* Datastructures #1 - PoC of standardizing a couple of fields
* Add queue.h to EXTRA_DIST
* Convert userhdrs to STailQ
* Convert mix chain to STailQ
* HCache now depends on tailq structures instead of List
* Convert UserHeader to STailQ
* Convert MuttrcStack to STailQ
* Convert AutoViewList to STailQ
* Convert Muttrc to STailQ, start to gather common algos in list.h
* Convert AlternativeOrderList and (Attach|Inline)(Allow|Exclude) to STailQ
* Be consistent on variable names
* Convert HeaderOrderList and (Un)?Ignore to STailQ
* Convert MailtoAllow, MimeLookupList and SidebarWhitelist to STailQ
* Remove unused functions
* Convert List to STailQ in imap code
* Convert List to STailQ in ncrypt code
* Convert Hooks to TAILQ
* More idiomatic definition of HookHead
* Convert remaining List structures to STailQ in main.c
* Convert last List instances to STailQ, kill List definition
* Restore naming sanity: s/STailQ/List/g
* Fix list structure name in hcachever.sh
Pietro Cerutti [Fri, 21 Jul 2017 15:05:25 +0000 (15:05 +0000)]
Datastructures #1 - PoC of standardizing a couple of fields
This commits changes the type of two fields in envelope.h from struct List to
to struct STailQHead. This new structure represents a singly-linked tail queue
implemented using FreeBSD's queue.h (imported).
This is a proof of concept to see how we like using macros to implement basic
datastructures (singly and doubly linked lists and tail queues) and algorithms
(traversal, removal, insertion, ...).
I encourage everybody to have a look at the result and comment. Is this the
direction we would like to take?