From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: called-interactively-p, cedet, and Emacs 23.1 and earlier Date: Tue, 27 Apr 2010 09:56:52 -0400 Message-ID: References: <4BAA41B0.1020103@siege-engine.com> <4BABEEC0.4030902@siege-engine.com> <60368.130.55.118.19.1269617620.squirrel@webmail.lanl.gov> <4BACDB7A.9090500@siege-engine.com> <4BAE120C.7090709@siege-engine.com> <80pr1mmdx9.fsf@tiny.isode.net> <80hbmynk67.fsf@tiny.isode.net> <808w89i1gz.fsf@tiny.isode.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272378599 9507 80.91.229.12 (27 Apr 2010 14:29:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 27 Apr 2010 14:29:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Bruce Stephens Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 27 16:29:55 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O6lnM-0005Bc-H6 for ged-emacs-devel@m.gmane.org; Tue, 27 Apr 2010 16:29:52 +0200 Original-Received: from localhost ([127.0.0.1]:41640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6lnL-0001Xq-Se for ged-emacs-devel@m.gmane.org; Tue, 27 Apr 2010 10:29:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6lHY-0004MO-S3 for emacs-devel@gnu.org; Tue, 27 Apr 2010 09:57:01 -0400 Original-Received: from [140.186.70.92] (port=39187 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6lHW-0004LB-Au for emacs-devel@gnu.org; Tue, 27 Apr 2010 09:56:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6lHS-0008Ni-B1 for emacs-devel@gnu.org; Tue, 27 Apr 2010 09:56:55 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:7432 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6lHS-0008Nd-7H for emacs-devel@gnu.org; Tue, 27 Apr 2010 09:56:54 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAIOK1kvO+KoL/2dsb2JhbACcTHLAd4UOBIwP X-IronPort-AV: E=Sophos;i="4.52,280,1270440000"; d="scan'208";a="62677611" Original-Received: from 206-248-170-11.dsl.teksavvy.com (HELO pastel.home) ([206.248.170.11]) by ironport2-out.pppoe.ca with ESMTP; 27 Apr 2010 09:56:53 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id F37D37F22; Tue, 27 Apr 2010 09:56:52 -0400 (EDT) In-Reply-To: <808w89i1gz.fsf@tiny.isode.net> (Bruce Stephens's message of "Tue, 27 Apr 2010 12:22:52 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124246 Archived-At: >>> 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