unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v3 0/7] Port notmuch-show's x/X bindings to notmuch-tree
@ 2019-12-28 15:01 William Casarin
  2019-12-28 15:01 ` [PATCH v3 1/7] emacs/tree: return true if a thread was found in next-thread William Casarin
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: William Casarin @ 2019-12-28 15:01 UTC (permalink / raw)
  To: notmuch

These patches bring notmuch-tree more in line with the user experience
of notmuch-show by adding the x/X bindings.

v3:
  - Removed dubious setq assignments in notmuch-tree-next-thread
    notmuch-tree-goto-matching-message as suggested in id:m2zhgg3r5y.fsf@dme.org

  - Implement "A function scope variable to store the direction would
    save testing `prev' every time around the loop." as suggested in
    id:m2wobk3r4v.fsf@dme.org

  - Will address id:87k17cauth.fsf@iki.fi in future work as it's a bit
    out of scope for this patch set

  - Dropped id:20191113225752.26502-1-jb55@jb55.com since it has already
    been upstreamed

v2: id:20191128161401.28844-1-jb55@jb55.com
  - fix a bug when moving between open messages
  - include M-RET keybinding patch from id:20191113225752.26502-1-jb55@jb55.com

v1: id:20191117222929.1064-1-jb55@jb55.com


William Casarin (7):
  emacs/tree: return true if a thread was found in next-thread
  emacs/tree: add notmuch-tree-goto-matching-message
  emacs/tree: add notmuch-tree-matching-message
  emacs/tree: add kill-both prefix argument to notmuch-tree-quit
  emacs/tree: add notmuch-tree-archive-message-than-next-or-exit
  emacs/tree: add notmuch-tree-archive-thread-then-exit
  emacs/tree: add x/X bindings

 emacs/notmuch-tree.el | 70 +++++++++++++++++++++++++++++++------------
 1 file changed, 51 insertions(+), 19 deletions(-)

base-commit: 757ed001aad27d3c5ee8828174778b71013e4afd

Range-diff:
 8:  ac0f03a2 =  9:  5f9ea4d2 emacs: bind M-RET to notmuch-tree-from-search-thread
 1:  16972fa8 ! 36:  6ec4e58f emacs/tree: return true if a thread was found in next-thread
      (defun notmuch-tree-next-thread ()
     +  "Get the next thread in the current tree. Returns t if a thread was
     +found or nil if not."
        (interactive)
        (forward-line 1)
    --  (while (not (or (notmuch-tree-get-prop :first) (eobp)))
    +   (while (not (or (notmuch-tree-get-prop :first) (eobp)))
     -    (forward-line 1)))
    -+  (let (end)
    -+    (while (not (or (notmuch-tree-get-prop :first) (setq end (eobp))))
    -+      (forward-line 1))
    -+    (not end)))
    ++    (forward-line 1))
    ++  (not (eobp)))
      
      (defun notmuch-tree-thread-mapcar (function)
        "Iterate through all messages in the current thread
 2:  54e166a9 ! 37:  3db9faf8 emacs/tree: add notmuch-tree-goto-matching-message
     +(defun notmuch-tree-goto-matching-message (&optional prev)
     +  "Move to the next or previous matching message.
     +
     +Returns t if there was a next matching message in the thread to show,
     +nil otherwise."
    -+  (let (last)
    -+    (while (and (not (setq last (if prev (bobp) (eobp))))
    -+                (not (notmuch-tree-get-match)))
    -+      (forward-line (if prev -1 nil)))
    -+    (not last)))
    ++  (let ((dir (if prev -1 nil))
    ++	(eobfn (if prev #'bobp #'eobp)))
    ++    (while (and (not (funcall eobfn))
    ++		(not (notmuch-tree-get-match)))
    ++      (forward-line dir))
    ++    (not (funcall eobfn))))
 3:  d68d2050 ! 38:  e42d6032 emacs/tree: add notmuch-tree-matching-message
 4:  8432bc9a = 39:  caca76d3 emacs/tree: add kill-both prefix argument to notmuch-tree-quit
 5:  0c3f996d ! 40:  02b84adb emacs/tree: add notmuch-tree-archive-message-than-next-or-exit
 6:  17545910 = 41:  b432dd49 emacs/tree: add notmuch-tree-archive-thread-then-exit
 7:  fbcb3ee0 = 42:  48ea3edb emacs/tree: add x/X bindings
-- 
2.24.0

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-04-03 12:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-28 15:01 [PATCH v3 0/7] Port notmuch-show's x/X bindings to notmuch-tree William Casarin
2019-12-28 15:01 ` [PATCH v3 1/7] emacs/tree: return true if a thread was found in next-thread William Casarin
2019-12-30 12:17   ` David Edmondson
2019-12-28 15:01 ` [PATCH v3 2/7] emacs/tree: add notmuch-tree-goto-matching-message William Casarin
2019-12-30 12:20   ` David Edmondson
2019-12-28 15:01 ` [PATCH v3 3/7] emacs/tree: add notmuch-tree-matching-message William Casarin
2019-12-30 12:22   ` David Edmondson
2020-04-03 12:15   ` David Bremner
2019-12-28 15:01 ` [PATCH v3 4/7] emacs/tree: add kill-both prefix argument to notmuch-tree-quit William Casarin
2019-12-30 12:23   ` David Edmondson
2019-12-28 15:01 ` [PATCH v3 5/7] emacs/tree: add notmuch-tree-archive-message-than-next-or-exit William Casarin
2019-12-30 12:24   ` David Edmondson
2019-12-28 15:01 ` [PATCH v3 6/7] emacs/tree: add notmuch-tree-archive-thread-then-exit William Casarin
2019-12-30 12:25   ` David Edmondson
2019-12-28 15:01 ` [PATCH v3 7/7] emacs/tree: add x/X bindings William Casarin
2019-12-30 12:25   ` David Edmondson
2020-02-20 19:43 ` [PATCH v3 0/7] Port notmuch-show's x/X bindings to notmuch-tree Daniel Kahn Gillmor
2020-02-21 17:06   ` William Casarin
2020-02-21 17:18     ` David Edmondson
2020-03-23 16:38       ` William Casarin

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).