Hi All,
actually I wanted to fix a bug in add-log.el, but here goes, as so often :-)
Three functions named
to
show up in Function menu for add-log.el because of docstring lines like this:
(defaults to nil),
I suggest changing fume-function-name-regexp-lisp to use a regexp
similar to what imenu uses.
I have added * forms though:
Index: func-menu.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/edit-utils/func-menu.el,v
retrieving revision 1.23
diff -u -u -r1.23 func-menu.el
--- func-menu.el 15 Dec 2002 21:30:27 -0000 1.23
+++ func-menu.el 29 Mar 2003 13:08:27 -0000
@@ -644,7 +644,9 @@
(concat
"^[ \t]*" ; Allow whitespace |(or (fboundp
'foo)
; for the construct | (defun foo ()
- "(\\(def[^vc][a-z]*\\)" ; Allow (def* except (defvar,
(defconst
+ "(\\(def\\(?:un\\*?\\|subst\\*?\\|macro\\*?"
+ "\\|advice\\|type\\|struct"
+ "\\|class\\|ine-condition\\)\\)" ; excluding defvar, defconst, but not
defgroup
"\\s-+" ; At least one whitespace
"'?[#:?%@!*/A-Za-z0-9_+<>-]+" ; Allow (defalias 'foo
'bar)
"\\s-*" ; Whitespace
----------------------------------------------------------------------------
Current implementation is inconsistent:
e.g. defgroup shows up in Function menu, but not defcustom or deftheme.
I would like to get your opinions which of these forms should appear
in a lisp function menu.
Apropos search for: "^def[a-z]+"
* = command (M-x) or user-variable.
a = autoloaded, b = byte-compiled, i = internal, l = lambda, m = macro.
Functions and Macros:
m defadvice - Defines a piece of advice for FUNCTION (a symbol).
defalias - Set SYMBOL's function definition to NEWDEF, and
return NEWDEF.
i defconst - define SYMBOL as a constant
m defcustom - Declare SYMBOL as a customizable variable that
defaults to VALUE.
m defface - Declare FACE as a customizable face that defaults to
SPEC.
m deffoo - The same as `defun', only register FUNC.
m defgroup - Declare SYMBOL as a customization group containing
MEMBERS.
i defmacro - define NAME as a macro.
m defmacro* - define NAME as a macro.
m defsetf - define a `setf' method.
m defstruct - (defstruct (NAME OPTIONS...) (SLOT SLOT-OPTS...)...):
define a struct type.
m defsubst - Define an inline function. The syntax is just like
that of `defun'.
m defsubst* - define NAME as a function.
m deftheme - (deftheme THEME &optional DOC &key KEYWORDS)
m deftype - define NAME as a new data type.
i defun - define NAME as a function.
m defun* - define NAME as a function.
m defun-when-void - Define a function, just like `defun', unless
it's already defined.
i defvar - define SYMBOL as a variable.
i defvaralias - Define a variable as an alias for another variable.
m defvoo - The same as `defvar', only takes list of variables
to MAP to.
----------------------------------------------------------------------------
(defun imenu-example--create-lisp-index ()
in
xemacs-packages\xemacs-base\imenu.el
currently has this:
((looking-at "def\\(var\\|const\\)")
(forward-sexp 2)
(push (imenu-example--name-and-position)
index-var-alist))
((looking-at "def\\(un\\|subst\\|macro\\|advice\\)")
(forward-sexp 2)
(push (imenu-example--name-and-position)
index-alist))
((looking-at "def\\(type\\|struct\\|class\\|ine-condition\\)")
Shouldn't * forms (fun, macro, subst) be added to imenu.el?
Should the regexp be in sync with func-menu?
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/