Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace old- with new-style advice #1819

Open
wasamasa opened this issue Aug 9, 2023 · 8 comments
Open

Replace old- with new-style advice #1819

wasamasa opened this issue Aug 9, 2023 · 8 comments

Comments

@wasamasa
Copy link
Member

wasamasa commented Aug 9, 2023

Issue type

  • Enhancement request

Further notes

I've come across the deprecation of old-style advice in the upcoming major Emacs release. Accomodating to this will require the following:

  • Bumping the minimum Emacs version from 24.1 to 24.4 (since that's when nadvice.el was introduced)
  • (Optionally) Removing now obsoleted code not needed in Emacs 24.4 or newer
  • Converting old- to new-style advice (seems to have been tackled by Stefan in Various code cleanups #1693 (comment))
@monnier
Copy link
Contributor

monnier commented Aug 21, 2023

Side note: if compatibility with Emacs-24.1 is considered important, it can be preserved (by depending on the nadvice forward-compatibility package available from GNU ELPA).
That's what I have currently on the scratch/evil branch.

@monnier
Copy link
Contributor

monnier commented Nov 25, 2023

I don't personally use Evil, so I haven't really tested my patch. Has someone given it a real test?
Or any feedback about the approach I'm using? Or any other reason why it's not acceptable in its current form, or even in principle?

@axelf4
Copy link
Collaborator

axelf4 commented Nov 25, 2023

I don't personally use Evil, so I haven't really tested my patch. Has someone given it a real test?
Or any feedback about the approach I'm using? Or any other reason why it's not acceptable in its current form, or even in principle?

I took a look back in August, but ran out of time and forgot to report why it could not be outright merged, sorry.

It is mostly good, but broke tests relying on advices currently activated as a side-effect of Evil-mode being loaded, as the tests do not enable evil-mode, only evil-local-mode on a per-buffer basis. There is also more than one user who, likewise, uses evil-local-mode to enable Evil, rather than the methods documented in the manual for selectively disabling Evil in some buffers after enabling evil-mode. So while your patch is closer to the "correct" way of doing things, someone still has to fix the tests.

Is the right thing to enable/disable evil-mode before/after each tests, or does that incur too much overhead? To alleviate that it would have been nice if ERT offered test fixtures to run the setup only once. (Instead the Fixtures and Test Suites section of the ERT misses the point, with patronizing Lisp superiority commentary that has not held true since the 80s.)

@monnier
Copy link
Contributor

monnier commented Nov 25, 2023 via email

@monnier
Copy link
Contributor

monnier commented Nov 25, 2023 via email

@monnier
Copy link
Contributor

monnier commented Dec 24, 2023

Ping?

@monnier
Copy link
Contributor

monnier commented Jan 27, 2024

Pretty please?

@tomdl89
Copy link
Member

tomdl89 commented Jan 27, 2024

Hey @monnier sorry you haven't got a reply on this. @axelf4 are you able to take a look? If not I'll try to find some time in the next few weeks. Unfortunately it's a busy time for me and this one looks like an issue that'd take a bit of time for me to get my head into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants