mu4e: make global-mode-string buffer-local
Make `global-mode-string' local in all buffers where we use it, so we don't leak the "context" string outside mu4e. Also add the context string to the compose buffer's modeline. This fixes #740.
This commit is contained in:
@ -288,6 +288,9 @@ message-thread by removing the In-Reply-To header."
|
|||||||
\\{message-mode-map}."
|
\\{message-mode-map}."
|
||||||
(progn
|
(progn
|
||||||
(use-local-map mu4e-compose-mode-map)
|
(use-local-map mu4e-compose-mode-map)
|
||||||
|
|
||||||
|
(set (make-local-variable 'global-mode-string) '(:eval (mu4e-context-label)))
|
||||||
|
|
||||||
(set (make-local-variable 'message-signature) mu4e-compose-signature)
|
(set (make-local-variable 'message-signature) mu4e-compose-signature)
|
||||||
;; set this to allow mu4e to work when gnus-agent is unplugged in gnus
|
;; set this to allow mu4e to work when gnus-agent is unplugged in gnus
|
||||||
(set (make-local-variable 'message-send-mail-real-function) nil)
|
(set (make-local-variable 'message-send-mail-real-function) nil)
|
||||||
|
|||||||
@ -70,8 +70,12 @@
|
|||||||
"Major mode for the mu4e main screen.
|
"Major mode for the mu4e main screen.
|
||||||
\\{mu4e-main-mode-map}."
|
\\{mu4e-main-mode-map}."
|
||||||
(use-local-map mu4e-main-mode-map)
|
(use-local-map mu4e-main-mode-map)
|
||||||
(setq truncate-lines t
|
(setq
|
||||||
overwrite-mode 'overwrite-mode-binary)
|
truncate-lines t
|
||||||
|
overwrite-mode 'overwrite-mode-binary)
|
||||||
|
|
||||||
|
;; show context in mode-string
|
||||||
|
(set (make-local-variable 'global-mode-string) '(:eval (mu4e-context-label)))
|
||||||
(set (make-local-variable 'revert-buffer-function) #'mu4e~main-view-real))
|
(set (make-local-variable 'revert-buffer-function) #'mu4e~main-view-real))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -734,9 +734,10 @@ FUNC should be a function taking two arguments:
|
|||||||
(make-local-variable 'mu4e~view-attach-map)
|
(make-local-variable 'mu4e~view-attach-map)
|
||||||
(make-local-variable 'mu4e~view-cited-hidden)
|
(make-local-variable 'mu4e~view-cited-hidden)
|
||||||
|
|
||||||
(setq buffer-undo-list t ;; don't record undo info
|
;; show context in mode-string
|
||||||
global-mode-string ;; show context in mode-line
|
(set (make-local-variable 'global-mode-string) '(:eval (mu4e-context-label)))
|
||||||
'(:eval (mu4e-context-label)))
|
|
||||||
|
(setq buffer-undo-list t);; don't record undo info
|
||||||
|
|
||||||
;; autopair mode gives error when pressing RET
|
;; autopair mode gives error when pressing RET
|
||||||
;; turn it off
|
;; turn it off
|
||||||
|
|||||||
Reference in New Issue
Block a user