unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Julian Gilbey <julian-gnu@d-and-j.net>
Cc: 44864@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	[thread overview]
Message-ID: <jwvv9ds9lre.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1khqf4-00B8ID-Jc@erdos.d-and-j.net> (Julian Gilbey's message of "Wed, 25 Nov 2020 09:00:26 +0000")

>             ;; 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






  parent reply	other threads:[~2020-11-26 15:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  9:00 bug#44864: 27.1; advice.el: ad-with-originals deprecated, but no advice on replacement Julian Gilbey
2020-11-26 10:45 ` Lars Ingebrigtsen
2020-11-26 15:39 ` Stefan Monnier [this message]
2020-11-26 17:09   ` Julian Gilbey
2020-11-26 17:54     ` Stefan Monnier
2021-08-27 15:36       ` Lars Ingebrigtsen
2021-09-13 15:29         ` Julian Gilbey
2021-10-14 15:11 ` Lars Ingebrigtsen
2021-10-14 15:43   ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvv9ds9lre.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=44864@debbugs.gnu.org \
    --cc=julian-gnu@d-and-j.net \
    /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 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).