unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* put goto-line on modeline
@ 2005-01-17  1:53 Nick Roberts
  2005-01-17 16:10 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Nick Roberts @ 2005-01-17  1:53 UTC (permalink / raw)



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))))))))

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-01-21  9:06 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-17  1:53 put goto-line on modeline Nick Roberts
2005-01-17 16:10 ` Stefan Monnier
2005-01-17 20:36   ` Nick Roberts
2005-01-17 23:43 ` Richard Stallman
2005-01-18  4:43   ` Masatake YAMATO
2005-01-18  6:54     ` Drew Adams
2005-01-18  9:29       ` David Kastrup
2005-01-19  0:49         ` Richard Stallman
2005-01-19 10:14           ` David Kastrup
2005-01-18  5:02 ` Masatake YAMATO
2005-01-18  6:55   ` Drew Adams
2005-01-19  0:51   ` Richard Stallman
2005-01-19  4:40     ` Masatake YAMATO
2005-01-19 10:17     ` David Kastrup
2005-01-20 21:31       ` Richard Stallman
2005-01-20 22:23         ` David Kastrup
2005-01-21  1:59         ` Nick Roberts
2005-01-21  9:06           ` David Kastrup

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).