Mercurial > emacs
annotate lisp/which-func.el @ 35289:67f917367b49
*** empty log message ***
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Sat, 13 Jan 2001 00:04:05 +0000 |
parents | 683f3781ab81 |
children | 7ded5b71182f |
rev | line source |
---|---|
20322 | 1 ;;; which-func.el --- Print current function in mode line |
20321 | 2 |
21697 | 3 ;; Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc. |
20321 | 4 |
5 ;; Author: Alex Rezinsky <alexr@msil.sps.mot.com> | |
33702
683f3781ab81
Update maintainer line.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32190
diff
changeset
|
6 ;; (doesn't seem to be responsive any more) |
21697 | 7 ;; Keywords: mode-line, imenu, tools |
20321 | 8 |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
21697 | 26 ;;; Commentary: |
27 | |
28 ;; This package prints name of function where your current point is | |
29 ;; located in mode line. It assumes that you work with imenu package | |
30 ;; and imenu--index-alist is up to date. | |
20321 | 31 |
21697 | 32 ;; KNOWN BUGS |
33 ;; ---------- | |
34 ;; Really this package shows not "function where the current point is | |
35 ;; located now", but "nearest function which defined above the current | |
36 ;; point". So if your current point is located after end of function | |
37 ;; FOO but before begin of function BAR, FOO will be displayed in mode | |
38 ;; line. | |
20321 | 39 |
21697 | 40 ;; TODO LIST |
41 ;; --------- | |
42 ;; 1. Dependence on imenu package should be removed. Separate | |
43 ;; function determination mechanism should be used to determine the end | |
44 ;; of a function as well as the beginning of a function. | |
45 ;; 2. This package should be realized with the help of overlay | |
46 ;; properties instead of imenu--index-alist variable. | |
47 | |
48 ;;; History: | |
20321 | 49 |
21697 | 50 ;; THANKS TO |
51 ;; --------- | |
52 ;; Per Abrahamsen <abraham@iesd.auc.dk> | |
53 ;; Some ideas (inserting in mode-line, using of post-command hook | |
54 ;; and toggling this mode) have been borrowed from his package | |
55 ;; column.el | |
56 ;; Peter Eisenhauer <pipe@fzi.de> | |
57 ;; Bug fixing in case nested indexes. | |
58 ;; Terry Tateyama <ttt@ursa0.cs.utah.edu> | |
59 ;; Suggestion to use find-file-hooks for first imenu | |
60 ;; index building. | |
20321 | 61 |
21697 | 62 ;;; Code: |
63 | |
64 ;; Variables for customization | |
65 ;; --------------------------- | |
66 ;; | |
20321 | 67 (defvar which-func-unknown "???" |
68 "String to display in the mode line when current function is unknown.") | |
69 | |
21653
e95a88dc6110
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
20573
diff
changeset
|
70 (defgroup which-func nil |
e95a88dc6110
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
20573
diff
changeset
|
71 "Mode to display the current function name in the modeline." |
e95a88dc6110
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
20573
diff
changeset
|
72 :group 'tools |
e95a88dc6110
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
20573
diff
changeset
|
73 :version "20.3") |
e95a88dc6110
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
20573
diff
changeset
|
74 |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
75 (defcustom which-func-modes |
23018
114211878bf9
(which-func-modes): Add fortran-mode.
Richard M. Stallman <rms@gnu.org>
parents:
22308
diff
changeset
|
76 '(emacs-lisp-mode c-mode c++-mode perl-mode makefile-mode sh-mode |
114211878bf9
(which-func-modes): Add fortran-mode.
Richard M. Stallman <rms@gnu.org>
parents:
22308
diff
changeset
|
77 fortran-mode) |
22134
29c2db002dd5
(which-func-modes): Fix custom type.
Richard M. Stallman <rms@gnu.org>
parents:
21964
diff
changeset
|
78 "List of major modes for which Which Function mode should be used. |
20321 | 79 For other modes it is disabled. If this is equal to t, |
22134
29c2db002dd5
(which-func-modes): Fix custom type.
Richard M. Stallman <rms@gnu.org>
parents:
21964
diff
changeset
|
80 then Which Function mode is enabled in any major mode that supports it." |
20321 | 81 :group 'which-func |
82 :type '(choice (const :tag "All modes" t) | |
22134
29c2db002dd5
(which-func-modes): Fix custom type.
Richard M. Stallman <rms@gnu.org>
parents:
21964
diff
changeset
|
83 (repeat (symbol :tag "Major mode")))) |
20321 | 84 |
21964
390352ec56c6
(which-func-non-auto-modes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
21960
diff
changeset
|
85 (defcustom which-func-non-auto-modes nil |
390352ec56c6
(which-func-non-auto-modes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
21960
diff
changeset
|
86 "List of major modes where Which Function mode is inactive till Imenu is used. |
22134
29c2db002dd5
(which-func-modes): Fix custom type.
Richard M. Stallman <rms@gnu.org>
parents:
21964
diff
changeset
|
87 This means that Which Function mode won't really do anything |
29c2db002dd5
(which-func-modes): Fix custom type.
Richard M. Stallman <rms@gnu.org>
parents:
21964
diff
changeset
|
88 until you use Imenu, in these modes. Note that files |
29c2db002dd5
(which-func-modes): Fix custom type.
Richard M. Stallman <rms@gnu.org>
parents:
21964
diff
changeset
|
89 larger than `which-func-maxout' behave in this way too; |
29c2db002dd5
(which-func-modes): Fix custom type.
Richard M. Stallman <rms@gnu.org>
parents:
21964
diff
changeset
|
90 Which Function mode doesn't do anything until you use Imenu." |
20321 | 91 :group 'which-func |
22134
29c2db002dd5
(which-func-modes): Fix custom type.
Richard M. Stallman <rms@gnu.org>
parents:
21964
diff
changeset
|
92 :type '(repeat (symbol :tag "Major mode"))) |
20321 | 93 |
94 (defcustom which-func-maxout 100000 | |
95 "Don't automatically compute the Imenu menu if buffer is this big or bigger. | |
96 Zero means compute the Imenu menu regardless of size." | |
97 :group 'which-func | |
98 :type 'integer) | |
99 | |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
100 (defcustom which-func-format '("[" which-func-current "]") |
20321 | 101 "Format for displaying the function in the mode line." |
102 :group 'which-func | |
103 :type 'sexp) | |
104 | |
21697 | 105 ;;;###autoload |
106 (defcustom which-func-mode-global nil | |
24649
ce2b5ccac297
(which-func-mode-global): Doc fix.
Dave Love <fx@gnu.org>
parents:
24550
diff
changeset
|
107 "*Toggle `which-func-mode' globally. |
ce2b5ccac297
(which-func-mode-global): Doc fix.
Dave Love <fx@gnu.org>
parents:
24550
diff
changeset
|
108 Setting this variable directly does not take effect; |
ce2b5ccac297
(which-func-mode-global): Doc fix.
Dave Love <fx@gnu.org>
parents:
24550
diff
changeset
|
109 use either \\[customize] or the function `which-func-mode'." |
21697 | 110 :set #'(lambda (symbol value) |
23355
4486a6940607
(which-func-mode-global): Make :set function
Karl Heuer <kwzh@gnu.org>
parents:
23350
diff
changeset
|
111 (which-func-mode (if value 1 0))) |
21697 | 112 :initialize 'custom-initialize-default |
113 :type 'boolean | |
114 :group 'which-func | |
115 :require 'which-func) | |
116 | |
25425
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
117 (defvar which-func-cleanup-function nil |
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
118 "Function to transform a string before displaying it in the mode line. |
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
119 The function is called with one argument, the string to display. |
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
120 Its return value is displayed in the modeline. |
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
121 If nil, no function is called. The default value is nil. |
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
122 |
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
123 This feature can be useful if Imenu is set up to make more |
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
124 detailed entries (e.g., containing the argument list of a function), |
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
125 and you want to simplify them for the mode line |
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
126 \(e.g., removing the parameter list to just have the function name.)") |
f85f374e5395
(which-func-cleanup-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24649
diff
changeset
|
127 |
20321 | 128 ;;; Code, nothing to customize below here |
129 ;;; ------------------------------------- | |
130 ;;; | |
131 (require 'imenu) | |
132 | |
133 (defvar which-func-current which-func-unknown) | |
134 (defvar which-func-previous which-func-unknown) | |
135 (make-variable-buffer-local 'which-func-current) | |
136 (make-variable-buffer-local 'which-func-previous) | |
137 | |
138 (defvar which-func-mode nil | |
139 "Non-nil means display current function name in mode line. | |
21697 | 140 This makes a difference only if `which-func-mode-global' is non-nil") |
20321 | 141 (make-variable-buffer-local 'which-func-mode) |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
142 ;;(put 'which-func-mode 'permanent-local t) |
20321 | 143 |
144 (add-hook 'find-file-hooks 'which-func-ff-hook t) | |
145 | |
146 (defun which-func-ff-hook () | |
147 "File find hook for Which Function mode. | |
148 It creates the Imenu index for the buffer, if necessary." | |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
149 (setq which-func-mode |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
150 (and which-func-mode-global |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
151 (or (eq which-func-modes t) (member major-mode which-func-modes)))) |
20321 | 152 |
22308
87366acfb1e9
(which-func-ff-hook): If imenu gets error,
Karl Heuer <kwzh@gnu.org>
parents:
22134
diff
changeset
|
153 (condition-case nil |
87366acfb1e9
(which-func-ff-hook): If imenu gets error,
Karl Heuer <kwzh@gnu.org>
parents:
22134
diff
changeset
|
154 (if (and which-func-mode |
87366acfb1e9
(which-func-ff-hook): If imenu gets error,
Karl Heuer <kwzh@gnu.org>
parents:
22134
diff
changeset
|
155 (not (member major-mode which-func-non-auto-modes)) |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
156 (or (null which-func-maxout) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
157 (< buffer-saved-size which-func-maxout) |
22308
87366acfb1e9
(which-func-ff-hook): If imenu gets error,
Karl Heuer <kwzh@gnu.org>
parents:
22134
diff
changeset
|
158 (= which-func-maxout 0))) |
87366acfb1e9
(which-func-ff-hook): If imenu gets error,
Karl Heuer <kwzh@gnu.org>
parents:
22134
diff
changeset
|
159 (setq imenu--index-alist |
87366acfb1e9
(which-func-ff-hook): If imenu gets error,
Karl Heuer <kwzh@gnu.org>
parents:
22134
diff
changeset
|
160 (save-excursion (funcall imenu-create-index-function)))) |
87366acfb1e9
(which-func-ff-hook): If imenu gets error,
Karl Heuer <kwzh@gnu.org>
parents:
22134
diff
changeset
|
161 (error |
87366acfb1e9
(which-func-ff-hook): If imenu gets error,
Karl Heuer <kwzh@gnu.org>
parents:
22134
diff
changeset
|
162 (setq which-func-mode nil)))) |
20321 | 163 |
164 (defun which-func-update () | |
165 ;; Update the string containing the current function. | |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
166 (when which-func-mode |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
167 (condition-case info |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
168 (progn |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
169 (setq which-func-current (or (which-function) which-func-unknown)) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
170 (unless (string= which-func-current which-func-previous) |
20573
b46523ef0e0a
(which-func-update): Fix paren error.
Richard M. Stallman <rms@gnu.org>
parents:
20322
diff
changeset
|
171 (force-mode-line-update) |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
172 (setq which-func-previous which-func-current))) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
173 (error |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
174 (which-func-mode -1) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
175 (error "Error in which-func-update: %s" info))))) |
20321 | 176 |
21960
79c7369b9ab4
(which-function-mode): New alias.
Richard M. Stallman <rms@gnu.org>
parents:
21697
diff
changeset
|
177 ;; This is the name people would normally expect. |
79c7369b9ab4
(which-function-mode): New alias.
Richard M. Stallman <rms@gnu.org>
parents:
21697
diff
changeset
|
178 ;;;###autoload |
79c7369b9ab4
(which-function-mode): New alias.
Richard M. Stallman <rms@gnu.org>
parents:
21697
diff
changeset
|
179 (defalias 'which-function-mode 'which-func-mode) |
79c7369b9ab4
(which-function-mode): New alias.
Richard M. Stallman <rms@gnu.org>
parents:
21697
diff
changeset
|
180 |
21697 | 181 ;;;###autoload |
20321 | 182 (defun which-func-mode (&optional arg) |
183 "Toggle Which Function mode, globally. | |
184 When Which Function mode is enabled, the current function name is | |
185 continuously displayed in the mode line, in certain major modes. | |
186 | |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
187 With prefix ARG, turn Which Function mode on iff arg is positive, |
20321 | 188 and off otherwise." |
189 (interactive "P") | |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
190 (setq which-func-mode-global |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
191 (or (and (null arg) which-func-mode-global) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
192 (<= (prefix-numeric-value arg) 0))) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
193 (if which-func-mode-global |
20321 | 194 ;; Turn it off |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
195 (progn |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
196 (remove-hook 'post-command-idle-hook 'which-func-update) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
197 (dolist (buf (buffer-list)) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
198 (with-current-buffer buf (setq which-func-mode nil)))) |
20321 | 199 ;;Turn it on |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
200 (add-hook 'post-command-idle-hook 'which-func-update) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
201 (dolist (buf (buffer-list)) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
202 (with-current-buffer buf |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
203 (setq which-func-mode |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
204 (or (eq which-func-modes t) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
205 (member major-mode which-func-modes))))))) |
20321 | 206 |
207 (defun which-function () | |
21697 | 208 "Return current function name based on point. |
209 If `imenu--index-alist' does not exist, or is empty or if point | |
20321 | 210 is located before first function, returns nil." |
32190
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
211 (let (name) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
212 ;; First try using imenu support. |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
213 (when (and (boundp 'imenu--index-alist) imenu--index-alist) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
214 (let ((pair (car-safe imenu--index-alist)) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
215 (rest (cdr-safe imenu--index-alist))) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
216 (while (and (or rest pair) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
217 (or (not (number-or-marker-p (cdr pair))) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
218 (> (point) (cdr pair)))) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
219 (setq name (car pair)) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
220 (setq pair (car-safe rest)) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
221 (setq rest (cdr-safe rest))))) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
222 ;; Try using add-log support. |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
223 (when (and (null name) (boundp 'add-log-current-defun-function) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
224 add-log-current-defun-function) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
225 (setq name (funcall add-log-current-defun-function))) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
226 ;; Filter the name if requested. |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
227 (when name |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
228 (if which-func-cleanup-function |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
229 (funcall which-func-cleanup-function name) |
af0c1b2c3d6e
(which-func-format): Remove spurious space.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
25425
diff
changeset
|
230 name)))) |
20321 | 231 |
232 (provide 'which-func) | |
233 | |
234 ;; which-func.el ends here |