unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Bruce Stephens <bruce.stephens@isode.com>
Cc: emacs-devel@gnu.org
Subject: Re: called-interactively-p, cedet, and Emacs 23.1 and earlier
Date: Tue, 27 Apr 2010 09:56:52 -0400	[thread overview]
Message-ID: <jwvaasp57e2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <808w89i1gz.fsf@tiny.isode.net> (Bruce Stephens's message of "Tue, 27 Apr 2010 12:22:52 +0100")

>>> 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	other threads:[~2010-04-27 13:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-24 16:45 called-interactively-p, cedet, and Emacs 23.1 and earlier Eric M. Ludlam
2010-03-24 17:51 ` Stefan Monnier
2010-03-25 14:33   ` Lluís
2010-03-25 23:16   ` Eric M. Ludlam
2010-03-26 15:33     ` Davis Herring
2010-03-26 16:06       ` Eric M. Ludlam
2010-03-27 14:11         ` Eric M. Ludlam
2010-03-27 18:18           ` Stefan Monnier
2010-04-26 15:28             ` Bruce Stephens
2010-04-26 17:58               ` Stefan Monnier
2010-04-26 18:27                 ` Bruce Stephens
2010-04-27  3:08                   ` Stefan Monnier
2010-04-27 11:22                     ` Bruce Stephens
2010-04-27 13:56                       ` Stefan Monnier [this message]
2010-03-24 17:53 ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvaasp57e2.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bruce.stephens@isode.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).