aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-06-03 18:54:22 +0800
committerChong Yidong2012-06-03 18:54:22 +0800
commitcbe46e5fae3879facf5db395afd73ca2600f8a41 (patch)
treeec30197f6036a4c191cbdfbdc2475c55f44d3217
parent383f7350f34707d317e169c203d3c6efb27ee46c (diff)
downloademacs-cbe46e5fae3879facf5db395afd73ca2600f8a41.tar.gz
emacs-cbe46e5fae3879facf5db395afd73ca2600f8a41.zip
Allow clicking mouse-3 on mode line to change coding system.
* lisp/bindings.el (mode-line-coding-system-map): Allow using mouse-3 to invoke set-buffer-file-coding-system. (mode-line-mule-info-help-echo): Update help text. Fixes: debbugs:289
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/bindings.el9
3 files changed, 14 insertions, 1 deletions
diff --git a/etc/NEWS b/etc/NEWS
index c24a8fbdfc6..3bc54d0ff2d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -93,6 +93,9 @@ Use "coding: raw-text" instead.
93(shown in a tooltip or in the echo area) for any part of the mode line 93(shown in a tooltip or in the echo area) for any part of the mode line
94that does not have its own specialized help text. 94that does not have its own specialized help text.
95 95
96*** You can now click mouse-3 in the coding system indicator to
97invokes `set-buffer-file-coding-system'.
98
96 99
97* Editing Changes in Emacs 24.2 100* Editing Changes in Emacs 24.2
98 101
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5ecd949d4c1..0efca43be1e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -12,6 +12,9 @@
12 (mode-line-mule-info, mode-line-modified): Use them. 12 (mode-line-mule-info, mode-line-modified): Use them.
13 (mode-line-eol-desc, propertized-buffer-identification): 13 (mode-line-eol-desc, propertized-buffer-identification):
14 Consistency fixes for help text. 14 Consistency fixes for help text.
15 (mode-line-coding-system-map): Allow using mouse-3 to invoke
16 set-buffer-file-coding-system (Bug#289).
17 (mode-line-mule-info-help-echo): Update help text.
15 18
162012-06-02 Stefan Monnier <monnier@iro.umontreal.ca> 192012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
17 20
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 8e6c94466cf..2a37bfd19a7 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -88,6 +88,12 @@ corresponding to the mode line clicked."
88 (when (and enable-multibyte-characters 88 (when (and enable-multibyte-characters
89 buffer-file-coding-system) 89 buffer-file-coding-system)
90 (describe-coding-system buffer-file-coding-system))))) 90 (describe-coding-system buffer-file-coding-system)))))
91 (define-key map [mode-line mouse-3]
92 (lambda (e)
93 (interactive "e")
94 (save-selected-window
95 (select-window (posn-window (event-start e)))
96 (call-interactively 'set-buffer-file-coding-system))))
91 (purecopy map)) 97 (purecopy map))
92 "Local keymap for the coding-system part of the mode line.") 98 "Local keymap for the coding-system part of the mode line.")
93 99
@@ -153,7 +159,8 @@ is displayed first.")
153 (with-current-buffer (window-buffer window) 159 (with-current-buffer (window-buffer window)
154 (if buffer-file-coding-system 160 (if buffer-file-coding-system
155 (format "Buffer coding system (%s): %s 161 (format "Buffer coding system (%s): %s
156mouse-1: Describe coding system" 162mouse-1: Describe coding system
163mouse-3: Set coding system"
157 (if enable-multibyte-characters "multi-byte" "unibyte") 164 (if enable-multibyte-characters "multi-byte" "unibyte")
158 (symbol-name buffer-file-coding-system)) 165 (symbol-name buffer-file-coding-system))
159 "Buffer coding system: none specified"))) 166 "Buffer coding system: none specified")))