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

Package Requires is actually 26.1 #1

Open
JalapenoGremlin opened this issue Apr 19, 2019 · 3 comments
Open

Package Requires is actually 26.1 #1

JalapenoGremlin opened this issue Apr 19, 2019 · 3 comments

Comments

@JalapenoGremlin
Copy link

Emacs authors decided to completely remove when-let and if-let in 26.1, and replaced them with when-let* and if-let* from subr-x.el

  • Prior to emacs 26.1
    • there was no when-let* , if-let*.
    • but there was when-let and if-let
  • In 26.1 and later
    • there is when-let*, if-let*
    • but there is no when-let, if-let

IMHO, this was sort of a silly, poorly thought-out obsolescence on the emacs hackers part, but thought you'd like to know.

They must have had their reasons. Maybe this thread will tell us why: https://lists.gnu.org/archive/html/emacs-devel/2018-03/msg00052.html

I didn't have an opportunity to read the entire thread.

You probably use an emacs version >= 26.1 for development.

Maybe an alias would work for the when-let*?

I quickly threw this together, but don't know how correct it is. It's not tested...

(require 'subr-x)

(when (or (< emacs-major-version 26)
          (and (= emacs-major-version 26) (< emacs-minor-version 1)))
  ;; `when-let' was summarily replaced with `when-let*' in emacs 26.1
  ;; with no define-obsolete-function-alias  so other developers are forced to use when-let*
  ;; leaving users of older emacs versions in a lurch.
  (defalias 'when-let* 'when-let ))

The other option is just to increase the ;; Package-Requires to ((emacs "26.1"))

@ikirill
Copy link
Owner

ikirill commented Apr 19, 2019

The version requirement is definitely wrong. I think it's kind of confusing: it looks like it got de-obsoleted in this commit: emacs-mirror/emacs@441fe20 I'm used to the usual relationship between let and let* forms, but it seems that when-let always meant the same thing as when-let*.

@ikirill
Copy link
Owner

ikirill commented Apr 19, 2019

4453c03

@JalapenoGremlin
Copy link
Author

JalapenoGremlin commented Apr 28, 2019

Yeah the "history of if-let/if-let*, when-let/when-let* is very odd.

I think since you changed to using when-let, you don't also need to rev the minimum emacs-version required.
edit: never mind. I don't know when the "first iteration" of when-let entered emacs, so the emacs version is also probably correct.

I will, of course, leave it up to you. Thanks for the addition to the cmake-mode.

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

2 participants