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

if-let and when-let #3

Closed
akirak opened this issue May 24, 2018 · 6 comments
Closed

if-let and when-let #3

akirak opened this issue May 24, 2018 · 6 comments
Assignees

Comments

@akirak
Copy link
Contributor

akirak commented May 24, 2018

Crazily, if-let and when-let, which were introduced in Emacs 25, have been renamed to if-let* and when-let* respectively in Emacs 26 and the old functions no longer exist in newer versions. Therefore you have to use if-let in Emacs 25 and if-let* in Emacs 26.

A possible workaround is to define aliases:

(eval-and-compile
  (when (version< emacs-version "26")
    (with-no-warnings
      (defalias 'when-let* #'when-let)
      (function-put #'when-let* 'lisp-indent-function 1)
      (defalias 'if-let* #'if-let)
      (function-put #'if-let* 'lisp-indent-function 2))))
@alphapapa
Copy link
Owner

Thanks. This is really annoying. Having every Emacs package that's used these functions since Emacs 25 reimplement these aliases seems like a bad idea, but I guess the choice is to do that or use -when-let and -if-let.

However, isn't it the case that those macros are marked as obsolete, which means they still exist in Emacs 26 but raise warnings upon compilation? If so, we could simply ignore the warnings... :)

@akirak
Copy link
Contributor Author

akirak commented May 24, 2018

Really? Actually, I haven't used Emacs 26 yet, so I might have misunderstood the information. I'm sorry for mis-reporting this issue.

@alphapapa
Copy link
Owner

No, you haven't done anything wrong. I haven't used Emacs 26 yet either, but I see that other projects, like radian-software/el-patch#17, have had to deal with this in the same way. I appreciate your reminding me.

@akirak
Copy link
Contributor Author

akirak commented May 24, 2018

I see. Thanks. I could learn about the compatibility issue. As a Japanese guy, I may tend to say sorry too often.

@alphapapa alphapapa self-assigned this May 26, 2018
@zenspider
Copy link

please close. Seems like emacs 27 has all 4 functions and nothing has been obsoleted.

@akirak akirak closed this as completed Dec 30, 2020
@alphapapa
Copy link
Owner

@zenspider I don't mind if someone follows up on old issues, but since it's not your repo, it would be more polite if you didn't tell others what to do. ;)

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

3 participants