]> git.cworth.org Git - obsolete/notmuch-old/blobdiff - emacs/notmuch-mua.el
emacs: Don't always prompt for the "From" address when replying
[obsolete/notmuch-old] / emacs / notmuch-mua.el
index 61a723b761efed3052d1f4cdd07b67efd29bae49..556d2bf0b86cca0ca369d9c4fb06342af501ac60 100644 (file)
@@ -70,12 +70,17 @@ list."
        notmuch-mua-hidden-headers))
 
 (defun notmuch-mua-reply (query-string &optional sender)
-  (let (headers body)
+  (let (headers
+       body
+       (args '("reply")))
+    (if notmuch-show-process-crypto
+       (setq args (append args '("--decrypt"))))
+    (setq args (append args (list query-string)))
     ;; This make assumptions about the output of `notmuch reply', but
     ;; really only that the headers come first followed by a blank
     ;; line and then the body.
     (with-temp-buffer
-      (call-process notmuch-command nil t nil "reply" query-string)
+      (apply 'call-process (append (list notmuch-command nil (list t t) nil) args))
       (goto-char (point-min))
       (if (re-search-forward "^$" nil t)
          (save-excursion
@@ -150,7 +155,10 @@ name and addresses configured in the notmuch configuration file."
   :type '(repeat string))
 
 (defcustom notmuch-always-prompt-for-sender nil
-  "Always prompt for the From: address when composing a new message."
+  "Always prompt for the From: address when composing or forwarding a message.
+
+This is not taken into account when replying to a message, because in that case
+the From: header is already filled in by notmuch."
   :group 'notmuch
   :type 'boolean)
 
@@ -198,7 +206,7 @@ the From: address first."
   "Invoke the notmuch reply window."
   (interactive "P")
   (let ((sender
-        (when (or prompt-for-sender notmuch-always-prompt-for-sender)
+        (when prompt-for-sender
           (notmuch-mua-prompt-for-sender))))
     (notmuch-mua-reply query-string sender)))