[PATCH 2/3] emacs: Add customization and hook for tach-mode to notmuch-message.el

Jesse Rosenthal jrosenthal at jhu.edu
Tue Apr 27 10:19:31 PDT 2010


This adds a customization option "notmuch-message-attachment-interface" to
notmuch-message.el. If set to t, tach-mode will be used as an attachment
interface for composing in message mode. If set to nil, it will not be
used. The default is nil, but if people like it, we can default to t in
the future.

This also adds a hook to message-mode, which only loads tach and adds the
minor mode if the customization is set. In the future, this will likely be
changed to a hook for notmuch-message-mode.
---
 emacs/notmuch-message.el |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el
index d5c96c2..094d3fc 100644
--- a/emacs/notmuch-message.el
+++ b/emacs/notmuch-message.el
@@ -33,6 +33,17 @@ the \"inbox\" and \"todo\", you would set
   :type 'list
   :group 'notmuch)
 
+(defcustom notmuch-message-attachment-interface nil
+  "Whether or not to use a menu-based user-interface for attaching messages, rather than mml-mode
+
+If this is non-nil, the tach minor-mode for attachments will be added.
+The user can add attachments by pressing `C-cC-a' in message-mode,
+or by typing `tach-goto'. Any attachments will be converted to mml-markup
+prior to sending."
+  :type 'boolean
+  :group 'notmuch)
+  
+
 (defun notmuch-message-mark-replied ()
   ;; get the in-reply-to header and parse it for the message id.
   (let ((rep (mail-header-parse-addresses (message-field-value "In-Reply-To"))))
@@ -49,4 +60,12 @@ the \"inbox\" and \"todo\", you would set
 
 (add-hook 'message-send-hook 'notmuch-message-mark-replied)
 
+(add-hook 'message-mode-hook '(lambda ()
+				(when notmuch-message-attachment-interface
+				  (require 'tach)
+				  (tach-minor-mode))))
+				
+
+			
+
 (provide 'notmuch-message)
-- 
1.6.3.3



More information about the notmuch mailing list