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. (shown in a tooltip or in the echo area) for any part of the mode line that does not have its own specialized help text. +*** You can now click mouse-3 in the coding system indicator to +invokes `set-buffer-file-coding-system'. + * Editing Changes in Emacs 24.2 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5ecd949d4c1..0efca43be1e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -12,6 +12,9 @@ (mode-line-mule-info, mode-line-modified): Use them. (mode-line-eol-desc, propertized-buffer-identification): Consistency fixes for help text. + (mode-line-coding-system-map): Allow using mouse-3 to invoke + set-buffer-file-coding-system (Bug#289). + (mode-line-mule-info-help-echo): Update help text. 2012-06-02 Stefan Monnier 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." (when (and enable-multibyte-characters buffer-file-coding-system) (describe-coding-system buffer-file-coding-system))))) + (define-key map [mode-line mouse-3] + (lambda (e) + (interactive "e") + (save-selected-window + (select-window (posn-window (event-start e))) + (call-interactively 'set-buffer-file-coding-system)))) (purecopy map)) "Local keymap for the coding-system part of the mode line.") @@ -153,7 +159,8 @@ is displayed first.") (with-current-buffer (window-buffer window) (if buffer-file-coding-system (format "Buffer coding system (%s): %s -mouse-1: Describe coding system" +mouse-1: Describe coding system +mouse-3: Set coding system" (if enable-multibyte-characters "multi-byte" "unibyte") (symbol-name buffer-file-coding-system)) "Buffer coding system: none specified")))