unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v7 0/4] emacs postpone/resume patches
@ 2016-11-13 14:08 Mark Walters
  2016-11-13 14:08 ` [PATCH v7 1/4] emacs: tree: remove binding for pressing button in message pane Mark Walters
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Mark Walters @ 2016-11-13 14:08 UTC (permalink / raw)
  To: notmuch

The previous version of this series is at
id:1479036106-32453-1-git-send-email-markwalters1009@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

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

end of thread, other threads:[~2016-11-13 17:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-13 14:08 [PATCH v7 0/4] emacs postpone/resume patches Mark Walters
2016-11-13 14:08 ` [PATCH v7 1/4] emacs: tree: remove binding for pressing button in message pane Mark Walters
2016-11-13 14:08 ` [PATCH v7 2/4] emacs: postpone a message Mark Walters
2016-11-13 14:08 ` [PATCH v7 3/4] emacs: check drafts for encryption tags before saving Mark Walters
2016-11-13 14:08 ` [PATCH v7 4/4] emacs: resume messages Mark Walters
2016-11-13 17:35 ` [PATCH v7 0/4] emacs postpone/resume patches David Bremner

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).