emacs-devel
[Top][All Lists]
Advanced

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

Re: called-interactively-p, cedet, and Emacs 23.1 and earlier


From: Stefan Monnier
Subject: Re: called-interactively-p, cedet, and Emacs 23.1 and earlier
Date: Tue, 27 Apr 2010 09:56:52 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>>> I don't know.  Compatibility, maybe?  Or maybe just uniformity, since
>>> the same file also has defadvice for narrow-to-defun, mark-defun,
>>> c-mark-function, add-log-current-defun, insert-register,
>>> jump-to-register, not all of which have hooks, I guess.
>> beginning/end-of-defun-function should cover narrow-to-defun and
>> mark-defun.  add-log-current-defun has a similar hook variable.
>> For the rest I don't know what would be needed.  But in any case, any
>> defadvice should be justified by a "request for feature".
> However, that kind of option didn't (and doesn't) really apply to code
> intended to run on a variety of versions.  Concretely, it doesn't work
> for Emacs 23.1, and using defadvice seems reasonable.

Of course.  My point is that when people encounter a problem that
requires a workaround, they should also send a bug-report about it.

> But it doesn't seem to work properly: "cedet-called-interactively-p is a
> Lisp macro.", but I get errors: "beginning-of-defun: Invalid function:
> cedet-called-interactively-p".

> So, is it the case that it's unsafe using macros in the body of advice,
> or is this indicating that the macro wasn't defined when defadvice was
> called, or activated?

It's a sure sign that this part of the code was byte-compiled at a time
the macro was not defined.

> If one or other of the latter, how could I tell?

You could add a dummy macro-call to a macro of yours that does something
like call the debugger.  Make sure this macro is always defined and then
watch to see when the code gets byte-compiled.


        Stefan




reply via email to

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