aboutsummaryrefslogtreecommitdiff
path: root/emacs/notmuch-hello.el
AgeCommit message (Collapse)Author
2026-01-15emacs/hello: fix one case of passing hide-excludedDavid Bremner
In the search box (and recent searches), notmuch-search-hide-excluded was not being passed to notmuch-search. This means that excluded messages were always shown in the results. Fix this by passing the extra argument.
2025-03-14Set 'untrusted-content' to t in all modesStefan Kangas
Instead of trying to guess in which modes this is safe not to set in, let's just set it in all of them. Background (added by db): untrusted-content was added in Emacs 29.3 and is currently set by Gnus and used by org-mode to prevent certain unsafe operations. I think the intent is to use it for blocking more unsafe operations in the future.
2024-07-25emacs/hello: refresh hello directlyDavid Bremner
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.
2024-05-29emacs: Allow customizing :excluded in notmuch-saved-searchesMohsin Kaleem
Provide customize support for the new feature introduced in cd89065d. Commit message expanded by: db
2024-04-06emacs: Add new option notmuch-search-hide-excludedMohsin Kaleem
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
2023-10-06emacs: wrap docstringsDavid Bremner
Suppress byte-compiler warnings about >80 character docstrings.
2023-10-06emacs: update quoting in docstringsDavid Bremner
The complicated looking escapes are needed to avoid compile time warnings. (info "(elisp) Text Quoting Style") for details.
2022-02-26emacs: redirect undo to notmuch-tag-undoDavid Bremner
The double remap is a bit ugly, but it seems better than adding another layer of keymaps for those modes where notmuch-tag-undo makes sense.
2022-01-23emacs: customizable names for search buffersjao
Customizable names for buffers presenting search results, via two custom variables (notmuch-search-buffer-name-format and notmuch-saved-search-buffer-name-format), defaulting to values currently used for plain searches and including too tree and unthreaded search buffers. Amended by db: spelling fix.
2022-01-23emacs: define, use option :disable-excludes for n-h-query-countsDavid Bremner
Initially only use in notmuch-hello-insert-alltags. This is a more narrow resolution of [1], which (unlike [2]) does not disable exclude processing for regular saved searches. [1]: id:87wox1vovj.fsf@len.workgroup [2]: id:20220105010606.2034601-2-david@tethera.net
2022-01-23Revert "emacs: use --exclude=false when checking for empty searches"David Bremner
Revert commit 8370e3cfe2dd8a79323613c2bbf2f11db6134dac, and remark the corresponding test as broken. Also update the expected output of the broken test to show excludes active in the user defined saved searches.
2022-01-20emacs: use --exclude=false when counting total messagesDavid Bremner
Even if a user excludes a large fraction of their messages, they still nonetheless exist and are searchable.
2022-01-20emacs: use --exclude=false when checking for empty searchesDavid Bremner
In particular tags that only occur on otherwise excluded messages do not show up in "All tags" without this change. The reported numbers _do_ take excludes into account, so it is possible that searches (e.g. the aformentioned tags) will show up with a count of zero.
2021-12-23emacs: add notmuch-logo.svg and use it in emacs mua on graphic displaysTomi Ollila
emacs/notmuch-logo.svg is handcrafted scalable vector graphics version of the notmuch logo. Emacs on graphic displays render this image four times in size compared to the emacs/notmuch-logo.png, and the image is much sharper. The rendered image size, 100x100 pixels, fits reasonably well with text shown in various font sizes. Scaling the image -- if desired -- may come in the future. For now this is improvement on how the logo looked in notmuch-hello window.
2021-12-03emacs: drop C-tab binding in hello mode, document <backtab>.David Bremner
The <backtab> binding has always been there, but the docs were apparently mistakenly changed to say <backspace> [1] Revert to <backtab> in the documentation. The commit also drops the C-<tab> binding, since it seems redundant and it interferes with tab-bar-mode. [1]: 703dec7754da477b5683867c88cb940b8553be91.
2021-09-11emacs: wrap call-process-regionDavid Bremner
As with notmuch--process-lines, initial purpose is to provide a safe binding for default-directory. This is enough to make notmuch-hello robust against non-existent or corrupt values default-directory, but probably not other views.
2021-09-11emacs: wrap process-linesDavid Bremner
Initially just set the working directory, to avoid (the implicit) call-process crashing when the default-directory points to a non-existent location. Use of a macro here is over-engineering for this change, but the same change needs to be applied to several other process creation primitives.
2021-08-29emacs: shorten lines in two doc-stringsJonas Bernoulli
The byte-compiler wasn't happy about those.
2021-08-29emacs: use closures instead of backquoted lambdasJonas Bernoulli
2021-07-13emacs: update declaration of notmuch-treeDavid Bremner
This fixes an a warning from the byte-compiler. The commit 74ab62a34018b38a40db4d363fff3faae964b47a changed the function signature but did not update the declaration.
2021-07-03emacs/hello: honouring :sort-order in threaded queriesjao
Now that notmuch show accepts --sort, we can, on the emacs side, use it according to the value of :sort-order in the definition of saved queries.
2021-06-05emacs: fix declare-function definitions with related line breaksTomi Ollila
- declare-function notmuch-unthreaded lacked file name - declare-function notmuch-search had differently named last arg - note: check-declare-directory did not complain about that - declare-function notmuch-search-show-thread without nil - some functions declared to be in different file than those existed ("notmuch" -> "notmuch-lib") - some related function/declare lines were (/are now) wider than 80-columns; added line breaks (and proper indentation) there
2021-01-15emacs: improve how cl-lib and pcase are requiredJonas Bernoulli
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-15emacs: various comment improvementsJonas Bernoulli
2021-01-15emacs: various cosmetic improvementsJonas Bernoulli
2021-01-13emacs: deal with unused lexical arguments and variablesJonas Bernoulli
The previous commit switched to lexical-binding but without dealing with the new warnings about unused lexical arguments and variables. This commit deals with most of them, in most cases by either removing leftover bindings that are actually unnecessary, or by marking certain arguments as "known to be unused" by prefixing their names with "_". In the case of the functions named `notmuch-show-insert-...' the amount of silencing that is required is a bit extreme and we might want to investigate if there is a better way. In the case of `notmuch-mua-mail', ignoring CONTINUE means that we do not fully follow the intended behavior described in `compose-mail's doc-string.
2021-01-13emacs: use lexical-bindings in all librariesJonas Bernoulli
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-13emacs: make headings outline-minor-mode compatibleJonas Bernoulli
`outline-minor-mode' treats comments that begin with three or more semicolons as headings. That makes it very convenient to navigate code and to show/hide parts of a file. Elips libraries typically have four top-level sections, e.g.: ;;; notmuch.el --- run notmuch within emacs... ;;; Commentary:... ;;; Code:... ;;; notmuch.el ends here In this package many libraries lack a "Commentary:" section, which is not optimal but okay for most libraries, except major entry points. Depending on how one chooses to look at it, the "... ends here" line is not really a heading that begins a section, because it should never have a "section" body (after all it marks eof). If the file is rather short, then I left "Code:" as the only section that contains code. Otherwise I split the file into multiple sibling sections. The "Code:" section continues to contain `require' and `declare-function' forms and other such "front matter". If and only if I have split the code into multiple sections anyway, then I also added an additional section named just "_" before the `provide' form and shortly before the "...end here" line. This section could also be called "Back matter", but I feel it would be distracting to be that explicit about it. (The IMO unnecessary but unfortunately still obligatory "... ends here" line is already distracting enough as far as I am concerned.) Before this commit some libraries already uses section headings, some of them consistently. When a library already had some headings, then this commit often sticks to that style, even at the cost inconsistent styling across all libraries. A very limited number of variable and function definitions have to be moved around because they would otherwise end up in sections they do not belong into. Sections, including but not limited to their heading, can and should be further improved in the future.
2021-01-13emacs: define new notmuch-search-item widget typeJonas Bernoulli
This is complex enough to warrant a dedicated widget type, which will make future improvements less messy to implement.
2021-01-13emacs: sanitize dedicated widget action/notify functionsJonas Bernoulli
These functions are used as action/notify functions. That dictates the appropriate function signatures but even though these functions are not used for anything else they use incompatible signatures, forcing the callers to use lambda expressions to deal with these incompatibilities. Fix that by adjusting the function signatures to the needs of the only intended callers. Two of these functions were defined as commands but because the interactive form did not return the mandatory arguments, we know that nobody (successfully) used these as commands. In one case we move the location of a y-or-n-p prompt.
2020-12-06emacs: remove unnecessary notmuch-remove-if-notJonas Bernoulli
We could just have switched to using `cl-remove-if-not' instead, but the two uses of the *remove-if-not function are pretty strange to begin with so we refactor to not use any such function at all.
2020-12-06emacs: remove deprecated notmuch-folder commandJonas Bernoulli
It has been deprecated for a decade and it's time to let go.
2020-12-06emacs: always use elisp quoting style in doc-stringsJonas Bernoulli
Emacs doc-strings use neither markdown nor lisp symbol quoting.
2020-12-06emacs: place complete first sentence on first doc-string lineJonas Bernoulli
2020-12-06emacs: define notmuch-hello-url as a constantJonas Bernoulli
2020-12-06emacs: sanitize function that displays versionJonas Bernoulli
Previously it was defined in "notmuch-hello.el" and its name contained "hello" solely because it replaced an anonymous function that was mistakenly only bound in `notmuch-hello-mode-map'. But it makes more sense to bind it in all notmuch modes and even if we did not change that aspect it still would make no sense to have "hello" in its name.
2020-12-06emacs: more cleanup since dropping support for Emacs 24Jonas Bernoulli
Notmuch requires at least version 25 of Emacs now. Adjust comments that previously referenced version 24 specifically, even though they also apply to later releases. Remove documentation and code that no longer applies. - `mm-shr' no longer references `gnus-inhibit-images'.
2020-12-06emacs: remove redundant notmuch-hello-trimJonas Bernoulli
Use `string-trim', which exists since Emacs 24.4.
2020-08-22emacs: Use pop-to-buffer-same-window rather than switch-to-bufferSean Whitton
This means that notmuch commands obey display-buffer-alist so the user can customize how buffers show up. It also permits the use of C-x 4 4, C-x 5 5 and C-x t t, available in Emacs 28. For example, one can use C-x 4 4 M-x notmuch-jump-search RET to open a saved search in another window rather than the current window. Or in notmuch-search mode, C-x 5 5 RET to view the message at point in a new frame. notmuch-tree has custom buffer display logic, so bind display-buffer-overriding-action to make pop-to-buffer-same-window behave exactly as switch-to-buffer while that function is running.
2020-08-09emacs: Use cl-incf where appropriateJonas Bernoulli
It's shorter. That's it pretty much.
2020-08-09emacs: No longer define notmuch-hello-mode-map as a functionJonas Bernoulli
It was defined as such for a decade; ever since a56010ac8b89a2489eee5c78469f05cee85ec858 but there wasn't a reason to do that then nor is there now.
2020-08-09emacs: Use 'when' instead of 'if' when there is no ELSE partJonas Bernoulli
2020-08-09emacs: Use 'unless' instead of 'when' and 'not'Jonas Bernoulli
Also use 'unless' in a few cases where previously 'if' was used with 'not' but without an ELSE part.
2020-08-09emacs: Fix indentationJonas Bernoulli
2020-08-09emacs: Remove excess empty linesJonas Bernoulli
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.
2020-08-09emacs: Shorten long linesJonas Bernoulli
2020-06-06emacs docstrings: consistent indentation, newlines, periodsTomi Ollila
Fixed emacs docstrings to be consistent. No functional change. - removed some (accidental) indentation - removed some trailing newlines - added trailing periods where missing (some exclusions)
2020-04-27emacs: Use `cl-lib' instead of deprecated `cl'Jonas Bernoulli
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.
2020-03-19notmuch-hello/jump: allow saved searches to specify unthreaded modeMark Walters
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.
2020-03-19Introduce unthreaded modeMark Walters
This commit introduces a new 'unthreaded' search mode where each matching message is shown on a separate line. It shares almost all of its code with tree view. Subsequent commits will allow it to diverge slightly in appearance.