emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Smarter M-x that filters on major-mode


From: Basil L. Contovounesios
Subject: Re: Smarter M-x that filters on major-mode
Date: Sun, 14 Feb 2021 19:01:39 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>
>> Yes, but a lexical-binding cookie makes no difference in Emacs 23,
>> whereas (interactive nil foo-mode) would be an error.
>
> The code you load in Emacs 23 that's written for lexical binding often
> won't work, though.  (I.e., if the code uses closures.)  So it's not
> backwards compatible, just as code that uses "new" macros like
> `with-current-buffer' isn't.

But 'declare' isn't a new macro, and lexical-binding is just a
file-local variable.  I'm not referring to business logic, but Elisp
infrastructure.

> Emacs Lisp develops, and newer versions aren't backwards-compatible.
> That's just how it is.  If you're maintaining code that's out of tree,
> you have to avoid using the newest features.  There's nothing special
> about the new `interactive' signature in that respect.  (And as Stefan K
> shows, if you still want to use it in an in/out-of-tree package, he's
> written a compat macro for that.)

The special thing about the new interactive spec is that, while it
itself is backward incompatible, it has an equivalent
(declare (modes ...)) form that is backward compatible.  So why not push
only the less intrusive and more flexible of the two?

I find that a far more appealing approach than using a compatibility
macro for something as fundamental as a command's interactive spec.

But that's just me,

-- 
Basil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]