GNU bug report logs - #44864
27.1; advice.el: ad-with-originals deprecated, but no advice on replacement

Previous Next

Package: emacs;

Reported by: Julian Gilbey <julian-gnu <at> d-and-j.net>

Date: Wed, 25 Nov 2020 13:10:01 UTC

Severity: normal

Tags: moreinfo, wontfix

Found in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Julian Gilbey <julian-gnu <at> d-and-j.net>
Cc: 44864 <at> debbugs.gnu.org
Subject: bug#44864: 27.1; advice.el: ad-with-originals deprecated, but no advice on replacement
Date: Thu, 26 Nov 2020 10:39:10 -0500
>             ;; Use file's local variables section to set variables in
>             ;; this buffer.  (Don't just copy local variables from the
>             ;; base buffer because it may have set things locally that
>             ;; we don't want in the other modes.)  We need to prevent
>             ;; `mode' being processed and re-setting the major mode.
>             ;; It all goes badly wrong if `hack-one-local-variable' is
>             ;; advised.  The appropriate mechanism to get round this
>             ;; appears to be `ad-with-originals', but we don't want to
>             ;; pull in the advice package unnecessarily.  `flet'-like
>             ;; mechanisms lose with advice because `fset' acts on the
>             ;; advice anyway.
>             (if (featurep 'advice)
>                 (ad-with-originals (hack-one-local-variable)
>                   (multi-hack-local-variables))
>               (multi-hack-local-variables))

The comment doesn't explain why Dave thought that "It all goes badly
wrong if `hack-one-local-variable' is advised", so there's not much we
can do.  AFAIK it will only go wrong with some advice, so he must have
had some particular pieces of advice in mind.

`advice.el` is deprecated anyway, so my recommendation is to remove this
test and just call `multi-hack-local-variables` without paying attention
to any potential advice there.  If/when you bump into a problem with
that, then we'll be able to see what should be done (the best option
might be to change the advice itself).

> But there is no advice on what to do instead.

I think that's because `ad-with-originals` was used on it ;-)


        Stefan





This bug report was last modified 3 years and 275 days ago.

Previous Next


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