[PATCH 2/2] emacs: notmuch-show-mode should force less behaviour.

David Edmondson dme at dme.org
Mon Nov 15 05:48:15 PST 2010


Move the enabling of `goto-address-mode' and `visual-line-mode' to
`notmuch-show-hook' in order that a user may choose to not use them.
---
 emacs/notmuch-show.el |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 002c2fd..c9d086c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -69,7 +69,14 @@ any given message."
   "A list of functions called to decorate the headers listed in
 `notmuch-message-headers'.")
 
-(defcustom notmuch-show-hook nil
+(defun notmuch-show-turn-on-goto-address-mode ()
+  (goto-address-mode t))
+
+(defun notmuch-show-turn-on-visual-line-mode ()
+  (visual-line-mode t))
+
+(defcustom notmuch-show-hook '(notmuch-show-turn-on-goto-address-mode
+			       notmuch-show-turn-on-visual-line-mode)
   "Functions called after populating a `notmuch-show' buffer."
   :group 'notmuch
   :type 'hook)
@@ -648,12 +655,6 @@ function is used. "
 	  (notmuch-show-insert-forest
 	   (notmuch-query-get-threads basic-args))))
 
-      ;; Enable buttonisation of URLs and email addresses in the
-      ;; buffer.
-      (goto-address-mode t)
-      ;; Act on visual lines rather than logical lines.
-      (visual-line-mode t)
-
       (run-hooks 'notmuch-show-hook))
 
     ;; Move straight to the first open message
-- 
1.7.2.3



More information about the notmuch mailing list