💥 Drop Emacs 25.x support

Emacs 26.1 is Doom's new minimum supported version

Closes #2026
This commit is contained in:
Henrik Lissner 2019-11-07 12:49:30 -05:00
parent 9cb535043c
commit 99cd52e70f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
33 changed files with 48 additions and 426 deletions

View file

@ -3,41 +3,6 @@
(require 'cl-lib)
(require 'subr-x)
;; DEPRECATED Polyfills
(unless EMACS26+
(with-no-warnings
;; `kill-current-buffer' was introduced in Emacs 26
(defalias 'kill-current-buffer #'kill-this-buffer)
;; if-let and when-let were moved to (if|when)-let* in Emacs 26+ so we alias
;; them for 25 users.
(defalias 'if-let* #'if-let)
(defalias 'when-let* #'when-let)
;; `mapcan' was introduced in 26.1. `cl-mapcan' isn't a perfect replacement,
;; but it's close enough.
(defalias 'mapcan #'cl-mapcan)
(defun alist-get (key alist &optional default remove testfn)
"Return the value associated with KEY in ALIST.
If KEY is not found in ALIST, return DEFAULT.
Use TESTFN to lookup in the alist if non-nil. Otherwise, use `assq'.
This is a generalized variable suitable for use with `setf'.
When using it to set a value, optional argument REMOVE non-nil
means to remove KEY from ALIST if the new value is `eql' to DEFAULT."
(ignore remove) ;;Silence byte-compiler.
(let ((x (if (not testfn)
(assq key alist)
;; In Emacs<26, `assoc' has no testfn arg, so we have to
;; implement it ourselves
(if testfn
(cl-loop for entry in alist
if (funcall testfn key entry)
return entry)
(assoc key alist)))))
(if x (cdr x) default)))))
;;
;;; Helpers