Mercurial > emacs
comparison lisp/progmodes/which-func.el @ 56442:e8032355ca23
(which-func-keymap): New var.
(which-func-face): New face.
(which-func-format): Use them.
author | Daniel Pfeiffer <occitan@esperanto.org> |
---|---|
date | Sat, 17 Jul 2004 08:08:57 +0000 |
parents | bd715b02e44e |
children | f54e121491eb b9eee0a7bef5 |
comparison
equal
deleted
inserted
replaced
56441:99304c916e62 | 56442:e8032355ca23 |
---|---|
97 "Don't automatically compute the Imenu menu if buffer is this big or bigger. | 97 "Don't automatically compute the Imenu menu if buffer is this big or bigger. |
98 Zero means compute the Imenu menu regardless of size." | 98 Zero means compute the Imenu menu regardless of size." |
99 :group 'which-func | 99 :group 'which-func |
100 :type 'integer) | 100 :type 'integer) |
101 | 101 |
102 (defcustom which-func-format '("[" which-func-current "]") | 102 (defvar which-func-keymap |
103 (let ((map (make-sparse-keymap))) | |
104 (define-key map [mode-line mouse-1] 'beginning-of-defun) | |
105 (define-key map [mode-line mouse-2] | |
106 (lambda () | |
107 (interactive) | |
108 (if (eq (point-min) 1) | |
109 (narrow-to-defun) | |
110 (widen)))) | |
111 (define-key map [mode-line mouse-3] 'end-of-defun) | |
112 map) | |
113 "Keymap to display on mode line which-func.") | |
114 | |
115 (defface which-func-face | |
116 '((t (:inherit font-lock-function-name-face))) | |
117 "Face used to highlight mode line function names. | |
118 Defaults to `font-lock-function-name-face' if font-lock is loaded." | |
119 :group 'which-func) | |
120 | |
121 (defcustom which-func-format | |
122 `("[" | |
123 (:propertize which-func-current | |
124 local-map ,which-func-keymap | |
125 face which-func-face | |
126 ;;mouse-face highlight ; currently not evaluated :-( | |
127 help-echo "mouse-1: go to beginning, mouse-2: toggle rest visibility, mouse-3: go to end") | |
128 "]") | |
103 "Format for displaying the function in the mode line." | 129 "Format for displaying the function in the mode line." |
104 :group 'which-func | 130 :group 'which-func |
105 :type 'sexp) | 131 :type 'sexp) |
106 ;;;###autoload (put 'which-func-format 'risky-local-variable t) | 132 ;;;###autoload (put 'which-func-format 'risky-local-variable t) |
107 | 133 |