unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* trunk defadvice doesn't preserve original function
@ 2007-10-22  3:02 Katsumi Yamaoka
  2007-10-23  6:06 ` Katsumi Yamaoka
  0 siblings, 1 reply; 3+ messages in thread
From: Katsumi Yamaoka @ 2007-10-22  3:02 UTC (permalink / raw)
  To: emacs-devel

Hi,

Performing (defadvice foo ...) twice breaks `foo' if bytecomp
has been loaded.  You can reproduce this with `emacs -Q' as
follows:

(require 'bytecomp)

(defun foo ()
  "foo")

(symbol-function 'foo)
 => (lambda nil "foo")

(defadvice foo (around testing activate)
  (setq ad-return-value (concat ad-do-it "+bar")))

(symbol-function 'foo)
 => #[nil "\301^X\302 \211^P\303P\211^P)\207"
      [ad-return-value nil ad-Orig-foo "+bar"]
      3 #("Advice doc string" 0 17 (ad-advice-info foo))]
(symbol-function 'ad-Orig-foo)
 => (lambda nil "foo")

(defadvice foo (around testing activate)
  (setq ad-return-value (concat ad-do-it "+bar")))

(symbol-function 'foo)
 => #[nil "\301^X\302 \211^P\303P\211^P)\207"
      [ad-return-value nil ad-Orig-foo "+bar"]
      3 #("Advice doc string" 0 17 (ad-advice-info foo))]
(symbol-function 'ad-Orig-foo)
 => #[nil "\301^X\302 \211^P\303P\211^P)\207"
      [ad-return-value nil ad-Orig-foo "+bar"]
      3 #("Advice doc string" 0 17 (ad-advice-info foo))]

That is, `ad-Orig-foo' calls `ad-Orig-foo' itself.  Because of
this, re-loading ~/.emacs file containing defadvice forms causes
the ``Lisp nesting exceeds `max-lisp-eval-depth'' error.

I don't know what's going on in the trunk but Unicode-2 has no
such problem.

Regards,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-23  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-22  3:02 trunk defadvice doesn't preserve original function Katsumi Yamaoka
2007-10-23  6:06 ` Katsumi Yamaoka
2007-10-23  8:24   ` Juanma Barranquero

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).