unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH v7 0/4] emacs postpone/resume patches
Date: Sun, 13 Nov 2016 14:08:46 +0000	[thread overview]
Message-ID: <1479046130-2716-1-git-send-email-markwalters1009@gmail.com> (raw)

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

             reply	other threads:[~2016-11-13 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-13 14:08 Mark Walters [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479046130-2716-1-git-send-email-markwalters1009@gmail.com \
    --to=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).