Browse files

mu4e: fix `q' binding in About buffer

mu4e's About buffer uses org-mode and used to locally bind `q' to bury
the buffer.  However, altering local key map via local-set-key
shares binding with all buffers using the same major mode.  As a result,
after executing About mu4e once, pressing `q' in any regular org-mode
buffer was also burying it instead of inserting the letter `q'.

This commit fixes the problem by creating a new mu4e-about-mode
derived from org-mode and by defining `q' only for that mode.
  • Loading branch information...
1 parent b41e8a6 commit eb606f9c8a909f2b98bdca5779eee5e3e28a3a6d @tiborsimko tiborsimko committed Mar 10, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 mu4e/mu4e-utils.el
@@ -1,6 +1,7 @@
;;; mu4e-utils.el -- part of mu4e, the mu mail user agent
;; Copyright (C) 2011-2012 Dirk-Jan C. Binnema
+;; Copyright (C) 2013 Tibor Simko
;; Author: Dirk-Jan C. Binnema <>
;; Maintainer: Dirk-Jan C. Binnema <>
@@ -900,6 +901,10 @@ displaying it). Do _not_ bury the current buffer, though."
(defconst mu4e~main-about-buffer-name "*mu4e-about*"
"Name for the mu4e-about buffer.")
+(define-derived-mode mu4e-about-mode org-mode "mu4e:about"
+ "Major mode for the mu4e About page, derived from `org-mode'.")
+(define-key mu4e-about-mode-map (kbd "q") 'bury-buffer)
(defun mu4e-about ()
"Show a buffer with the mu4e-about text."
@@ -908,11 +913,10 @@ displaying it). Do _not_ bury the current buffer, though."
(let ((inhibit-read-only t))
(insert mu4e-about)
- (org-mode)
+ (mu4e-about-mode)
(switch-to-buffer mu4e~main-about-buffer-name)
(setq buffer-read-only t)
- (local-set-key "q" 'bury-buffer)
(goto-char (point-min)))

0 comments on commit eb606f9

Please sign in to comment.