ikirill / eldoc-cmake

Eldoc support for CMake
GNU General Public License v3.0
6 stars 1 forks source link

Package Requires is actually 26.1 #1

Open JalapenoGremlin opened 5 years ago

JalapenoGremlin commented 5 years ago

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

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 commented 5 years ago

The version requirement is definitely wrong. I think it's kind of confusing: it looks like it got de-obsoleted in this commit: https://github.com/emacs-mirror/emacs/commit/441fe201ea129709ac9807b9b6b30caa45bbd293 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 commented 5 years ago

https://github.com/ikirill/eldoc-cmake/commit/4453c03b5c95ff32842f13db2fc317fb0fe2f79e

JalapenoGremlin commented 5 years ago

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.