cider icon indicating copy to clipboard operation
cider copied to clipboard

Address most Emacs 29 warnings

Open vemv opened this issue 6 months ago • 4 comments

Fixes https://github.com/clojure-emacs/cider/issues/3606

Addresses indentation and other warnings.

Sadly we cannot immediately upgrade the CI linting, because:

  • Emacs 29 deprecates lax-plist-* functions
  • The alternative is based on an arity that isn't present in Emacs < 29.

Similarly, xref-go-back deprecates xref-pop-marker-stack, while the former only exists on Emacs 29, so there's no possible fix, AFAIK.

However, a great deal of warnings is now fixed, which should be less noisy to users, and pave the path future refinements.

Cheers - V

vemv avatar Feb 01 '24 20:02 vemv

Similarly, xref-go-back deprecates xref-pop-marker-stack, while the former only exists on Emacs 29, so there's no possible fix, AFAIK.

Normally in such cases I copied stuff from the newer Emacs into cider-compat.el. (not sure if it currently exists) Backporting newer code is the only reasonable solution in such cases IMO.

I noticed that many of the changes are related to thread-first/last and cl-labels? Did they change their indentation settings? Seems like a pretty weird upstream change if so.

bbatsov avatar Feb 01 '24 21:02 bbatsov

I just saw this in the Emacs 29 changelog:

Indentation of 'cl-flet' and 'cl-labels' has changed.
These forms now indent like this:

    (cl-flet ((bla (x)
                (* x x)))
      (bla 42))

This change also affects 'cl-macrolet', 'cl-flet*' and
'cl-symbol-macrolet'.

bbatsov avatar Feb 25 '24 07:02 bbatsov

  • Emacs 29 deprecates lax-plist-* functions
  • The alternative is based on an arity that isn't present in Emacs < 29.

IIUC it's possible to just replace lax-plist-get/put with plist-get/put. plist-get/put got an optional 3rd argument in emacs29+ but with 2 arguments they behave the same as lax-plist-*

(Edit: Not exactly the same but similar. lax-plist-get uses equal for comparison and plist-get uses eq. https://www.gnu.org/software/emacs/manual/html_node/elisp/Plist-Access.html)

Edit2: I was wrong. plist-* fns cannot be used as a direct replacement when the keys are strings. Some alternatives solutions are using compat29.1 lib or replacing all plists to use keywords as keys.

p4v4n avatar Feb 25 '24 09:02 p4v4n

Edit: Not exactly the same but similar. lax-plist-get uses equal for comparison and plist-get uses eq.

It may have been that prevented me from using a direct fix - I recall trying something and see the builds fail for E<29


I'll re-take this PR in March

vemv avatar Feb 25 '24 11:02 vemv