Commit graph

345 commits

Author SHA1 Message Date
jao
f63d14a8c1 emacs: notmuch-tree-outline-mode
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".
2023-02-20 08:58:32 -04:00
Michael J Gruber
a5f7efd722 doc: mark --output=summary as default
`notmuch search` behaves differently depending on the output option: It
either outputs information pertaining to all threads with matching
messages (summary, threads) or to all matching messages (messages,
files, tags). The man page refres solely to the former in the main
description.

Help the user by clearly marking `summary` as the default output option.

Signed-off-by: Michael J Gruber <git@grubix.eu>
2022-12-03 09:32:48 -04:00
Robin Jarry
793f298091 cli: add options --offset and --limit to notmuch show
notmuch search does not output header values. However, when browsing
through a large email corpus, it can be time saving to be able to
paginate without running notmuch show for each message/thread.

Add --offset and --limit options to notmuch show. This is inspired from
commit 796b629c3b ("cli: add options --offset and --limit to notmuch
search").

Update man page, shell completion and add a test case to ensure it works
as expected.

Cc: Tim Culverhouse <tim@timculverhouse.com>
Cc: Tomi Ollila <tomi.ollila@iki.fi>
Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-11-05 13:18:15 -04:00
David Bremner
2e5ef69fbf lib: add field processor for lastmod: prefix
By sharing the existing logic used by the sexp query parser, this
allows negative lastmod revisions to be interpreted as relative to the
most recent revision.
2022-09-03 08:43:33 -03:00
David Bremner
606d9b02e4 lib/sexp: provide relative lastmod queries
Test the relatively trivial logic changes for the sexp query parser
first before refactoring that logic to share with the infix query
parser.
2022-09-03 08:36:53 -03:00
David Bremner
b76f73efe3 doc/emacs: use define-key instead of hard-coding markup
Add keys to index. Allow indexing of both keys and commands. Use
standard typesetting for multiple keybindings.
2022-08-11 07:48:54 -03:00
David Bremner
aebf5b6d84 doc/emacs: replace use of emacsvar with el:defcustom
Mainly this allows dropping the ad-hoc directive emacsvar
2022-08-11 07:48:54 -03:00
David Bremner
0f3b196144 doc/emacs: replace emacscmd with el:define-key
This allows us to eliminate the ad-hoc emacscmd directive / role, and
improve indexing.

doc/emacs: convert remaining uses of emacscmd to define-key

This allows us to remove the no-longer used object type.
2022-08-11 07:48:54 -03:00
David Bremner
174221b179 doc/emacs: split index category from label
A more verbose category is needed for the index, but not the
description in the manual.
2022-08-11 07:43:17 -03:00
David Bremner
fe3db23684 doc/emacs: drop domain label
This makes the generate info files somewhat less verbose, so that they
say e.g. "Key Binding" instead of "Emacs Key Binding"
2022-08-11 07:43:17 -03:00
David Bremner
b2d0720971 doc/elisp: replace label for Emacs commands and key bindings.
In the notmuch doc index it is important to be clear which parts are
Emacs related.
2022-08-11 07:43:17 -03:00
David Bremner
4d367ac0b4 doc: copy elisp.py from flycheck, make available
This corresponds to flycheck commit
1702d2db3d8ba9bcb9b2bf810e791e907fcc3adc, which is apparently the last
time this file was modified (2018).

Embedding seems defensible since the file is evidently not changing
that much, and we need to change some labels to make it fit with the
not-just-emacs nature of notmuch docs.
2022-08-11 07:43:17 -03:00
David Bremner
bf64c48855 doc: add some documentation about duplicate files.
This is mainly motivated by the new emacs-UI features to select
duplicates, but hopefully it will help demystify things for users of
the CLI as well.
2022-08-11 07:32:04 -03:00
David Bremner
429924b28f doc/notmuch: merge two sections on external commands.
When adding the description of the propagation of NOTMUCH_CONFIG, I
missed that there was already a section on external commands, with a
different title.
2022-08-06 09:20:24 -03:00
David Bremner
f4ebb60375 doc/emacs: add docstring for notmuch-unthreaded-result-format.
The main change is actually updating cross references.
2022-07-30 08:53:35 -03:00
David Bremner
dc2097ea9f doc/emacs: add docstring and example for n-tree-result-format
This example is based on one originally by Jon Hurst.
2022-07-30 08:53:07 -03:00
David Bremner
2b10a56c78 doc/emacs: add docstring and example for n-search-result-format
When the ability to use functions was added, this example was confined
to a commit message, which is not user discoverable.
2022-07-30 08:52:37 -03:00
David Bremner
24decfc1dd CLI/reply: support --duplicate argument
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).
2022-07-30 08:45:15 -03:00
David Bremner
cef5eaaef6 CLI/show: initial support for --duplicate for (raw output only)
Add command line argument --duplicate, analogous with that already
supported for notmuch-search.

