help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem advising nreverse.


From: Sergei Organov
Subject: Problem advising nreverse.
Date: Fri, 11 Dec 2009 16:22:16 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Hello,

It seems that an advice set for `nreverse' function fails to be called
when `nreverse' is called from a byte compiled function:

(let ((calls))
  (defun test (problem)
    (setq calls (concat calls "["))
    (defun foo () (nreverse '()))
    (and problem (byte-compile 'foo))
    (defadvice nreverse (before nrev-adv activate)
      (setq calls (concat calls "nrev-adv")))
    (foo)
    (ad-unadvise 'nreverse)
    (setq calls (concat calls "]")))
  (test t) (test nil) (test t)
  calls)

Evaluating this gives me (in either GNU Emacs 22.2.1 or GNU Emacs 23.1.1):

"[][nrev-adv][]"

Is it bug or feature? What's going on here? 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]