1998-04-29 Jim Radford <radford(a)robby.caltech.edu>
* modeline.el: Add line-number-mode, column-number-mode to
the modeline minor-mode menu. Button2 on the line number does
goto-line.
=== cvs -d :pserver:xemacs@cvs.xemacs.org:/usr/CVSroot diff -u modeline.el
Index: modeline.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/lisp/modeline.el,v
retrieving revision 1.11
diff -u -r1.11 modeline.el
--- modeline.el 1998/03/12 09:36:36 1.11
+++ modeline.el 1998/04/30 05:46:56
@@ -541,6 +541,24 @@
other than ordinary files may change this (e.g. Info, Dired,...)")
(make-variable-buffer-local 'modeline-buffer-identification)
+(defvar modeline-line-number-map
+ (make-sparse-keymap 'modeline-line-number-map)
+"Keymap consulted for mouse-clicks on the line number in the modeline.")
+
+(define-key modeline-line-number-map 'button2 'goto-line)
+
+(defvar modeline-line-number-extent (make-extent nil nil)
+ "Extent covering the modeline-line-number string.")
+(set-extent-face modeline-line-number-extent 'modeline-mousable)
+(set-extent-keymap modeline-line-number-extent modeline-line-number-map)
+(set-extent-property modeline-line-number-extent 'help-echo
+ "button2 to goto a specific line")
+
+(put 'line-number-mode :menu-tag "Line Number")
+(add-minor-mode 'line-number-mode "")
+(put 'column-number-mode :menu-tag "Column Number")
+(add-minor-mode 'column-number-mode "")
+
(defconst modeline-process nil
"Modeline control for displaying info on process status.
Normally nil in most modes, since there is no process to display.")
@@ -587,7 +605,7 @@
(cons modeline-narrowed-extent "%n")
'modeline-process
(purecopy ")%]----")
- (purecopy '(line-number-mode "L%l--"))
+ (cons modeline-line-number-extent (list 'line-number-mode (purecopy "L%l--")))
(purecopy '(column-number-mode "C%c--"))
(purecopy '(-3 . "%p"))
(purecopy "-%-")))