help
___ 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 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
Re: FYI: emacs / notmuch-search-edit-search
hi, On Wed, Jan 12 2022, Tomi Ollila wrote: > Hi all > > I've had this for a while in .emacs.d/notmuch-config.el > > --- > > (defun notmuch-search-edit-search () > "Edit current search" > (interactive) > (notmuch-search (read-from-minibuffer > "Edit search: " notmuch-search-query-string) > notmuch-search-oldest-first)) > > (define-key notmuch-search-mode-map "e" #'notmuch-search-edit-search) > > --- this looks useful indeed. if added, please consider adding also a notmuch-tree counterpart. in notmuch-tree-mode-map, "e" is taken for notmuch-tree-resume-message, so perhaps "E" could be used instead, possibly in both maps for consistency. untested: --8<---cut here---start->8--- (defun notmuch-tree-edit-search (query) "Edit the current search" (interactive (list (read-from-minibuffer "Edit search: " notmuch-search-query-string))) (let ((notmuch-show-process-crypto (notmuch-tree--message-process-crypto))) (notmuch-tree-close-message-window) (notmuch-tree query notmuch-tree-query-context nil nil nil notmuch-tree-unthreaded nil notmuch-search-oldest-first))) (define-key notmuch-tree-mode-map "E" #'notmuch-tree-edit-search) --8<---cut here---end--->8--- cheers, jao -- You don’t stop doing things because you get old. You get old because you stop doing things. - Rosamunde Pilcher ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH] emacs: use query name for tree saved-search buffer names
On Sun, Jan 09 2022, David Bremner wrote: > jao writes: > >> This simply mimics what we already do for non-tree searches, and makes >> up for nicer buffer names. Note that this patch only applies to >> queries not coming from a search widget in the hello buffer. >> > > Two questions: > > 1) Should this actually approximate what we do in >#'notmuch-search-buffer-title ? The buffer gets a name like >"*notmuch-saved-search-inbox*" oh, you're right. i have that function advised (because i prefer using the unadorned query name), and thought i was being consistent. i think we should. maybe we could consider adding a customizable format string with default "*notmuch-saved-search-inbox-%s*" for cases like mine? > 2) Should we do the same thing (whatever that is) for unthreaded mode >searches? i don't see any reason not to. i'll be happy to send a patch for both cases. cheers, jao -- Whenever you commend, add your reasons for doing so; it is this which distinguishes the approbation of a man of sense from the flattery of sycophants and admiration of fools. -Richard Steele (1672-1729) ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH] emacs: make header line in notmuch-show buffers optional
On Sun, Jan 09 2022, David Bremner wrote: > jao writes: > >> New notmuch-show-header-line customizable boolean to allow inhibiting >> a header line in notmuch-show-mode buffers (for instance, because one >> prefers to just include Subject in notmuch-message-headers). >> > > No objections, provided you link the docstring into the > notmuch-show-mode doc in the same way as notmuch-message-headers{-visible} v2 send, thanks! jao -- To kill time is not murder, it's suicide. -William James (1842-1910) ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH] emacs: use query name for tree saved-search buffer names
On Sat, Jan 08 2022, jao wrote: > This simply mimics what we already do for non-tree searches, and makes > up for nicer buffer names. Note that this patch only applies to > queries not coming from a search widget in the hello buffer. sorry, i meant "queries *coming* from a search widget" ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: Notmuch Emacs 0.31.2 documentation and keybinding suggestions
On Sun, Oct 10 2021, David Bremner wrote: [...] >> Finally, the binding for in Notmuch-Show and Notmuch-Hello >> inconveniently clobbers the tab-bar-mode binding for that key. Should >> not Notmuch be content with // (and >> possibly ) and leave alone? >> > > Notmuch has used the binding since 2010 (almost 10 years before > tab-bar-mode existed), so people might be used to it; on other hand it > does seem redundant since the binding S-tab is also there. I'm not a > very serious user of notmuch-hello mode, and I don't use tab-bar-mode at > all, so I'd welcome feedback from other people about how attached they > are to C-tab. fwiw, i'm a regular user of hello, and i never use C-TAB (in any of its forms). i don't use tab-bar-mode though. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: configurable summary line for notmuch search
On Wed, Sep 01 2021, Alexander Adolf wrote: > That said, this could - more or less - easily be done with the patch > proposed on this thread by jao. _Provided_ that it will be amended > to not only cover notmuch-tree-result-format, but also > notmuch-search-result-format. ;-) fwiw, that patch already covers both variables. jao ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH v4] emacs: notmuch-tree: customizable strings for drawing trees
On Tue, Aug 31 2021, David Bremner wrote: > jao writes: > >> - (push "│" tree-status)) >> + (push (alist-get 'vertical notmuch-tree-thread-symbols 3) >> tree-status)) > > That 3 looks like a typo. If nothing else turns up, I can just delete > it. indeed. it's a leftover of my previous implementation. please go ahead. thanks! ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH] emacs: notmuch-tree: customizable strings for drawing trees
On Mon, Aug 30 2021, David Bremner wrote: > jao writes: > >> +(defcustom notmuch-tree-thread-symbols '(" " "─" "┬" "│" "├" "╰" "►") > > How hard would it be to use a plist or an alist, and allow the user to > overide only the symbols they are interested in? not hard at all... we just need to figure out good names (suggestions welcome). i think i'd prefer an alist, but it's not a strong preference if you'd rather have a plist. >> + (push (elt notmuch-tree-thread-symbols 4) tree-status)) > > As hinted above, I don't love the intriduction of magic indices, > although I guess it might be tolerable if they are used only in one place. yes, i agree. i even had some code where i had variables for those indices, but felt a bit overkill for things used in just one place. but using a plist/alist would give us what we need here. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: configurable summary line for notmuch search
On Sat, Aug 28 2021, David Bremner wrote: > I was idly thinking about how to provide custom summary formats for > notmuch-search. I know this has been discussed a few times on IRC, but I > can't remember the kind of things people were looking for. So if this a > feature you're interested in, what specifically are you looking for? I actually have a patch in my queue that implements a form of this, in two ways. By allowing the "field" to be a function that gets called with the message property and returns a string, and by allowing the format string to be a function that takes the value of the field and further formats it. This is the relevant patch with simple examples in the documentation: https://jao.io/cgit/notmuch/commit/?h=tree-result-format=0d7d909aa8bc4fb8e5ab80f93bc397fbed666761 and this is an example of how i use it to have a marker in my result lists that tells me if i'm the recipient of the displayed email and to trunctate the subject to a maximum length: (setq notmuch-tree-result-format '(("date" . "%12s ") ("authors" . "%-35s") (jao-notmuch-msg-ticks) ("subject" . jao-notmuch-truncate) ("tags" . " (%s)"))) (defun jao-notmuch-msg-ticks (msg) (let ((headers (plist-get msg :headers))) (cond ((string-match-p jao-mails-regexp (or (plist-get headers :To) "")) (propertize " »" 'face 'notmuch-tree-match-tree-face)) ((string-match-p jao-mails-regexp (or (plist-get headers :Cc) "")) (propertize " ¬" 'face 'notmuch-tree-match-tree-face)) (t " " (defun jao-notmuch-truncate (x) (truncate-string-to-width (format "%-102s" x) 102 nil nil t)) what do you think? cheers, jao -- I never lose sight of the fact that just being is fun. -Katharine Hepburn, actress (1907-2003) ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH] emacs: notmuch-tree: customizable strings for drawing trees
This one should have been sent with a version 3 mark, sorry. It's essentially the previous version (with yet another doc typo corrected), but rebased against today's master. Cheers, jao ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: emacs: honoring notmuch-show-insert-part-text/html for 'w3m renderer
On Tue, Aug 03 2021, David Bremner wrote: > can someone (TM) make a patch I can apply with git-am? sent: 20210804000241.1053748-1-...@gnu.org ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
sorting in show tree
Hi, I wanted to be able to sort oldest-first in notmuch-tree view (inside emacs). Turns out that needed 'notmuch show' to accept a --sort argument (as search does). I've given it a try (with the patient help of David on IRC) in this repo: https://jao.io/cgit/notmuch/log/?h=tree-sort. With that in place, it was also pretty straightforward to make 'o' work in notmuch-tree-mode to toggle the thread ordering. Hope you find it useful! Cheers, jao -- In my youth I thought of writing a satire on mankind; but now in my old age I think I should write an apology for them. -Horace Walpole ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
emacs: honoring notmuch-show-insert-part-text/html for 'w3m renderer
Hi, notmuch-show-insert-part-text/html correctly binds shr-blocked-images to notmuch-show-text/html-blocked-images when using 'shr as the mm-text-html-renderer. However, when the latter is not shr, the function only binds gnus-blocked-images, which is not used by the 'w3m rendered. The corresponding variable to bind is in the latter case w3m-ignored-image-url-regexp, and something like the simple patch below seem to make things work, at least for me. Cheers, jao diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 9a95eb34..0c4fc110 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -823,7 +823,8 @@ will return nil if the CID is unknown or cannot be retrieved." (let ((mm-inline-text-html-with-w3m-keymap nil) ;; FIXME: If we block an image, offer a button to load external ;; images. - (gnus-blocked-images notmuch-show-text/html-blocked-images)) + (gnus-blocked-images notmuch-show-text/html-blocked-images) + (w3m-ignored-image-url-regexp notmuch-show-text/html-blocked-images)) (notmuch-show-insert-part-*/* msg part content-type nth depth button ;;; Functions used by notmuch-show--insert-part-text/html-shr ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH 7/7] emacs: fix notmuch-tree-toggle-order keybinding
On Sat, Jun 26 2021, David Bremner wrote: > Jose Antonio Ortega Ruiz writes: > >> Ah, i just remembered the reason: notmuch-search-toggle-order is not >> bound in notmuch-common-keymap, so, no, i think that it cannot be >> remapped here. > > OIC. OK, so just definine it correctly the first time? yeah... i just submitted a new set with that and your other comments hopefully addressed: let me know otherwise! thanks. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH 7/7] emacs: fix notmuch-tree-toggle-order keybinding
On Sat, Jun 26 2021, Jose Antonio Ortega Ruiz wrote: > On Sat, Jun 26 2021, David Bremner wrote: > >> David Bremner writes: >> >>> jao writes: >>> >>>> Really assign the new emacs command notmuch-tree-toggle-order to o, as >>>> previously documented. >>> >>> It seems like this one should be merged with 3/7? >>> >>> d >> >> Apologies for the many replies, but can't you remap >> notmuch-search-toggle-order? > > i tried, but it wasn't working for some reason i have forgotten. i'll > try again, re-base, and submit a new batch. thanks for reviewing. Ah, i just remembered the reason: notmuch-search-toggle-order is not bound in notmuch-common-keymap, so, no, i think that it cannot be remapped here. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH 7/7] emacs: fix notmuch-tree-toggle-order keybinding
On Sat, Jun 26 2021, David Bremner wrote: > David Bremner writes: > >> jao writes: >> >>> Really assign the new emacs command notmuch-tree-toggle-order to o, as >>> previously documented. >> >> It seems like this one should be merged with 3/7? >> >> d > > Apologies for the many replies, but can't you remap > notmuch-search-toggle-order? i tried, but it wasn't working for some reason i have forgotten. i'll try again, re-base, and submit a new batch. thanks for reviewing. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH 3/7] emacs/tree: command to toggle search sort order in tree mode
On Sat, Jun 26 2021, David Bremner wrote: > jao writes: > >> New command notmuch-tree-toggle-order for switching the sort order (by >> reissuing the search with a different flag) in a notmuch-tree buffer. >> --- >> emacs/notmuch-tree.el | 14 +- >> 1 file changed, 13 insertions(+), 1 deletion(-) >> >> diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el >> index 6ef8e439..c23dacfc 100644 >> --- a/emacs/notmuch-tree.el >> +++ b/emacs/notmuch-tree.el >> @@ -322,6 +322,7 @@ then NAME behaves like CMD." >> ;; that additionally close the message window. >> (define-key map [remap notmuch-bury-or-kill-this-buffer] >> 'notmuch-tree-quit) >> (define-key map [remap notmuch-search] 'notmuch-tree-to-search) >> +(define-key map [remap notmuch-search] 'notmuch-tree-toggle-order) >> (define-key map [remap notmuch-help] 'notmuch-tree-help) >> (define-key map [remap notmuch-mua-new-mail] 'notmuch-tree-new-mail) >> (define-key map [remap notmuch-jump-search] 'notmuch-tree-jump-search) > > That remap command looks like a copy-paste failure. Does it actually > work? it was a copy-paste failure, yes. it's fixed in patch 7. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: sorting in show tree
On Fri, Jun 25 2021, David Bremner wrote: [...] > Unless the series is really huge (thousands of lines of diff) we prefer > sending it to the list with git-send-email for review. So I guess that's > the other thing you should do ;). okay, i'm attaching to this mail the single patch produced by git after rebasing and squashing all my modifications (i don't think it's particularly interesting keeping the story of the 7 individual patches, but they can still be retrieved from my tree-sort branch if you like). thanks, jao >From 735366a138a301fb86f83b8434ecff8c8da35d16 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 10 Jun 2021 22:32:45 +0100 Subject: [PATCH] Allow sorting in notmuch-tree search buffers. - CLI/show: accept --sort - emacs/hello: honouring :sort-order in threaded queries - emacs/tree: command to toggle search sort order in tree mode --- devel/emacs-keybindings.org | 10 +- doc/man1/notmuch-show.rst | 13 + doc/notmuch-emacs.rst | 7 +++ emacs/notmuch-hello.el | 4 +++- emacs/notmuch-tree.el | 24 +++- notmuch-show.c | 7 +++ test/T520-show.sh | 17 + 7 files changed, 71 insertions(+), 11 deletions(-) diff --git a/devel/emacs-keybindings.org b/devel/emacs-keybindings.org index 65dfe0eb..f7df3040 100644 --- a/devel/emacs-keybindings.org +++ b/devel/emacs-keybindings.org @@ -15,7 +15,7 @@ | l | notmuch-search-filter | notmuch-show-filter-thread| | | m | notmuch-mua-new-mail | notmuch-mua-new-mail | notmuch-mua-new-mail| | n | notmuch-search-next-thread | notmuch-show-next-open-message| notmuch-tree-next-matching-message | -| o | notmuch-search-toggle-order| | | +| o | notmuch-search-toggle-order| | notmuch-tree-toggle-order | | p | notmuch-search-previous-thread | notmuch-show-previous-open-message| notmuch-tree-prev-matching-message | | q | notmuch-bury-or-kill-this-buffer | notmuch-bury-or-kill-this-buffer | notmuch-bury-or-kill-this-buffer| | r | notmuch-search-reply-to-thread-sender | notmuch-show-reply-sender | notmuch-show-reply-sender | @@ -38,10 +38,10 @@ | V || notmuch-show-view-raw-message | notmuch-show-view-raw-message | | X || notmuch-show-archive-thread-then-exit | | | Z | notmuch-tree-from-search-current-query | notmuch-tree-from-show-current-query | | -| =!= || notmuch-show-toggle-elide-non-matching| | -| =#= || notmuch-show-print-message| | -| =$= || notmuch-show-toggle-process-crypto| | -| =*= | notmuch-search-tag-all | notmuch-show-tag-all | notmuch-tree-tag-thread | +| =!= || notmuch-show-toggle-elide-non-matching| | +| =#= || notmuch-show-print-message| | +| =$= || notmuch-show-toggle-process-crypto| | +| =*= | notmuch-search-tag-all | notmuch-show-tag-all | notmuch-tree-tag-thread | | + | notmuch-search-add-tag | notmuch-show-add-tag | notmuch-tree-add-tag| | - | notmuch-search-remove-tag | notmuch-show-remove-tag | notmuch-tree-remove-tag | | . || notmuch-show-part-map | | diff --git a/doc/man1/notmuch-show.rst b/doc/man1/notmuch-show.rst index fc6bec62..64639174 100644 --- a/doc/man1/notmuch-show.rst +++
Re: sorting in show tree
Hi again, Just in case: is there anything else i should do to request this for merging on the main branch? Or just wait? (which is of course okay!) Thanks, jao On Fri, Jun 11 2021, Jose Antonio Ortega Ruiz wrote: > Hi, > > I wanted to be able to sort oldest-first in notmuch-tree view (inside > emacs). Turns out that needed 'notmuch show' to accept a --sort > argument (as search does). I've given it a try (with the patient help > of David on IRC) in this repo: > https://jao.io/cgit/notmuch/log/?h=tree-sort. > > With that in place, it was also pretty straightforward to make 'o' work > in notmuch-tree-mode to toggle the thread ordering. > > Hope you find it useful! > > Cheers, > jao > -- > In my youth I thought of writing a satire on mankind; but now in my > old age I think I should write an apology for them. -Horace Walpole -- How many Zen Buddhist does it take to change a light bulb? Two. One to change it and one not to change it. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org