all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: <klaus.berndl@capgemini-sdm.com>
To: <lennart.borgman@gmail.com>, <emacs-devel@gnu.org>
Subject: AW: Need help with ad-do-it, it loops
Date: Fri, 8 May 2009 11:01:42 +0200	[thread overview]
Message-ID: <84D8FEFE8D23E94E9C2A6F0C58EE07E302593647@mucmail3.sdm.de> (raw)
In-Reply-To: <e01d8a50905071515h4a5cdde1q3d9fa5721fd7e94a@mail.gmail.com>

Just an assumption:

I think that ad-do-it already sets the return argument (must be because otherwise advices which do jst ad-do-it would not work) and maybe your construction

(setq ad-return-value ad-do-it)

causes the loop...at least i never saw such a combination)

Klaus



-----Ursprüngliche Nachricht-----
Von: emacs-devel-bounces+klaus.berndl=sdm.de@gnu.org [mailto:emacs-devel-bounces+klaus.berndl=sdm.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émi) has this problem on Debian. This happens after starting from "emacs -Q"
and just loading nXhtml and pressing RET in the scratch buffer. The output from the debugger says

Debugger entered--Lisp error: (error "Lisp nesting exceeds
`max-lisp-eval-depth'")
  ad-Orig-syntax-ppss-flush-cache(192 192)
  apply(ad-Orig-syntax-ppss-flush-cache 192 192)
  ...
  ad-Orig-syntax-ppss-flush-cache(192 192)
  apply(ad-Orig-syntax-ppss-flush-cache 192 192)
  syntax-ppss-flush-cache(192 192)
  self-insert-command(1)
  newline(nil)
  call-interactively(newline nil nil)



When Rémi set max-lisp-eval-depth to 100000 it loops a bit different:

Debugger entered--Lisp error: (error "Variable binding depth exceeds
max-specpdl-size")
  ad-Orig-syntax-ppss-flush-cache(270 270)
  apply(ad-Orig-syntax-ppss-flush-cache 270 270)
  ...
  ad-Orig-syntax-ppss-flush-cache(270 270)
  apply(ad-Orig-syntax-ppss-flush-cache 270 270)
  syntax-ppss-flush-cache(270 270)
  self-insert-command(1)
  newline(nil)
  call-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
                                    mumamo-advice-syntax-ppss-flush-cache
                                    activate
                                    compile
                                    )
  "Support for mumamo.
See the defadvice for `syntax-ppss' for an explanation."
  (if (not mumamo-multi-major-mode)
      ad-do-it
    (let ((pos (ad-get-arg 0)))
      (let* ((chunk-at-pos (when (and (boundp 'mumamo-multi-major-mode)
                                      mumamo-multi-major-mode)
                             (mumamo-find-chunks pos
"syntax-ppss-flush-cache"))))
        (if chunk-at-pos
            (let* ((syntax-ppss-last  (overlay-get chunk-at-pos
'syntax-ppss-last))
                   (syntax-ppss-cache (overlay-get chunk-at-pos
'syntax-ppss-cache)))
              (setq ad-return-value ad-do-it)
              (overlay-put chunk-at-pos 'syntax-ppss-last syntax-ppss-last)
              (overlay-put chunk-at-pos 'syntax-ppss-cache syntax-ppss-cache))
          (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 value from the original function, but my understanding is that it does.

(For more information see https://bugs.launchpad.net/nxhtml/+bug/369800)






  reply	other threads:[~2009-05-08  9:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-07 22:15 Need help with ad-do-it, it loops Lennart Borgman
2009-05-08  9:01 ` klaus.berndl [this message]
2009-05-08 10:30   ` Lennart Borgman
2009-05-08 13:26 ` Stefan Monnier
2009-05-08 16:28   ` Lennart Borgman
2009-05-08 19:30     ` Stefan Monnier
2009-05-08 20:13       ` Lennart Borgman
2009-05-08 21:22         ` Lennart Borgman
2009-05-09 10:53           ` Lennart Borgman
2009-05-09 17:06             ` Sven Joachim
2009-05-09 17:26               ` Lennart Borgman
     [not found]             ` <e01d8a50905090405x2f1a5dc8s64d05cda7fc51366@mail.gmail.com>
     [not found]               ` <87iqk9oq03.fsf@elegiac.orebokech.com>
2009-05-11  6:38                 ` Lennart Borgman
2009-05-11 14:51                   ` Romain Francoise
2009-05-11 15:14                     ` Lennart Borgman

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

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

  git send-email \
    --in-reply-to=84D8FEFE8D23E94E9C2A6F0C58EE07E302593647@mucmail3.sdm.de \
    --to=klaus.berndl@capgemini-sdm.com \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.