Use of a seperate function for _get_filename is mainly a form of
documentation at this point.

md5sum is of course a weak hash, but it is good enough for
this (non-adversarial) test suite use.
2022-07-30 08:39:13 -03:00
David Bremner
349987668a doc/emacs: add notmuch-show-empty-saved-searches to manual
Answering a user question, I had to dig for this variable, but I think
it is a reasonably common customization wish, particularly for users
with custom count-functions.
2022-07-15 12:37:34 -04:00
David Bremner
9b4aa9a3e6 doc/emacs: define and use emacsvar and emacscmd markup
This makes it easier to navigate the merged index of all of the
notmuch documentation.
2022-07-15 12:37:24 -04:00
David Bremner
c527358794 doc: do not generate python module index
This currently seems unhelpful, and not generating it removes if from
the navigation bar, which prevents mis-clicking.
2022-07-14 16:31:11 -04:00
David Bremner
9003394f5c doc: drop module index from ToC
There is only one module listed, so the index is not useful.
2022-07-14 16:31:11 -04:00
David Bremner
7ad20fc697 doc: retitle notmuch-emacs manual
This makes the HTML TOC read more naturally. Add a label to make cross
referencing easier.
2022-07-14 16:31:11 -04:00
David Bremner
e55b04b028 doc: reorganize sphinx toctree
This mainly affects the html output (although users generating epub or
pdf would also notice a change). The goal is twofold: make the TOC a
bit friendler and easier to navigate by introducing some hierarchy,
and allow links for nmbug and notmuch-setup.
2022-07-14 16:31:11 -04:00
David Bremner
7925481997 doc: improve config item labels in info output
Commit 306b7028d added the nmconfig role / directive. Unfortunately
the default of using the directive name in texinfo output is pretty
ugly, so attempt to make it more human readable by passing `objname`
to add_object_type invocation.
2022-07-14 16:31:11 -04:00
David Bremner
5e17495ab7 doc/emacs: add discussion about notmuch-show performance.
Most of the information is already in the docstrings, but hopefully
by grouping it is more discoverable.
2022-07-14 11:51:12 -04:00
David Bremner
bde8ea5d1d emacs/show: introduce notmuch-show-height-limit
Analogous to notmuch-show-depth-limit, it requires a bit more
calculation, but that cost seems dominated by the rendering cost.
2022-07-14 11:51:01 -04:00
David Bremner
e580ce0058 emacs/show: obey notmuch-show-max-text-part-size for part 0
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.
2022-07-14 11:48:30 -04:00
David Bremner
1d254bd35e emacs/show: optionally insert bodies of "deep messages" lazily
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.
2022-07-14 11:47:49 -04:00
David Bremner
bf5eacbe7e CLI/git: add --format-version argument to init subcommand
This is primarily intended to support testing upward compatibility
with legacy repos.
2022-07-07 07:05:55 -03:00
David Bremner
6219e7380a CL/git: add format version 1
The original nmbug format (now called version 0) creates 1
subdirectory of 'tags/' per message. This causes problems for more
than (roughly) 100k messages.

Version 1 introduces 2 layers of hashed directories. This scheme was
chose to balance the number of subdirectories with the number of extra
directories (and git objects) created via hashing.

