Now that notmuch-tree-next-thread acts more like its notmuch-show
counterpart, let's update the binding to move to the next thread after
archiving.
Signed-off-by: William Casarin <jb55@jb55.com>
This introduces a new function called
notmuch-tree-next-thread-from-search which is analogous to
notmuch-show-next-thread. It will switch to the next or previous
thread from the parent search results.
We rename notmuch-tree-{prev,next}-thread to a more descriptive
notmuch-tree-{prev,next}-thread-in-tree to reflect the fact that it
only moves to the next thread in the current tree.
notmuch-tree-next-thread now switches to the next thread in the
current tree first, but if there are none, it looks for the next tree
in the search results.
This makes notmuch-tree feel more like notmuch-show when using the
M-Enter, M-n and M-p bindings.
Signed-off-by: William Casarin <jb55@jb55.com>
This variable will be used in a similar fashion to
notmuch-show-parent-buffer. It will be used to navigate between
threads from the parent search buffer.
Signed-off-by: William Casarin <jb55@jb55.com>
Previously in message-show mode message's first header line (From
header) was always indented, even if user had turned thread
indentation off with "<" (notmuch-show-toggle-thread-indentation)
command.
This change modifies notmuch-show-insert-headerline function so that
it doesn't indent the first header line if notmuch-show-indent-content
variable is nil.
This change also modifies tests so that they expect this new output
format:
test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
Doing that is better than using an `autoload' form because the latter
may result in dependencies getting hidden and indeed it turns out we
have to declare `notmuch-jump' in "notmuch-tag.el".
This function is being autoloaded using an autoload cookie, so it
shouldn't additionally be autoloaded using an `autoload' form.
When building libraries we don't actually load the autoloads file and
dropping the `autoload' form results in an error, which reveals a so
far unspecified dependency: `notmuch-tree' needs `notmuch-jump'.
Before this commit compiling (or even just loading) `notmuch-tree'
resulted in `notmuch-jump' being loaded because the former requires
`notmuch-lib', which autoloaded `notmuch-jump-search'.
The bug was that this dependency was not explicitly specified, which
we fix by adding the respective `require' form.
- The first sentence should fit on the first line in full. This is
even the case when that causes the line to get a bit long. If it
gets very long, then it should be made shorter.
- Even even the second sentence would fit on the first line, if it
just provides some details, then it shouldn't be done.
- Symbols are quoted like `so'.
- There is no clear rule on how to (not) quote non-atomic
s-expressions, but quoting like '(this) is definitely weird.
- It is a good idea to remember that \" becomes " and to take
that in mind when adjusting the automatic filling by hand.
- Use the imperative form.
- Arguments are written in all uppercase.
Use `makefile-gmake-mode' instead of `makefile-mode' because the
former also highlights ifdef et al. while the latter does not.
"./Makefile.global" and one "Makefile.local" failed to specify any
major mode at all but doing so is necessary because Emacs does not
automatically figure out that these are Makefiles (of any flavor).
Since Emacs 27 each face has to be explicitly configured to "extend
to the edge of the window". Without doing that the face used for
the newline character only has an effect that spans "one character"
(i.e. it looks like there is a single trailing space character).
We don't want that so extend the face in Emacs 27, so that it looks
the same as it did in older Emacs releases. We have to do this
conditionally, otherwise older Emacsen would choke on it.
It's a bit weird to avoid having to write the "(setq ... )" more than
once, just because we can. In a language that uses '=' for the same
purpose we also happily use that once per assignment.
While there are no benefit to using just one 'setq' there are some
drawbacks. It is not always clear on first what is a key and what a
value and as a result it is easy to make a mistake. Also it becomes
harder to comment out just one assignment.
Most people who write lots of lisp tend to only sparsely use empty
"separator" lines within forms. In lisp they feel unnecessary and
since most files stick to this convention we get a bit confused
when there are extra empty lines. It feels like the s-expressions
are falling into pieces.
All of this is especially true between a function's doc-string and
body because the doc-string is colored differently, which visually
already separates it quite sufficiently from the code that follows.
In notmuch-show buffer insert invisible U+200E LEFT-TO-RIGHT MARK
character at the beginning of message header paragraph if the From
header contains a right-to-left character. This ensures that the
header paragraph is always rendered in left-to-right mode.
See Emacs Lisp reference manual section "(elisp) Bidirectional
Display" for more info.
Fixed emacs docstrings to be consistent. No functional change.
- removed some (accidental) indentation
- removed some trailing newlines
- added trailing periods where missing (some exclusions)
Before this change, `load-prefer-newer' was ignored.
Set NOERROR and MUST-SUFFIX arguments of `load' to t, and NOSUFFIX
argument to nil, to preserve the behaviour of the deleted `let' form.
Starting with Emacs 27 the old `cl' implementation is finally
considered obsolete. Previously its use was strongly discouraged
at run-time but one was still allowed to use it at compile-time.
For the most part the transition is very simple and boils down to
adding the "cl-" prefix to some symbols. A few replacements do not
follow that simple pattern; e.g. `first' is replaced with `car',
even though the alias `cl-first' exists, because the latter is not
idiomatic emacs-lisp.
In a few cases we start using `pcase-let' or `pcase-lambda' instead
of renaming e.g. `first' to `car'. That way we can remind the reader
of the meaning of the various parts of the data that is being
deconstructed.
An obsolete `lexical-let' and a `lexical-let*' are replaced with their
regular variants `let' and `let*' even though we do not at the same
time enable `lexical-binding' for that file. That is the right thing
to do because it does not actually make a difference in those cases
whether lexical bindings are used or not, and because this should be
enabled in a separate commit.
We need to explicitly depend on the `cl-lib' package because Emacs
24.1 and 24.2 lack that library. When using these releases we end
up using the backport from GNU Elpa.
We need to explicitly require the `pcase' library because
`pcase-dolist' was not autoloaded until Emacs 25.1.
This is the non-deprecated way to use completing-read. Additionally
the old use was broken when using ivy for completing-read. For user's
using completing-read-default they won't see the default URL now, but
if they hit enter it will be visited. Alternatively they can select
it with M-n.
From the completing-read documentation for initial-input:
This feature is deprecated--it is best to pass nil for INITIAL-INPUT
and supply the default value DEF instead. The user can yank the
default value into the minibuffer easily using M-n.
Additionally collection is now all urls, rather than all but the
first. I'm not sure why "(cdr urls)" was previously done.
This is like notmuch-search-filter-by-tag, but creates a new search
rather than filtering the current search. We add this to
notmuch-common-keymap since this can be used by many contexts. We bind
to the key "t", which is the same key used by
notmuch-search-filter-by-tag in notmuch-search-mode-map. This is done
intentionally since the keybinding for notmuch-search-mode-map can be
seen as a specialization of creating a new search.
This change was motivated for use in "notmuch-hello". It is a more
convenient way to search a tag than expanding the list of all tags. I
also noticed many saved searches people use are simply tags.
Add x and X binds to notmuch-tree for functionally that we have in
notmuch-show.
The notmuch-tree-quit binding is somewhat redundant, since it is
handled by notmuch-bury-or-kill-this-buffer which is bound to q.
Signed-off-by: William Casarin <jb55@jb55.com>
This functions removes some duplicate logic between
notmuch-tree-{next,prev}-matching-message
We do this because we will be adding some additional logic similar to
the notmuch-show-next-open-message function, and it will help if this
logic is all in one place.
Signed-off-by: William Casarin <jb55@jb55.com>
This function captures some common logic when jumping to matching
messages in notmuch-tree mode.
We also add a new return value (t or nil), that indicates if there was
a next matching message in the thread to show.
Signed-off-by: William Casarin <jb55@jb55.com>
Without this change, we see the following warning when compiling the
elisp:
```
EMACS emacs/notmuch-crypto.elc
In end of data:
emacs/notmuch-crypto.el:266:1:Warning: the function
‘notmuch-show-get-message-id’ is not known to be defined.
```
Thanks to Örjan Ekeberg and David Edmondson for their followup about
this.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Saved searches in notmuch-hello and notmuch-jump can specify whether
to use search mode or tree mode. This adds an option for them to
specify unthreaded mode.