[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
put goto-line on modeline
From: |
Nick Roberts |
Subject: |
put goto-line on modeline |
Date: |
Mon, 17 Jan 2005 14:53:21 +1300 |
This patch allows the user to invoke goto-line by clicking on the line number
in the modeline.
Are there any objections to me installing it?
Nick
*** /home/nick/emacs/lisp/bindings.el.~1.137.~ 2004-12-14 09:34:21.000000000
+1300
--- /home/nick/emacs/lisp/bindings.el 2005-01-17 14:45:41.000000000 +1300
***************
*** 83,88 ****
--- 83,98 ----
(force-mode-line-update)))
+ (defun mode-line-goto-line (event)
+ "Like `go-to-line', for the mode-line."
+ (interactive "e")
+ (save-selected-window
+ (select-window (posn-window (event-start event)))
+ (let ((arg (read-from-minibuffer "Goto line: ")))
+ (goto-line (string-to-int arg)))
+ (force-mode-line-update)))
+
+
(defun mode-line-abbrev-mode (event)
"Turn off `abbrev-mode' from the mode-line."
(interactive "e")
***************
*** 321,327 ****
(line-number-mode
((column-number-mode
(10 ,(propertize " (%l,%c)" 'help-echo help-echo))
! (6 ,(propertize " L%l" 'help-echo help-echo))))
((column-number-mode
(5 ,(propertize " C%c" 'help-echo help-echo))))))))
--- 331,340 ----
(line-number-mode
((column-number-mode
(10 ,(propertize " (%l,%c)" 'help-echo help-echo))
! (6 ,(propertize " L%l" 'help-echo "mouse-3: go to line"
! 'local-map (purecopy (make-mode-line-mouse-map
! 'mouse-3
! #'mode-line-goto-line))))))
((column-number-mode
(5 ,(propertize " C%c" 'help-echo help-echo))))))))
- put goto-line on modeline,
Nick Roberts <=
Re: put goto-line on modeline, Masatake YAMATO, 2005/01/18