summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-08-29 19:05:44 +0000
committerRichard M. Stallman <rms@gnu.org>1999-08-29 19:05:44 +0000
commit1e68f8d0fe1c31c52e1573398d51ff17f7b282d5 (patch)
treea8b71e4f8ef7c254d198da6f3e7a1074c42cd9b9 /lisp
parent848e837103d40ba1bbcefa500fa000f6f4c9364a (diff)
downloademacs-1e68f8d0fe1c31c52e1573398d51ff17f7b282d5.tar.gz
(which-func-cleanup-function): New variable.
(which-function): Call that function.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/which-func.el16
1 files changed, 15 insertions, 1 deletions
diff --git a/lisp/which-func.el b/lisp/which-func.el
index cd63bf8932a..2be6ffda67d 100644
--- a/lisp/which-func.el
+++ b/lisp/which-func.el
@@ -113,6 +113,17 @@ use either \\[customize] or the function `which-func-mode'."
:group 'which-func
:require 'which-func)
+(defvar which-func-cleanup-function nil
+ "Function to transform a string before displaying it in the mode line.
+The function is called with one argument, the string to display.
+Its return value is displayed in the modeline.
+If nil, no function is called. The default value is nil.
+
+This feature can be useful if Imenu is set up to make more
+detailed entries (e.g., containing the argument list of a function),
+and you want to simplify them for the mode line
+\(e.g., removing the parameter list to just have the function name.)")
+
;;; Code, nothing to customize below here
;;; -------------------------------------
;;;
@@ -211,7 +222,10 @@ is located before first function, returns nil."
(setq name (car pair))
(setq pair (car-safe rest))
(setq rest (cdr-safe rest)))
- name)))
+ (and name
+ (if which-func-cleanup-function
+ (funcall which-func-cleanup-function name)
+ name)))))
(provide 'which-func)