This should be upward compatible in the sense that old repositories
will continue to work with the updated notmuch-git.
2022-07-07 06:56:05 -03:00
David Bremner
3cb936b7c4 doc: replace symlink with copies for nmbug, notmuch-setup
Previously only man page aliases were being added as symlinks.  The
addition to man_pages in conf.py automatically propagates to the list
of generated info pages.

Installation of the new pages is handled by existing recipes.
2022-07-03 18:01:57 -03:00
David Bremner
d73ddec5b8 doc/sexp: document range queries.
Give examples for date fields, as these are commonly useful for user
queries.
2022-06-25 19:52:42 -03:00
David Bremner
7d1e5a5348 CLI/git: add safety checks for checkout and commit
Commits or checkouts that modify a large fraction of the messages in
the database should be relatively rare (and in some automated process,
probably non-existent). For initial setup, where such operations are
expected, the user can pass --force.
2022-06-17 08:40:19 -03:00
David Bremner
99e85823c8 CLI/git: support configuration for repo location / prefix
This is probably more convenient than always passing a command line
argument.

Use notmuch-config for consistency with other notmuch CLI tools.

Now that there is something relevant in the config files, test the
--config option.
2022-06-17 08:40:19 -03:00
David Bremner
8ed68c1bbe CLI/git: change defaults for repo and prefix
The previous defaults were not suitable for personal (i.e. not
bugtracking for notmuch development) use.

Provide two ways for the user to select nmbug compatible defaults;
command line argument and checking the name of the script.
2022-06-17 08:40:19 -03:00
David Bremner
e50a413906 doc/notmuch-git: initial documentation
This is mainly derived from the various help outputs from the script,
with some massaging of markup and addition of links.
2022-06-17 08:40:19 -03:00
jao
9695e4c38d emacs: use message-dont-reply-to-names when composing replies
notmuch-mua functions for replies now use the built-in customizable
variable message-dont-reply-to-names with the same semantics as
message-mode.
2022-06-16 08:51:19 -03:00
David Bremner
a5504e8b1c CLI: document handling of --config for external commands
Create a section of the notmuch(1) manpage to have some place to put
this documentation.
2022-06-13 07:28:35 -03:00
David Bremner
ae1fc657ef doc/emacs: document a few notmuch-hello customizable variables.
A user asked about the thousands separator on IRC, and I had to check
the source.
2022-05-29 07:30:22 -03:00
David Bremner
fd46fc1977 emacs: document/defcustom notmuch-multipart/alternative-discouraged
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.
2022-05-20 22:40:32 -03:00
David Bremner
306b7028d2 doc: define and use semantic markup for configuration items
This makes sure each configuration item is cross referenceable without
extra markup, and also adds index entries.
2022-05-20 22:40:32 -03:00
David Bremner
d8492f7540 doc/emacs: document notmuch-show-toggle-toggle-elide-non-matching
Recently there was a question on the mailing list about the existence
of this function, so let us try to make it more discoverable.
2022-05-15 18:50:32 -03:00
David Bremner
37492858b6 doc/sexp-queries: be more consistent about ending example text
Most, but not all of the the explanatory texts already end in
'.'. This makes the remainder match.
2022-04-30 14:22:51 -03:00
David Bremner
5e90c847d7 doc/sexp-queries: fix example
Update the explanatory text to match the query.
2022-04-30 14:13:03 -03:00
David Bremner
b2eb0547e1 doc/sexp-queries: escape @ in non-verbatim text
This prevents sphinx-doc from creating spurious mailto: links. Thanks
to Jakub Wilk for telling me about the fix.
2022-04-30 13:46:51 -03:00
David Bremner
a1d139de4d lib: add sexp: prefix to Xapian (infix) query parser.
This is analogous to the "infix" prefix provided by the s-expression
based query parser.
2022-04-15 08:25:46 -03:00
David Bremner
8ed6a172b3 lib: do not phrase parse prefixed bracketed subexpressions
Since Xapian does not preserve quotes when passing the subquery to a
field processor, we have to make a guess as to what the user
intended. Here the added assumption is that a string surrounded by
parens is not intended to be a phrase.
2022-03-19 07:27:29 -03:00
David Bremner
928c204240 emacs: Document undo binding.
This messes up whitespace, which will require a global change to fix.
2022-02-26 08:00:28 -04:00