From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Need help with ad-do-it, it loops Date: Fri, 8 May 2009 12:30:46 +0200 Message-ID: References: <84D8FEFE8D23E94E9C2A6F0C58EE07E302593647@mucmail3.sdm.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1241778692 25509 80.91.229.12 (8 May 2009 10:31:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 May 2009 10:31:32 +0000 (UTC) Cc: emacs-devel@gnu.org To: klaus.berndl@capgemini-sdm.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 08 12:31:24 2009 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.50) id 1M2NMQ-0003Ul-9L for ged-emacs-devel@m.gmane.org; Fri, 08 May 2009 12:31:23 +0200 Original-Received: from localhost ([127.0.0.1]:41322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M2NMP-0002Cz-EG for ged-emacs-devel@m.gmane.org; Fri, 08 May 2009 06:31:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M2NM4-00026Z-Cr for emacs-devel@gnu.org; Fri, 08 May 2009 06:31:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M2NLz-00023M-5B for emacs-devel@gnu.org; Fri, 08 May 2009 06:30:59 -0400 Original-Received: from [199.232.76.173] (port=50647 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M2NLy-000237-OE for emacs-devel@gnu.org; Fri, 08 May 2009 06:30:55 -0400 Original-Received: from mail-fx0-f169.google.com ([209.85.220.169]:43905) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M2NLv-0007GU-02 for emacs-devel@gnu.org; Fri, 08 May 2009 06:30:52 -0400 Original-Received: by fxm17 with SMTP id 17so1370443fxm.42 for ; Fri, 08 May 2009 03:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=urF2F9biBGJxjVadJfhz/XU7znOTb851Z5cPJhZ7lIM=; b=Im53akAXw6PvBDH4hUd+nPdr5o4i/fbaAeTAguefsfJWoXsLv5L9+QQCicd1GLvkNt Z59jBNVcqiOlrw1IGpG8/Cnj3+/Y+hvz8ep6Z8lkMMt/X2wMKDsKeCTFNDk2Q8Rr5M2u 93mE+o1lswb2SphOG2f09VcuITFequzo9bPDk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=sy1enGfql54f0mtfjByGzXVt/fHXQFvZnuCmBaqkmAEXpn65ntCjqr5p4TD0ioYqSu Duz7UrGgliv6ZKO7VDPAVGB38VWEOLZ+HHFhpT9CjHIwk8R98T1yYpkQ3MpBxFFjzJ0i S08GRTPqA97wDfPX6uyou5m4mPumWK3RfSDjg= Original-Received: by 10.103.177.5 with SMTP id e5mr2253539mup.56.1241778646046; Fri, 08 May 2009 03:30:46 -0700 (PDT) In-Reply-To: <84D8FEFE8D23E94E9C2A6F0C58EE07E302593647@mucmail3.sdm.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:110771 Archived-At: Thanks Klaus, yes, ad-return-value should already hold the value from the original function at that point. I will replace it with just ad-do-it and see if it fixes the problem for Debian users. On Fri, May 8, 2009 at 11:01 AM, wrote: > Just an assumption: > > I think that ad-do-it already sets the return argument (must be because o= therwise advices which do jst ad-do-it would not work) and maybe your const= ruction > > (setq ad-return-value ad-do-it) > > causes the loop...at least i never saw such a combination) > > Klaus > > > > -----Urspr=C3=BCngliche Nachricht----- > Von: emacs-devel-bounces+klaus.berndl=3Dsdm.de@gnu.org [mailto:emacs-deve= l-bounces+klaus.berndl=3Dsdm.de@gnu.org] Im Auftrag von Lennart Borgman > Gesendet: Freitag, 8. Mai 2009 00:16 > An: Emacs-Devel devel > Betreff: Need help with ad-do-it, it loops > > I have a strange case of looping in MuMaMo/nXhtml. One user (R=C3=A9mi) h= as this problem on Debian. This happens after starting from "emacs -Q" > and just loading nXhtml and pressing RET in the scratch buffer. The outpu= t from the debugger says > > Debugger entered--Lisp error: (error "Lisp nesting exceeds > `max-lisp-eval-depth'") > =C2=A0ad-Orig-syntax-ppss-flush-cache(192 192) > =C2=A0apply(ad-Orig-syntax-ppss-flush-cache 192 192) > =C2=A0... > =C2=A0ad-Orig-syntax-ppss-flush-cache(192 192) > =C2=A0apply(ad-Orig-syntax-ppss-flush-cache 192 192) > =C2=A0syntax-ppss-flush-cache(192 192) > =C2=A0self-insert-command(1) > =C2=A0newline(nil) > =C2=A0call-interactively(newline nil nil) > > > > When R=C3=A9mi set max-lisp-eval-depth to 100000 it loops a bit different= : > > Debugger entered--Lisp error: (error "Variable binding depth exceeds > max-specpdl-size") > =C2=A0ad-Orig-syntax-ppss-flush-cache(270 270) > =C2=A0apply(ad-Orig-syntax-ppss-flush-cache 270 270) > =C2=A0... > =C2=A0ad-Orig-syntax-ppss-flush-cache(270 270) > =C2=A0apply(ad-Orig-syntax-ppss-flush-cache 270 270) > =C2=A0syntax-ppss-flush-cache(270 270) > =C2=A0self-insert-command(1) > =C2=A0newline(nil) > =C2=A0call-interactively(newline nil nil) > > > > **** I have this defadvise in mumamo.el (in buffer *Scratch* mumamo-multi= -major-mode is nil): > > (defadvice syntax-ppss-flush-cache (around > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mumamo-advice-syntax-pp= ss-flush-cache > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0activate > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0compile > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0) > =C2=A0"Support for mumamo. > See the defadvice for `syntax-ppss' for an explanation." > =C2=A0(if (not mumamo-multi-major-mode) > =C2=A0 =C2=A0 =C2=A0ad-do-it > =C2=A0 =C2=A0(let ((pos (ad-get-arg 0))) > =C2=A0 =C2=A0 =C2=A0(let* ((chunk-at-pos (when (and (boundp 'mumamo-multi= -major-mode) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mumamo-multi-maj= or-mode) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (mumamo-find-chunks pos > "syntax-ppss-flush-cache")))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0(if chunk-at-pos > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((syntax-ppss-last =C2=A0(= overlay-get chunk-at-pos > 'syntax-ppss-last)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (syntax-pp= ss-cache (overlay-get chunk-at-pos > 'syntax-ppss-cache))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq ad-return-value ad-= do-it) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(overlay-put chunk-at-pos= 'syntax-ppss-last syntax-ppss-last) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(overlay-put chunk-at-pos= 'syntax-ppss-cache syntax-ppss-cache)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq ad-return-value ad-do-it)))))) > > > > I can't understand how this can loop. Any suggestions? Am I perhaps using= ad-do-it incorrectly? The manual does not explicitly say it returns the va= lue from the original function, but my understanding is that it does. > > (For more information see https://bugs.launchpad.net/nxhtml/+bug/369800) > > >