summaryrefslogtreecommitdiff
path: root/lisp/progmodes/which-func.el
diff options
context:
space:
mode:
authorDaniel Pfeiffer <occitan@esperanto.org>2004-07-17 08:10:28 +0000
committerDaniel Pfeiffer <occitan@esperanto.org>2004-07-17 08:10:28 +0000
commit7778781072f91c4603b4e0516c64ff3a5c76c298 (patch)
treedecb8e7803b7458adeeb464d68dea2681ebacd7d /lisp/progmodes/which-func.el
parentdd0a3ea36a52518f4fcd2dea97859cfba63158f8 (diff)
downloademacs-7778781072f91c4603b4e0516c64ff3a5c76c298.tar.gz
(which-func-keymap): New var.
(which-func-face): New face. (which-func-format): Use them.
Diffstat (limited to 'lisp/progmodes/which-func.el')
-rw-r--r--lisp/progmodes/which-func.el28
1 files changed, 27 insertions, 1 deletions
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index fef159d850f..87df0769314 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -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)