diff options
| author | Daniel Pfeiffer | 2004-07-17 08:10:28 +0000 |
|---|---|---|
| committer | Daniel Pfeiffer | 2004-07-17 08:10:28 +0000 |
| commit | 7778781072f91c4603b4e0516c64ff3a5c76c298 (patch) | |
| tree | decb8e7803b7458adeeb464d68dea2681ebacd7d | |
| parent | dd0a3ea36a52518f4fcd2dea97859cfba63158f8 (diff) | |
| download | emacs-7778781072f91c4603b4e0516c64ff3a5c76c298.tar.gz emacs-7778781072f91c4603b4e0516c64ff3a5c76c298.zip | |
(which-func-keymap): New var.
(which-func-face): New face.
(which-func-format): Use them.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/which-func.el | 28 |
2 files changed, 33 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6b2d3eb4145..c45bd6987b9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2004-07-14 Daniel Pfeiffer <occitan@esperanto.org> | ||
| 2 | |||
| 3 | * progmodes/which-func.el (which-func-keymap): New var. | ||
| 4 | (which-func-face): New face. | ||
| 5 | (which-func-format): Use them. | ||
| 6 | |||
| 1 | 2004-07-16 Stephan Stahl <stahl@eos.franken.de> (tiny change) | 7 | 2004-07-16 Stephan Stahl <stahl@eos.franken.de> (tiny change) |
| 2 | 8 | ||
| 3 | * buff-menu.el (list-buffers-noselect): Append the buffer's | 9 | * buff-menu.el (list-buffers-noselect): Append the buffer's |
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." | |||
| 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) |