emacs: make subr-x available in all libraries Like `cl-lib' and `pcase', which are already available in all libraries, `subr-x' also provided many useful functions that we would like to use. Making `subr-x' available in every library from the get-go means that we can use the functions it defines without having to double check every single time, whether the feature is already available in the current library.
emacs: improve how cl-lib and pcase are required We need to load `cl-lib' at run-time because we use more from it than just macros. Never-the-less many, but not all libraries required it only at compile-time, which we got away with because at least some libraries already required it at run-time as well. We use `cl-lib' and (currently to a lesser extend) `pcase' throughout the code-base, which means that we should require these features in most libraries. In the past we tried to only require these features in just the libraries that actually need them, without fully succeeding. We did not succeed in doing so because that means we would have to check every time that we use a function from these features whether they are already being required in the current library. An alternative would be to add the `require' forms at the top of every library but that is a bit annoying too. In order to make sure that these features are loaded when needed but also to keep the noise down we only require them in "notmuch-lib.el", which most other libraries require, and in most of the few libraries that do not do so, namely "notmuch-draft.el", "notmuch-message.el" and "notmuch-parser.el". ("coolj.el", "make-deps.el", various generated libraries, and "notmuch-compat.el" are left touched.)
emacs: notmuch-message-apply-queued-tag-changes: cosmetics
emacs: define notmuch-message-queued-tag-changes as buffer-local Also improve the doc-string.
emacs: use lexical-bindings in all libraries Doing so causes many new compile warnings. Some of these warnings concern genuine changes in behavior that have to be addressed right away. Many other warnings are due to unused variables. Nothing has changed here, except that the byte-compiler can now detect these pre-existing and harmless issues. We delay addressing these issues so that we can focus on the important ones here. A third group of warnings concern arguments that are not actually used inside the function but which cannot be removed because the functions signature is dictated by some outside convention. Silencing these warning is also delayed until subsequent commits.
emacs: Shorten long lines
emacs: Tag forwarded messages with +forwarded (customizable) Use the buffer-local variable notmuch-message-queued-tag-changes to change tags when the forwarding message is sent.
emacs: Use a buffer-local variable to update tags when sending replies Instead of relying on the "In-Reply-To" header, use a buffer-local variable, notmuch-message-queued-tag-changes, to add and remove tags to affected messages when the message-send-hook is triggered.
Use https instead of http where possible Many of the external links found in the notmuch source can be resolved using https instead of http. This changeset addresses as many as i could find, without touching the e-mail corpus or expected outputs found in tests.
emacs: Fix packaging Refer to (info "(elisp) Library Headers") for package conventions.
emacs: replace (funcall 'foo ...) with (foo ...) I can't see any benefit to the funcall, and it looks like the result of cut-and-paste from some code that actually used a variable for the function to call.
emacs: use new tag change helper to mark messages as replied Clarify documentation while at it.
emacs: fix notmuch-message-replied-tags defcustom type
emacs: Fix notmuch-message-mark-replied. notmuch-message-mark-replied used "apply" to change message tags according to notmuch-message-replied-tags after sending a reply. This works if the latter is a single-element list. But with the recently changed format of tag changes, it breaks for multiple-element lists. Use "funcall" to properly pass the list of tag changes as a single argument.
emacs: create notmuch-tag.el, and move appropriate functions from notmuch.el Tagging functions are used in notmuch.el, notmuch-show.el, and notmuch-message.el. There are enough common functions for tagging that it makes sense to put them all in their own library. No code is modified, just moved around.
emacs: Escape all message ID queries This adds a lib function to turn a message ID into a properly escaped message ID query and uses this function wherever we previously hand-constructed ID queries. Wherever this new function is used, documentation has been clarified to refer to "id: queries" instead of "message IDs". This fixes the broken test introduced by the previous patch.
emacs: logically group def{custom,face}s To allow for expansion whilst keeping everything tidy and organized, move all defcustom/defface variables to the following subgroups, defined in notmuch-lib.el: - Hello - Search - Show - Send - Crypto - Hooks - External Commands - Appearance As an added benefit, defcustom keyword args are now consistently ordered as they appear @ defcustom's docstring (OCD much?). Proper defgroup docstrings and various other improvements by courtesy of Austin Clements.
Don't quote lambda forms This generates byte-compiler warnings on (at least) current trunk versions of Emacs. The quote is not necessary; lambda forms are self-quoting.
emacs: add notmuch-before- and notmuch-after-tag-hook This patch adds hooks that are run before/after messages are tagged From the emacs interface. In order to implement this and to avoid having hooks parse all the arguments to the notmuch binary again, I created a `notmuch-tag' function that other modules should use instead of running (notmuch-call-notmuch-process "tag" ...) directly.
emacs: Add auto-tagging for replied messages. Add `notmuch-message-mark-replied', a function for automatically tagging replied messages with user-defined tags. The tags (which can be either added or removed) can be customized with the customization variable `notmuch-message-replied-tags'. This is a simple list of strings. Any string prefaced with a "-" will be removed; any string prefaced with a "+" (or neither "+" nor "-") will be added. This adds a new file notmuch-message.el, for functions which target message mode (and in the future, notmuch-message mode). Based on some conversation, notmuch-message.el will probably end up subsuming notmuch-mua.el, but until we figure out exactly how we want to do that, they will remain separate files. Edited-by: Carl Worth <cworth@cworth.org>: Remove trailing whitespace and add newline at end of file.