emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defining your own defun breaks find-function-search-for-symbol


From: Bill Wohler
Subject: Re: Defining your own defun breaks find-function-search-for-symbol
Date: Sun, 09 Apr 2006 17:06:52 -0700

Richard Stallman <address@hidden> wrote:

>     We've (the MH-E team) developed mh-defun-compat (and mh-defmacro-compat)
>     to provide either an alias or a definition to a function depending on
>     the availability of the function. I've also created functions like
>     mh-defcustom to strip :package-version from the option definition on
>     systems that do not support it.
> 
>     The problem is that if perform describe-function or describe-variable on
>     the functions and variables that these functions define, and then click
>     on the file in which they are defined, you get an error:
> 
> If you rename your macro to defun-mh-compat, does that fix the problem?

No, but defunmhcompat works. I think that's a bug in
find-function-regexp which uses \\w+ after "def". In contract,
find-variable-regexp uses \\(\\w\\|\\s_\\)+ so that renaming
mh-defcustom to defcustom-mh would work. Any objections if I substitute
\\(\\w\\|\\s_\\)+ for \\w+ in find-function-regexp?

However, would we want to rename the functions in this manner? It would
go against the namespace convention.

Another option would be to add another %s escape to the find-*-regexp
variables which would be used for the package of the symbol like this:

  ...\\(%s-\\)?def...

For example, when looking up mh-assoc-string, a definition with
mh-defun-compat would be considered. The advantage of this is that it
would work with any package. A disadvantage is this would break user's
settings of this option.

To summarize, we have three proposed solutions:

1. Add MH-E-specific patterns to the regexp in mh-e.el.

2. Rename the functions to match the existing patterns.

3. Add an escape for the package name to the patterns.

Please let me know which one you prefer.

-- 
Bill Wohler <address@hidden>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]