]> git.eshelyaron.com Git - emacs.git/commitdiff
(mode-line-change-eol): Add EVENT parameter.
authorJohn Paul Wallington <jpw@pobox.com>
Sat, 10 Jan 2004 01:20:39 +0000 (01:20 +0000)
committerJohn Paul Wallington <jpw@pobox.com>
Sat, 10 Jan 2004 01:20:39 +0000 (01:20 +0000)
Temporarily select EVENT's window for changing eol type.

lisp/ChangeLog
lisp/bindings.el

index dad6eb6b4d42f5c8e411c1613e2c37e7ddb3314c..5d7f5d9c652d8cf45d49dd6b74793c7083e6a6ad 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-09  John Paul Wallington  <jpw@gnu.org>
+
+       * bindings.el (mode-line-change-eol): Add EVENT parameter.
+       Temporarily select EVENT's window for changing eol type.
+
 2004-01-09  Deepak Goel  <deego@gnufans.org>
 
        * calendar/diary-lib.el (diary-entry-time):
index ed4da745b2da48b8ea27c3b045eb895a325f0638..1f86f3b6fcb67e4bff99d63ae4b6d2b859152dae 100644 (file)
@@ -135,12 +135,14 @@ corresponding to the mode line clicked."
   "Local keymap for the coding-system part of the mode line.")
 
 
-(defun mode-line-change-eol ()
+(defun mode-line-change-eol (event)
   "Cycle through the various possible kinds of end-of-line styles."
-  (interactive)
-  (let ((eol (coding-system-eol-type buffer-file-coding-system)))
-    (set-buffer-file-coding-system
-     (cond ((eq eol 0) 'dos) ((eq eol 1) 'mac) (t 'unix)))))
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (let ((eol (coding-system-eol-type buffer-file-coding-system)))
+      (set-buffer-file-coding-system
+       (cond ((eq eol 0) 'dos) ((eq eol 1) 'mac) (t 'unix))))))
 
 (defvar mode-line-eol-desc-cache nil)