aboutsummaryrefslogtreecommitdiff
path: root/emacs
AgeCommit message (Collapse)Author
2026-03-15emacs: Switch mode before pop-to-bufferAurelien Rouene
When showing an email using notmuch-show-mode, set the mode "notmuch-show-mode" before using "pop-to-buffer-same-window", to be able to match on the major-mode with an entry in "display-buffer-alist". Using the major mode is the the only mean to set display rules, because the buffer title is set to the title of the email and is not fixed. Signed-off-by: Aurelien Rouene <aurelien@rouene.fr>
2026-02-22emacs: Fix warnings on emacs@31.1Al Haji-Ali
Use `when-let*' instead of `when-let'. Use quoted `font-lock-warning-face' instead of obsolete variable.
2026-01-25emacs: Have email reply positions respect relevant message.el optionsKristoffer Balintona
Previously, when composing email replies with `notmuch-mua-new-mail', the email signature would always be placed below the email citation. However, there are two message.el user options that affect the position of the signature and email body: `message-cite-reply-position` and `message-cite-style-gmail'. Previously, neither of these user options were respected. Respect these user options. If `message-cite-reply-position' is 'traditional or 'below, place the email signature below the citation (the previous behavior is retained). If `message-cite-reply-position' is 'above, place the email signature above the citation (like in Gmail-style email replies). `message-cite-style-gmail' may specify a value for `message-cite-reply-position'. If it does, that value takes precedence over `message-cite-reply-position'.
2026-01-25emacs: fix `notmuch-*-filter-by-tag' query stringsKristoffer Balintona
`notmuch-tree-filter-by-tag' and `notmuch-search-filter-by-tag' are described, in their docstrings, as matching all the messages in the current view that are ALSO tagged by a given tag. However, since the current view's search query was not logically grouped together (with parentheses), the actual behavior was different for sufficiently complex search queries. Fix this by grouping the current view's search query in parentheses first.
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.
2026-01-14emacs: Generate and install autoloadsPengji Zhang
Previously when installed with 'make install', autoloads in sources were not scraped. So users still had to load the full library beforehand in order to use Notmuch. Now we generate and install such a file for 'make install-emacs'. With this change, users can replace in their Emacs configuration: (require 'notmuch) with a much cheaper: (require 'notmuch-autoloads) but are still able to use 'M-x notmuch'. Note that this new file is not included in the 'make elpa' package, so it does not break for those users, who have already been enjoying autoloads generated by 'package.el'. Besides, this should not break packaging for most distros. Even if they have generated and maintained such a file using their package managers, Emacs does not choke on an existing output file when scraping autoloads. Re: thread starting at id:87o75yl4u5.fsf@pengjiz.com Amended-By: db; add comment about autoload-excludes
2025-06-20emacs/search: call notmuch-search-mode before popping to bufferjonah
This makes derived-mode matching in display-buffer-alist work.
2025-03-20emacs: fix disabling notmuch-show-header-line via customlen@realtimegenomics.com
The defcustom had a typo that prevented it from working as intended.
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.
2025-03-13emacs/tree: add call to notmuch-hl-line-mode from process-filterDavid Bremner
This removes the visual gap/stutter between when the screen fills and when the hl-line "cursor" is drawn. It is not obviously how to robustly test this, since it the observable effect is purely a matter of timing.
2025-03-13emacs/tree: call notmuch-hl-line-mode from tree-sentinelDavid Bremner
There is a a perceptible gap between when the tree shows up and when the hl-line is visible, but this is better than the previous state where the line did not show up at all until the user moved the cursor.
2025-03-13emacs/tree: condition hl-line-mode on notmuch-hl-lineDavid Bremner
It isn't clear that this call to hl-line-mode will survive the coming re-organization to stop relying on hooks, but incrementally this at least makes the disabling behaviour consistent.
2025-03-13emacs: replace use of hook to draw hl-line in search modeDavid Bremner
In the thread at id:87fsfuuxwn.fsf@thinkbox, a bug is discussed where the point and hl-line overlay get out of sync, leading the user to open the wrong message. As far as I can tell this is caused by notmuch-hl-mode being invoked too early. This change bypasses the logic preventing notmuch-search-hook being called only once, so that the overlay is updated later after the buffer is full(er). This change may lead to the overlay being updated multiple times; if this is annoying we can add a similar buffer local variable to ensure it is only called once. The extra logic to check notmuch-search-target-line reduces the flicker somewhat by not highlighting the first line every time.
2025-03-13emacs: add defcustom to control hl-line modeDavid Bremner
Currently the presence of hl-line highlighting is controlled implicitely by hooks. In future commits it will be migrated to use this variable.
2025-02-18notmuch-show-imenu-prev-index-position-function: Don't recenterDamien Cassou
The previous version of notmuch-show-imenu-prev-index-position-function was calling notmuch-show-previous-message which was recentering the window. This is a problem when which-func-mode is active because which-func-mode is called each time the user moves point around. Because this function is only meant to be executed by imenu, there is no reason to recenter the window. For the same reason, the new implementation doesn't have to follow strictly how notmuch-show-previous-message is implemented because imenu only places point at very specific locations before calling notmuch-show-imenu-prev-index-position-function.
2024-08-16emacs/mua: Correct autoload cookiesPengji Zhang
This is a follow-up to [1: 8d06dfce]. Per Info node '(elisp)Autoload', autoload cookies should start with ';;;###'. 1: 2024-04-04 8d06dfce175593aebae9a759c9167df4988a3444 emacs: Autoload notmuch-user-agent related functions
2024-08-09Revert "emacs: Fix saved-search buffer titles"David Bremner
This reverts commit bc989209171d406b3671024542e59b86b0ecb23d. This was applied unintentionally to master while still under discussion.
2024-08-06emacs/tree: sanitize subjects when drawing treeDavid Bremner
This fixes the bug reported in id:6F2EF901-8B4B-44FF-83C5-22F732BA95A6@gmail.com Unfortunately it turns out our test data has several tabs in the subject lines. The expected output was updated to reflect their removal and the ripple effect of several more subjects matching the previous ones.
2024-08-06emacs: Fix saved-search buffer titlesRudolf Adamkovič
REPRODUCTION STEPS: (let ((notmuch-saved-searches (list (list :name "Emacs List" :query "query:lists-emacs") (list :name "All Lists" :query "query:lists")))) (notmuch-search-buffer-title "query:lists-emacs" )) ACTUAL: "*notmuch-saved-search-[ All Lists ]-emacs*" EXPECTED: "*notmuch-saved-search-Emacs List*"
2024-07-25emacs/mua: optionally check for erroneous subjectsTony Zorman
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.
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-06-19Replace `without-restriction` with `save-restriction`Michael J Gruber
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.
2024-06-15Use `without-restriction` in `with-temporary-notmuch-message-buffer`Marc Fargas
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.
2024-06-15emacs/show: fix for text/calendar displayDavid Bremner
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
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
2024-04-04emacs: Autoload notmuch-user-agent related functionsJelle Licht
With this change, users with mail-user-agent set to 'notmuch-user-agent can start composing emails without having to require 'notmuch-mua first.
2024-04-04emacs: Mark "notmuch-tree" command for autoloadingDmitry Bogatov
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.
2023-12-01Merge branch 'release'David Bremner
2023-12-01notmuch-emacs-mua: avoid extra separators at the end of the lineJani Nikula
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.
2023-10-06emacs/mua: change name of ignored parameterDavid Bremner
Suppress compiler warning.
2023-10-06emacs/address: rewrite docstring for n-a-selection-functionDavid Bremner
The previous version essentially repeated the source code, and generated a compiler warning.
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.
2023-10-01emacs/show: special case toggling display of images0.38.1_pre0David Bremner
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
2023-10-01emacs: save image redisplay data during non-lazy displayDavid Bremner
This data will eventually be used to redisplay hidden images. A certain amount of refactoring is done here to avoid code duplication.
2023-10-01emacs/show: save redisplay redisplay data when showing lazy part.David Bremner
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.
2023-10-01emacs: save undisplayer function for MIME partsDavid Bremner
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).
2023-02-21emacs/tree: use two argument form of setq-localDavid Bremner
Apparently the macro setq-local only takes two arguments in Emacs 26.1
2023-02-20emacs: notmuch-tree-outline-modejao
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".
2022-11-15emacs/show: use n-s-i-headerline to update tagsDavid Bremner
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).
2022-11-15emacs/show: add optional orig-tags argument to n-s-i-headerlineDavid Bremner
This will support use of this function in notmuch-show-update-tags.
2022-11-15emacs/show: use plist to pass message info to n-s-insert-headerlineDavid Bremner
This should allow calling notmuch-show-insert-headerline from other places without duplicating the set of plist accesses.
2022-11-05emacs: move From header addition to after header internRussell Sim
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.
2022-11-05emacs: fix dangling overlays in notmuch-searchMatt Armstrong
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.
2022-09-23emacs: add notmuch-search-edit-search and notmuch-tree-edit-searchTomi Ollila
...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.
2022-09-03emacs/show: use read-shell-command instead of read-stringAntoine Beaupré
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.
2022-09-03emacs: new notmuch-tree-process-exit-functionsjao
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>
2022-08-11emacs: add docstring for notmuch-show-choose-duplicateDavid Bremner
It should have one in any case, but in particular it is needed for the manual.
2022-08-11emacs/show: restrict inlined mimetypes on refresh.David Bremner
This fixes the bug reported by Al [1]. Essentially apply the same fix as [2] in a different place. [1]: id:877d41nmr1.fsf@gmail.com [2]: 90a7c1af368a527700dcde9b0dcbd760afc7bd92