[PATCH v7 0/4] emacs postpone/resume patches

Mark Walters markwalters1009 at gmail.com
Sun Nov 13 06:08:46 PST 2016


The previous version of this series is at
id:1479036106-32453-1-git-send-email-markwalters1009 at gmail.com

The only change is for the error handling for resume. In show mode is
is actually simpler than before -- notmuch-show-get-message-id will
always return an id, so we don't need to check for non-nil
there. Indeed, if this were not the case then the tag commands would
all need to check too.

However, in tree-mode the corresponding command can fail if point is
after the end of the last message. Thus there we do check for non-nil
(as do the tagging commands).

The diff from v6 is below.

Best wishes

Mark




David Bremner (2):
  emacs: check drafts for encryption tags before saving
  emacs: resume messages

Mark Walters (2):
  emacs: tree: remove binding for pressing button in message pane
  emacs: postpone a message

 emacs/Makefile.local     |   3 +-
 emacs/notmuch-draft.el   | 268 +++++++++++++++++++++++++++++++++++++++++++++++
 emacs/notmuch-mua.el     |   4 +
 emacs/notmuch-show.el    |   8 ++
 emacs/notmuch-tree.el    |  11 +-
 test/T630-emacs-draft.sh |  70 +++++++++++++
 6 files changed, 362 insertions(+), 2 deletions(-)
 create mode 100644 emacs/notmuch-draft.el
 create mode 100755 test/T630-emacs-draft.sh

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 79e4435..364004b 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1988,9 +1988,7 @@ to show, nil otherwise."
 (defun notmuch-show-resume-message ()
   "Resume EDITING the current draft message."
   (interactive)
-  (let ((id (notmuch-show-get-message-id)))
-    (when id
-      (notmuch-draft-resume id))))
+  (notmuch-draft-resume (notmuch-show-get-message-id)))
 
 (put 'notmuch-show-pipe-message 'notmuch-doc
      "Pipe the contents of the current message to a command.")
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 4abcf60..7bebdba 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -273,7 +273,6 @@ FUNC."
     (define-key map "r" (notmuch-tree-close-message-pane-and #'notmuch-show-reply-sender))
     (define-key map "R" (notmuch-tree-close-message-pane-and #'notmuch-show-reply))
     (define-key map "V" (notmuch-tree-close-message-pane-and #'notmuch-show-view-raw-message))
-    (define-key map "e" (notmuch-tree-close-message-pane-and #'notmuch-show-resume-message))
 
     ;; The main tree view bindings
     (define-key map (kbd "RET") 'notmuch-tree-show-message)
@@ -294,6 +293,7 @@ FUNC."
     (define-key map "*" 'notmuch-tree-tag-thread)
     (define-key map " " 'notmuch-tree-scroll-or-next)
     (define-key map (kbd "DEL") 'notmuch-tree-scroll-message-window-back)
+    (define-key map "e" 'notmuch-tree-resume-message)
     map))
 (fset 'notmuch-tree-mode-map notmuch-tree-mode-map)
 
@@ -406,6 +406,15 @@ NOT change the database."
    (list (notmuch-read-tag-changes (notmuch-tree-get-tags) "Tag message" "-")))
   (notmuch-tree-tag tag-changes))
 
+(defun notmuch-tree-resume-message ()
+  "Resume EDITING the current draft message."
+  (interactive)
+  (notmuch-tree-close-message-window)
+  (let ((id (notmuch-tree-get-message-id)))
+    (if id
+	(notmuch-draft-resume id)
+      (message "No message to resume!"))))
+
 ;; The next two functions close the message window before calling
 ;; notmuch-search or notmuch-tree but they do so after the user has
 ;; entered the query (in case the user was basing the query on




More information about the notmuch mailing list