]> git.eshelyaron.com Git - emacs.git/commitdiff
(which-func-keymap): New var.
authorDaniel Pfeiffer <occitan@esperanto.org>
Sat, 17 Jul 2004 08:10:28 +0000 (08:10 +0000)
committerDaniel Pfeiffer <occitan@esperanto.org>
Sat, 17 Jul 2004 08:10:28 +0000 (08:10 +0000)
(which-func-face): New face.
(which-func-format): Use them.

lisp/ChangeLog
lisp/progmodes/which-func.el

index 6b2d3eb4145f29019f0158e1408fead1e8e82255..c45bd6987b9167e4e94d5c4a31f1c7596363ab59 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-14  Daniel Pfeiffer  <occitan@esperanto.org>
+
+       * progmodes/which-func.el (which-func-keymap): New var.
+       (which-func-face): New face.
+       (which-func-format): Use them.
+
 2004-07-16  Stephan Stahl  <stahl@eos.franken.de>  (tiny change)
 
        * buff-menu.el (list-buffers-noselect): Append the buffer's
index fef159d850f581a551ae64d58e0a26a486b82f7b..87df0769314958e13c57d55203ecef4081bcd2d8 100644 (file)
@@ -99,7 +99,33 @@ Zero means compute the Imenu menu regardless of size."
   :group 'which-func
   :type 'integer)
 
-(defcustom which-func-format '("[" which-func-current "]")
+(defvar which-func-keymap
+  (let ((map (make-sparse-keymap)))
+    (define-key map [mode-line mouse-1] 'beginning-of-defun)
+    (define-key map [mode-line mouse-2]
+      (lambda ()
+       (interactive)
+       (if (eq (point-min) 1)
+           (narrow-to-defun)
+         (widen))))
+    (define-key map [mode-line mouse-3] 'end-of-defun)
+    map)
+  "Keymap to display on mode line which-func.")
+
+(defface which-func-face
+  '((t (:inherit font-lock-function-name-face)))
+  "Face used to highlight mode line function names.
+Defaults to `font-lock-function-name-face' if font-lock is loaded."
+  :group 'which-func)
+
+(defcustom which-func-format
+  `("["
+    (:propertize which-func-current
+                local-map ,which-func-keymap
+                face which-func-face
+                ;;mouse-face highlight ; currently not evaluated :-(
+                help-echo "mouse-1: go to beginning, mouse-2: toggle rest visibility, mouse-3: go to end")
+    "]")
   "Format for displaying the function in the mode line."
   :group 'which-func
   :type 'sexp)