GNU bug report logs - #5863
defadvice in byte compiled file does not work

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Thu, 8 Apr 2010 15:27:02 UTC

Severity: minor

Tags: wontfix

Merged with 21683

Found in version 25.0.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>
Subject: defadvice in byte compiled file does not work
Date: Thu, 8 Apr 2010 17:26:26 +0200
I have this in mumamo.el:

  (defvar mumamo-stop-widen nil)
  (defadvice widen (around
                    mumamo-ad-widen
                    activate
                    compile)
    (unless (and mumamo-multi-major-mode
                 mumamo-stop-widen)
      ad-do-it))

I let bind mumamo-stop-widen to avoid widening for certain situations.
This works sometimes and not other times. It looks like the defadvice
is simply skipped the other times (but I am not sure).

It looks like it depends on byte compilation in some way. Or actually
several ways. I have seen instances where it helps to eval the
defadvice and other cases where it does not. If the function calling
(widen) is byte compiled it does not work, but it works if the
function is evaled. However it looks like both these conditions must
be meat.

Beeing able to do something like this is very essential to get multi
major modes working reliably. Is there any remedy for this problem?

If not, could we please add a way to control if (widen) widens the
buffer (or how it does it, but that seems to complicated to me)?





This bug report was last modified 4 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.