Re: [PATCH 2/2] emacs: define, use option :disable-excludes for n-h-query-counts
Gregor Zattler writes: > Hi David, > * David Bremner [2022-01-23; 15:00]: >> David Bremner writes: >> >>> 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. >> >> I applied this series to master. > > I confirm again, the bug does not show up in my test case > from message id:877ep0kx52.fsf@len.workgroup. The test case > mail corpus (n = 1) is definitely too small to uncover the > bug David found in the first attempt to fix the bug. > Great, so hopefully I didn't break anything else this time :) d ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH v7] emacs: customizable names for search buffers
On Sun, Jan 23 2022, David Bremner wrote: > jao writes: > >> 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. >> > > applied to master, with a typo fix in one of the docstrings. sorry about that, thanks for your patience! cheers, jao ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH v7] emacs: customizable names for search buffers
jao writes: > 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. > applied to master, with a typo fix in one of the docstrings. d ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH v6] emacs: customizable names for search buffers
On Sun, Jan 23 2022, David Bremner wrote: > jao writes: > >> 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. >> > > Can you add the new docstrings (or hand written description of the new > variables, if you prefer) to notmuch-emacs.rst? done in v7, thanks. jao -- "There are three kinds of people: those who can count, and those who can't" ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
[PATCH v7] emacs: customizable names for search buffers
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. --- This is a much improved version of the patch in id:20220108204121.1053932-1-...@gnu.org, according to discussion on that thread. This version includes documentation in notmuch-emacs.rst for the new customizable variables (id:87v8yafe1a@tethera.net). Signed-off-by: jao --- doc/notmuch-emacs.rst | 10 emacs/notmuch-hello.el | 11 + emacs/notmuch-tree.el | 10 emacs/notmuch.el | 53 ++ 4 files changed, 65 insertions(+), 19 deletions(-) diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst index fed619b7..049c7551 100644 --- a/doc/notmuch-emacs.rst +++ b/doc/notmuch-emacs.rst @@ -175,6 +175,16 @@ variables. :index:`notmuch-search-oldest-first` Display the oldest threads at the top of the buffer +It is also possible to costumize how the name of buffers containing +search results is formatted using the following variables: + +:index:`notmuch-search-buffer-name-format` + |docstring::notmuch-search-buffer-name-format| + +:index:`notmuch-saved-search-buffer-name-format` + |docstring::notmuch-saved-search-buffer-name-format| + + .. _notmuch-show: notmuch-show diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 581e7f3a..beb25382 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -486,11 +486,14 @@ diagonal." (defun notmuch-hello-widget-search (widget &rest _ignore) (cl-case (widget-get widget :notmuch-search-type) (tree -(notmuch-tree (widget-get widget :notmuch-search-terms) - nil nil nil nil nil nil - (widget-get widget :notmuch-search-oldest-first))) +(let ((n (notmuch-search-format-buffer-name (widget-value widget) "tree" t))) + (notmuch-tree (widget-get widget :notmuch-search-terms) + nil nil n nil nil nil + (widget-get widget :notmuch-search-oldest-first (unthreaded -(notmuch-unthreaded (widget-get widget :notmuch-search-terms))) +(let ((n (notmuch-search-format-buffer-name (widget-value widget) + "unthreaded" t))) + (notmuch-unthreaded (widget-get widget :notmuch-search-terms) nil nil n))) (t (notmuch-search (widget-get widget :notmuch-search-terms) (widget-get widget :notmuch-search-oldest-first) diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index d7486904..303c6fad 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -1191,11 +1191,11 @@ The arguments are: (setq query (notmuch-read-query (concat "Notmuch " (if unthreaded "unthreaded " "tree ") "view search: " - (let ((buffer (get-buffer-create (generate-new-buffer-name - (or buffer-name - (concat "*notmuch-" - (if unthreaded "unthreaded-" "tree-") - query "*") + (let* ((name + (or buffer-name + (notmuch-search-buffer-title query + (if unthreaded "unthreaded" "tree" +(buffer (get-buffer-create (generate-new-buffer-name name))) (inhibit-read-only t)) (pop-to-buffer-same-window buffer)) ;; Don't track undo information for this buffer diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 85a54706..6abb17ff 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -915,7 +915,39 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." (notmuch-search-get-tags-region (point-min) (point-max)) "Tag all"))) (notmuch-search-tag tag-changes (point-min) (point-max) t)) -(defun notmuch-search-buffer-title (query) +(defcustom notmuch-search-buffer-name-format "*notmuch-%t-%s*" + "Format for the name of search results buffers. + +In this spec, %s will be replaced by a description of the search +query and %t by its type (search, tree or unthreaded). The +buffer name is formatted using `format-spec': see its docstring +for additional parameters for the s and t format specifiers. + +See also `notmuch-saved-search-buffer-name-format'" + :type 'string + :group 'notmuch-search) + +(defcustom notmuch-saved-search-buffer-name-format "*notmuch-saved-%t-%s*" + "Format for the name of search results buffers for saved searches. + +In this spec, %s will be replaced by the saved search name and %t +by its type (search, tree or unthreaded). The buffer name is +formatted using `format-spec': see its docstring for additional +parameters for the s and t format specifiers. + +See
Re: Variable used to detect reply prefixes in Subject
Jonas Bernoulli writes: > Hello, > > Please tell me what variable I have to customize to recognize additional > unusual prefixes that some people add to the subject when they send a > reply. > > I searched using some strings I would expect to appear in the value of > that variable but either got no results or way too many. There is some simple (-minded?) processing in notmuch-reply.c, which just adds Re: to the front of the subject if it is not already present. The original headers are also returned, so in principle the emacs front end could do something smarter. d ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH 2/2] emacs: define, use option :disable-excludes for n-h-query-counts
Hi David, * David Bremner [2022-01-23; 15:00]: > David Bremner writes: > >> 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. > > I applied this series to master. I confirm again, the bug does not show up in my test case from message id:877ep0kx52.fsf@len.workgroup. The test case mail corpus (n = 1) is definitely too small to uncover the bug David found in the first attempt to fix the bug. Thanks, Gregor ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH v6] emacs: customizable names for search buffers
jao writes: > 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. > Can you add the new docstrings (or hand written description of the new variables, if you prefer) to notmuch-emacs.rst? thanks, David ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH 2/2] emacs: define, use option :disable-excludes for n-h-query-counts
David Bremner writes: > 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. I applied this series to master. d ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: Variable used to detect reply prefixes in Subject
* 2022-01-23 15:13:18+0100, Jonas Bernoulli wrote: > Please tell me what variable I have to customize to recognize > additional unusual prefixes that some people add to the subject when > they send a reply. There is message-subject-re-regexp. > Ps: Since (I assume) many notmuch users also frequent emacs-devel, > where a frequent commentator uses the prefix "RE: [External] : ", > maybe notmuch could even recognize that by default? (I asked him > to consider not doing that anymore, but even if he agrees, that > would not affect his numerous past replies.) Yes. That is annoying. I have written a custom Subject cleaner for my replies: (add-hook 'message-setup-hook 'my-message-subject-clean) (defun my-message-subject-clean () ;; Delete first \( ... \) group from Subject header. (my-with-message-headers (let ((case-fold-search nil)) (dolist (re '(".*\\(\\[ ?SPAM\\(?: UNSURE\\|\\?\\)? ?\\] \\(?:Re: \\)?\\)" ".*\\(\\(?:Re: \\)* *\\[External\\][ :]*\\(?:Re: *\\)*\\)")) (goto-char (point-min)) (when (re-search-forward (concat "^Subject: " re) nil t) (delete-region (match-beginning 1) (match-end 1))) (defmacro my-with-message-headers (&rest body) (declare (indent 0)) `(save-excursion (save-restriction (save-match-data (message-narrow-to-head) ,@body -- /// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/ // OpenPGP: 6965F03973F0D4CA22B9410F0F2CAE0E07608462 signature.asc Description: PGP signature ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Variable used to detect reply prefixes in Subject
Hello, Please tell me what variable I have to customize to recognize additional unusual prefixes that some people add to the subject when they send a reply. I searched using some strings I would expect to appear in the value of that variable but either got no results or way too many. Thanks! Jonas Ps: Since (I assume) many notmuch users also frequent emacs-devel, where a frequent commentator uses the prefix "RE: [External] : ", maybe notmuch could even recognize that by default? (I asked him to consider not doing that anymore, but even if he agrees, that would not affect his numerous past replies.) ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org