emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 180e309: Bind `C-c C-d' to rmail-epa-decrypt in rmail


From: Lars Ingebrigtsen
Subject: master 180e309: Bind `C-c C-d' to rmail-epa-decrypt in rmail
Date: Sat, 12 Dec 2020 15:19:46 -0500 (EST)

branch: master
commit 180e309d8b15b66b588438d157ed1290ab2de7df
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Bind `C-c C-d' to rmail-epa-decrypt in rmail
    
    * doc/emacs/rmail.texi (Rmail Display): Mention the key
    binding (bug#25411).
    
    * lisp/mail/rmail.el (rmail-mode-map): Bind C-c C-d to
    rmail-epa-decrypt.
    (rmail-mode): Mention it.
    (rmail-epa-decrypt): Don't mark a mail as decrypted unless we're
    replacing it.
    
    * lisp/mail/rmailsum.el (rmail-summary-mode-map): Bind C-c C-d.
    (rmail-summary-epa-decrypt): New command.
---
 doc/emacs/rmail.texi  | 6 +++---
 lisp/mail/rmail.el    | 7 ++++---
 lisp/mail/rmailsum.el | 7 +++++++
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index 14ee062..467c526 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -1273,9 +1273,9 @@ temporary buffer to display the current @acronym{MIME} 
message.
 
 @findex rmail-epa-decrypt
 @cindex encrypted mails (reading in Rmail)
-  If the current message is an encrypted one, use the command @kbd{M-x
-rmail-epa-decrypt} to decrypt it, using the EasyPG library
-(@pxref{Top,, EasyPG, epa, EasyPG Assistant User's Manual}).
+  If the current message is an encrypted one, use the command
+@kbd{C-c C-d} (@code{rmail-epa-decrypt}) to decrypt it, using the
+EasyPG library (@pxref{Top,, EasyPG, epa, EasyPG Assistant User's Manual}).
 
   You can highlight and activate URLs in the Rmail buffer using Goto
 Address mode:
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 63d992d..3c74edd 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1080,6 +1080,7 @@ The buffer is expected to be narrowed to just the header 
of the message."
     (define-key map [?\S-\ ] 'scroll-down-command)
     (define-key map "\177"   'scroll-down-command)
     (define-key map "?"      'describe-mode)
+    (define-key map "\C-c\C-d" 'rmail-epa-decrypt)
     (define-key map "\C-c\C-s\C-d" 'rmail-sort-by-date)
     (define-key map "\C-c\C-s\C-s" 'rmail-sort-by-subject)
     (define-key map "\C-c\C-s\C-a" 'rmail-sort-by-author)
@@ -1272,6 +1273,7 @@ Instead, these commands are available:
 \\[rmail-undelete-previous-message]    Undelete message.  Tries current 
message, then earlier messages
        till a deleted message is found.
 \\[rmail-edit-current-message] Edit the current message.  \\[rmail-cease-edit] 
to return to Rmail.
+\\[rmail-epa-decrypt]  Decrypt the current message.
 \\[rmail-expunge]      Expunge deleted messages.
 \\[rmail-expunge-and-save]     Expunge and save the file.
 \\[rmail-quit]       Quit Rmail: expunge, save, then switch to another buffer.
@@ -4610,11 +4612,10 @@ Argument MIME is non-nil if this is a mime message."
                     "> ")
              (push (rmail-epa-decrypt-1 mime) decrypts))))
 
-      (when (and decrypts (eq major-mode 'rmail-mode))
-        (rmail-add-label "decrypt"))
-
       (when (and decrypts (rmail-buffers-swapped-p))
        (when (y-or-n-p "Replace the original message? ")
+          (when (eq major-mode 'rmail-mode)
+            (rmail-add-label "decrypt"))
          (setq decrypts (nreverse decrypts))
          (let ((beg (rmail-msgbeg rmail-current-message))
                (end (rmail-msgend rmail-current-message)))
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index a085e0b..9ccc0cf 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -121,6 +121,7 @@ Setting this option to nil might speed up the generation of 
summaries."
     (define-key map [?\S-\ ] 'rmail-summary-scroll-msg-down)
     (define-key map "\177"   'rmail-summary-scroll-msg-down)
     (define-key map "?"      'describe-mode)
+    (define-key map "\C-c\C-d"      'rmail-summary-epa-decrypt)
     (define-key map "\C-c\C-n" 'rmail-summary-next-same-subject)
     (define-key map "\C-c\C-p" 'rmail-summary-previous-same-subject)
     (define-key map "\C-c\C-s\C-d" 'rmail-summary-sort-by-date)
@@ -1482,6 +1483,12 @@ argument says to read a file name and use that file as 
the inbox."
   (rmail-edit-current-message)
   (use-local-map rmail-summary-edit-map))
 
+(defun rmail-summary-epa-decrypt ()
+  "Decrypt this message."
+  (interactive)
+  (rmail-pop-to-buffer rmail-buffer)
+  (rmail-epa-decrypt))
+
 (defun rmail-summary-cease-edit ()
   "Finish editing message, then go back to Rmail summary buffer."
   (interactive)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]