From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 579166DE01D0 for ; Sun, 13 Nov 2016 06:08:57 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.558 X-Spam-Level: X-Spam-Status: No, score=0.558 tagged_above=-999 required=5 tests=[AWL=-0.572, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oPn-UiDStHQT for ; Sun, 13 Nov 2016 06:08:56 -0800 (PST) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id 8E3FC6DE0005 for ; Sun, 13 Nov 2016 06:08:55 -0800 (PST) Received: by mail-wm0-f67.google.com with SMTP id u144so8437448wmu.0 for ; Sun, 13 Nov 2016 06:08:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=OM0renzTuRXwE1KzL/CZeFZi5iG47qTFqnTXxylqdZA=; b=qG7T+NQxzRYC/eu1ulxQIYBfQGdKvNq8ExaUQLTsLnYMYGTk8tETuobU1fa0i4oJEw wRA8GeFNxFQr4aHkI/Oqqeat0mdZv1Z44pb3ZJXh9LCkzzsGqgcJzkw/0T456USJ2nXF tbh1bYs1dDcNng5aYckoPN7RERGx4xD4vhgNUGqnmq+bzVLzJUnd6NgcMFiNqJgBkh5I zLGWbaPZWPHRPPI2arGvMm1oz6zTjZAQDx5H6zV5FuMkvNDmfc9a8CASMHUo8kSFElD6 oRlOooDOLd+MbGIjhcSp/8lJB6YVCbPzpLEglwFLqaKjfrirTx3r8AIl5VIHpEkhVMSt Wm7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OM0renzTuRXwE1KzL/CZeFZi5iG47qTFqnTXxylqdZA=; b=T1md44PYr9e8czuKsRuezcKTLxhlnQ5uRttMZDum0SRrT0uRr238fXuz/MCxZkoUZo EeeEYmaBCj/vqNARfZYf33NHhu3E0KthW9Lsj9FwCt95bm02n+5qjEWFfEepVn5io01Q OrYccQKaG/wCU30yFDKkxV/k9MK6ArbwqLOFy2mhQpgF0ogCWtuzFFqj7j6XSevmQQcq /87lzv5OPVQ5oL5rgSC6uUbePlWxdJ7FdtoSnPsY2RQHn5iYFUzgIWnER2NxT98bQEa3 oav7H3SxiGvSDgAuM2t+F2Cx+M7kzyLC/13KaHg+U3i+RW4b3xu8OGynXveNzbd3H1GQ VfLw== X-Gm-Message-State: ABUngvdVTrh9ORxUnoKX7rCdWIo3kugM7v11pjqyZ3VxsGcQY0HEIqV8xBnKQ36ZChQH6Q== X-Received: by 10.28.67.69 with SMTP id q66mr5966689wma.22.1479046132824; Sun, 13 Nov 2016 06:08:52 -0800 (PST) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id c187sm23396470wmd.13.2016.11.13.06.08.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Nov 2016 06:08:52 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v7 0/4] emacs postpone/resume patches Date: Sun, 13 Nov 2016 14:08:46 +0000 Message-Id: <1479046130-2716-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2016 14:08:57 -0000 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