emacs-devel
[Top][All Lists]
Advanced

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

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


From: Bill Wohler
Subject: Defining your own defun breaks find-function-search-for-symbol
Date: Fri, 07 Apr 2006 17:02:36 -0700

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:

  Cannot find definition of `mh-letter-fill-column' in library `mh-e.el'

This can be fixed by modifying the find-*-regexp variables as follows:

  (eval-after-load "find-func"
    '(progn
       (setq find-function-regexp
             (replace-regexp-in-string
              "(def\\\\(" "(\\(mh-\\)?def\\(\\(un\\|macro\\)-compat\\|"
              find-function-regexp t t))
       (setq find-variable-regexp
             (replace-regexp-in-string
              "(def" "(\\(mh-\\)?def" find-variable-regexp t t))
       (if (boundp 'find-face-regexp)
           (setq find-face-regexp
                 (replace-regexp-in-string
                  "(def" "(\\(mh-\\)?def" find-face-regexp t t)))))

This code is in mh-e.el (not yet checked in) and works in Emacs 22 and
Emacs 21. Does anyone see any pitfalls of this approach? Can you think
of a better solution to this or the original problem?

p.s. Font-lock is broken for mh-defun-compat and friends too. Pity that
font-lock and find-function didn't share the same regexp for recognizing
a function/variable/face.

-- 
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]