This works much like notmuch-mua-attachment-regexp, but for the
subject instead. By default, check for empty subjects, as that seems a
reasonable thing to safeguard against.
According to the now deleted commentary, the hack of using run-at-time
was needed for Emacs 24. It seems to be no longer needed for Emacs
28.2, and removing it makes further changes to the code simpler.
37c022ae ("Use `without-restriction` in `with-temporary-notmuch-message-buffer`", 2024-03-14)
introduced a fix for draft saving in a way which is supported on Emacs
29 and above only. Replace this with a construct which we have used
before, so that we keep the same compatibility level.
This ensures that the temporary copy of the current message-mode
buffer is whole and not limited by a current restriction.
An example of such restriction is the default one established by
message-mode when composing a reply, that hides the References,
In-Reply-To and similar headers.
In certain scenarios involving symlinks and setting
find-file-visit-truename, text/calendar parts were not displayed
properly.
Following a suggestion of Al Haji-Ali [1], replace the use of
get-file-buffer with find-buffer-visiting.
[1]: id:m2wmneguh8.fsf@gmail.com
The new notmuch-search-hide-excluded option allows users to configure whether
to show or hide excluded messages (as determined by search.exclude_tags
in the local notmuch config file). It defaults to true for now to maintain
backwards-compatibility with how notmuch-{search,tree} already worked.
New commands notmuch-search-toggle-hide-excluded and
notmuch-tree-toggle-exclude have also been added. They toggle the value
of notmuch-search-hide-excluded for the search in the current search or
tree buffer. It's bound to "i" in the respective keymaps for these
modes.
Lastly I've amended some calls to notmuch-tree and notmuch-unthreaded
which didn't pass through the buffer local value of
notmuch-search-oldest-first (and now notmuch-search-exclude).
Examples of where I've done this include:
+ notmuch-jump-search
+ notmuch-tree-from-search-current-query
+ notmuch-unthreaded-from-search-current-query
+ notmuch-tree-from-search-thread
A new test file for Emacs has been added which covers the usage of the
new `notmuch-search-hide-excluded' option and interactively hiding or
showing mail with excluded tags. These test cover the basic usage of
the `notmuch-search-toggle-hide-excluded' command in notmuch-search,
notmuch-tree and notmuch-unthreaded searches. These tests also cover
the persistence of the current value of the hide-excluded mail option
as a user switches from between these different search commands.
[1]: id:87ilxlxsng.fsf@kisara.moe
Amended-by: db, fix indentation in T461-emacs-search-exclude.sh
Some people (e.g: me) prefer to read their email with threaded
representation by default.
Without this commit, I have to run "notmuch-search" (autoloaded)
first to get "notmuch-tree" loaded.
Currently the --to/--cc/--bcc options add "user@example.com, " to the
message headers, with the the unnecessary ", " separator after the
last address, regardless of how many addresses are being added.
This used to be fine, but with recent emacs mm, trying to send the
email with the trailing commas leads to prompt:
Email address looks invalid; send anyway? (y or n)
Fix this by only adding the commas between addresses, avoiding the
trailing commas.
According to emacs upstream [1], we can't expect overlay invisibility
and images to get along. This commit uses the previously stashed
undisplayer functions to actually remove the images from the buffer.
When the image is toggled, it is essentially redisplayed from scratch,
using the previously stashed redisplay data.
[1]: https://lists.gnu.org/archive/html/emacs-devel/2023-08/msg00593.html
This data will be used to redisplay an image that is hidden by
deleting it from the buffer. We cannot easily delay until the image
is hidden, as we won't have the original data at that point.
For some kinds of MIME parts (at least images), our trickery with
overlays will not work, so save the more drastic function created by
Gnus that actually deletes the part from the buffer. In an ideal world
we would return this function as (part of) a value, but here the call
stack is too complicated for anything that simple, so we stash it in
the part plist and rely on that being preserved (unlike the mm handle,
which is transient).
With this mode, one can fold trees in the notmuch-tree buffer as if
they were outlines, using all the commands provided by
outline-minor-mode. We also define a couple of movement commands
that, optional, will ensure that only the thread around point is
unfolded.
The implementation is based on registering a :level property in the
messages p-list, that is then used by outline-minor-mode to to
recognise headers.
Amended by db: Copy docstring to manual and edit for presentation. Add
two tests. Fix typo "wether".
Although this has more steps than the previous regular expression
search and replace, it should be more robust against changes in the
headerline format, such as the inclusion of duplicate numbers (which
broke the previous version).
OTHER-HEADERS are expected to be passed as strings, to match the
implementation of `compose-mail'. But the "From" header is currently
expected to be passed as a symbol. Instead the "From" header can be
safely added after converting all the headers to symbols.
notmuch-search-insert-authors now sets the evaporate property on the
ellipsis overlays. Emacs will delete them when the buffer contents
are zeroed out, which happens with `notmuch-refresh-buffer`. This
prevents them from being collapsed to zero-width overlays in position
1. See Emacs bug#58479. An upcoming change in Emacs will make these
dangling overlays visible to the user.
...and bind these to "E" in their respective keymaps.
Expected to be called interactively, then using read-from-minibuffer
with current search string as initial contents for editing.
(Noninteractive use makes little sense, but is supported.)
With this one can expand (as an opposite to limit) their
query and have e.g. (some of their) saved searches as search
"templates".
While at it, removed `(defvar notmuch-search-query-string)` from
notmuch-tree.el; it is unused (`notmuch-tree-basic-query` is used
instead).
Thanks to Jose Antonio Ortega Ruiz for his example for notmuch-tree
code, and better interactive use.
This enables auto-completion of commands, something which plain
read-string does not do. It's otherwise a drop-in
replacement. According to `C-h f`, read-shell-command was introduced
in Emacs 23.1 or earlier.
Hook run when the tree insertion process finishes its job.
--
This patch supersedes <id:20220816214023.1523322-1-jao@gnu.org>, but
changing the new variable name.
Right now, it can be used for silly things like removing or changing
the the "End of search." hardcoded message in the tree buffer. But
also for more sophisticated things like folding all threads in add-ons
like my outline mode for tree buffers (to be submitted).
Signed-off-by: jao <jao@gnu.org>
It seems redundant to have the previous example, since the default
value is always show by describe variable.
Enforce more restrictions on the keys in the alist, since arbitrary
strings don't work as field names.
Document that functions can be used in lieu of field names.
It seems redundant to have the previous example, since the default
value is always show by describe variable.
Enforce more restrictions on the keys in the alist, since arbitrary
strings don't work as field names.
Document that functions can be used in lieu of field names.
Essentially we just need to arrange to pass the right --duplicate
argument to notmuch reply.
As a side-effect, correct the previously unused value of EXPECTED in
T453-emacs-reply.sh.
We want the reply used to match that shown e.g. in the emacs
interface. As a first step provide that functionality on the command
line.
Schema does not need updating as the duplicate key was already
present (with a constant value of 1).
This new command allows the user to interactively choose a different
duplicate (file) to display for a given message in
notmuch-show-mode. Since both tree and unthreaded view use
notmuch-show-mode, this provides the same facility there.
This parameter was originally introduced to hide large attachements
that happened to be text/plain. From a performance point of view,
there is no reason not to also hide large message bodies.
This leverages the machinery already there to insert buttons for
attachments.
A potential use-case is browsing the top layers of the tree to decide
which of the lower subtrees to read.
The only functionality actually used by notmuch is the base function
notmuch-query-get-threads; the other functions in this file have
nothing to do with that (single) use. Move that function into
notmuch-lib.el and rename to reflect use. Deprecate the other
functions in notmuch-query.el.
Having notmuch-show-next-thread return non-nil on success and nil on
failure makes it easier for users to interact with notmuch via elisp.
This commit changes notmuch-search-show-thread too since the return
value of notmuch-show-next-thread depends on notmuch-search-show-thread.
Amended by db: fix whitespace in T450-emacs-show
Move point to the position that makes the most sense instead of always
moving point to the TO. This is useful when TO/SUBJECT are passed as
argument.
Amended by db: move news item to UNRELEASED.
If a string value is assigned to notmuch-show-header-line, it's used
as a format string to be passed passed to format-spec with `%s`
substituted by the message's subject. If a function is given, it's
called with the subject as argument, and its return value used as
header line.
As before, t means displaying the subject and nil not using any header
line.
Signed-off-by: jao <jao@gnu.org>
Amended-by: db, docstring spelling fix
This variable is important for people who want to change the default
behaviour when displaying multipart/alternative messages. Previously
it was undocumented. Add a defcustom to help users and copy some
documentation from the wiki. The usual machinery of re-using
docstrings is a bit tricky to use here because it mangles the example
lisp code, and the link to the info node should not be in e.g. the
html page.
Add a simple test to make sure the switch from defvar to defcustom did
not break something obvious.