From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Problem advising nreverse. Date: Tue, 15 Dec 2009 16:12:08 -0500 Organization: A noiseless patient Spider Message-ID: References: <87skbg8jww.fsf@galatea.local> <87bpi1n1z7.fsf@galatea.local> <873a3dmvef.fsf@galatea.local> <87pr6hl9s4.fsf@galatea.local> <873a3dknyz.fsf@galatea.local> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1260913350 3457 80.91.229.12 (15 Dec 2009 21:42:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Dec 2009 21:42:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 15 22:42:23 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NKf9y-0001S7-9Y for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Dec 2009 22:42:22 +0100 Original-Received: from localhost ([127.0.0.1]:47168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKf9y-00080J-98 for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Dec 2009 16:42:22 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!barmar.motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-X-Trace: news.eternal-september.org U2FsdGVkX19AjfenMYMxoTgx8j3ye67bweKhyH9WzMl7ccrHU4hul8N8SfuFrBEh69PDz1HtfbrMJ6Fk3yf0qF3EdM1frlBLiMIfNl6uWL0j+F0G7NFbRxEb87oNJIO84TWzUfC+2Ww= Original-X-Complaints-To: abuse@eternal-september.org Original-NNTP-Posting-Date: Tue, 15 Dec 2009 21:12:08 +0000 (UTC) User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) X-Auth-Sender: U2FsdGVkX1/aYSJngQmiAnVkJ3gshT2wgc+cyjxe4Jc= Cancel-Lock: sha1:cIqg6YSnZIAan/AWP5MN4M8JTqE= Original-Xref: news.stanford.edu gnu.emacs.help:175592 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70668 Archived-At: In article , Sergei Organov wrote: > > pjb@informatimago.com (Pascal J. Bourguignon) writes: > > > >> Sergei Organov writes: > >>> I still wonder if it's documented somewhere in some manual when > >>> defadvice doesn't actually work. It seems it is not there in the Elisp > >>> manual, or did I miss it? > >> > >> See: (info "(elisp)Advising Primitives") > > > > Well, but I didn't find even single word there describing cases when > > it does not work to advise a funciton. > > Sorry, my mistake. In fact, this topic does tell about when advice won't > work, but it tells exactly opposite to what actually happens: > > "Calls to the primitive from Lisp code will take note of the advice, but > calls from C code will ignore the advice." > > Now, in my case `nreverse' is called from Lisp code, not from C code, so > according to the manual advice must work, right? And there is no single > word about differences in behavior due to byte-compiling. Byte compiling effectively changes it to a call from C code, because the byte code is a direct reference to the primitive. "Called from Lisp code" means interpreting Lisp source code, since that indirects through the function name, which is where advice is stored. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***