Commit graph

20 commits

Author SHA1 Message Date
Jonas Bernoulli
f3d6fa2e40 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.
2021-01-15 06:47:10 -04:00
Jonas Bernoulli
9ca1f945d9 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.)
2021-01-15 06:46:38 -04:00
Jonas Bernoulli
b4deb33a66 emacs: notmuch-message-apply-queued-tag-changes: cosmetics 2021-01-13 07:23:11 -04:00
Jonas Bernoulli
117501d5ce emacs: define notmuch-message-queued-tag-changes as buffer-local
Also improve the doc-string.
2021-01-13 07:21:32 -04:00
Jonas Bernoulli
fc4cda07a9 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.
2021-01-13 07:16:04 -04:00
Jonas Bernoulli
a4617f29ce emacs: Shorten long lines 2020-08-09 19:48:36 -03:00
Örjan Ekeberg
606f2a6615 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.
2019-04-14 08:00:44 -03:00
Örjan Ekeberg
d9800c8932 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.
2019-04-14 07:58:06 -03:00
Daniel Kahn Gillmor
6a833a6e83 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.
2016-06-05 08:32:17 -03:00
Chunyang Xu
0cf457b73b emacs: Fix packaging
Refer to (info "(elisp) Library Headers") for package conventions.
2016-04-16 08:24:42 -03:00
David Bremner
9de0639126 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.
2013-06-02 11:37:22 -03:00
Jani Nikula
2590d94bf0 emacs: use new tag change helper to mark messages as replied
Clarify documentation while at it.
2012-09-19 08:03:35 -03:00
Jani Nikula
5a48340bf1 emacs: fix notmuch-message-replied-tags defcustom type 2012-09-19 08:02:48 -03:00
Ingo Lohmar
bcdfff4f3a 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.
2012-07-24 09:01:26 -03:00
Jameson Graef Rollins
eb8feb1666 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.
2012-04-29 17:39:37 -03:00
Austin Clements
ee1180018e 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.
2012-03-30 21:27:03 -03:00
Pieter Praet
643ce61c1b 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.
2012-01-19 09:27:02 -04:00
Aaron Ecay
e3260d0253 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.
2011-12-21 07:27:38 -04:00
Daniel Schoepe
d84e927091 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.
2011-05-24 13:28:41 -07:00
Jesse Rosenthal
0adcabc7cf 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.
2010-04-27 09:16:10 -07:00