Drop Emacs 26.x support

Emacs 27.x has been the stable version of Emacs for nearly a year, and
introduces a litany of bugfixes, performance, and quality-of-life
improvements that significantly reduce Doom's maintenance burden (like
XDG support, early-init.el, image manipulation without imagemagick, a
native JSON library, harfbuzz support, pdumper, and others).

With so many big changes on Doom's horizon, I like having one less (big)
thing to worry about.

Also reverts bb677cf7a (#5232) as it is no longer needed.
This commit is contained in:
Henrik Lissner 2021-07-06 01:54:32 -04:00
parent ff2d56794e
commit 044a1a5f2b
19 changed files with 58 additions and 326 deletions

View file

@ -40,9 +40,7 @@ all themes. It will apply to all themes once they are loaded."
(when (or (get 'doom-theme 'previous-themes)
(null doom-theme))
(funcall #',fn))
;; TODO Append to `doom-load-theme-hook' with DEPTH instead when Emacs
;; 26.x support is dropped.
(add-hook 'doom-customize-theme-hook #',fn 'append))))
(add-hook 'doom-customize-theme-hook #',fn 100))))
;;;###autoload
(defmacro custom-set-faces! (&rest specs)

View file

@ -54,11 +54,9 @@ in."
(warn! "Emacs %s detected" emacs-version)
(explain! "Doom supports this version, but you are living on the edge! "
"Be prepared for breakages in future versions of Emacs."))
((= emacs-major-version 26)
(warn! "Emacs %s detected" emacs-version)
(explain! "Doom is dropping Emacs 26.x support in June 2021. Consider "
"upgrading to Emacs 27.1 (or better: 27.2) soon!"
emacs-version))))
((< emacs-major-version 27)
(error! "Emacs %s detected, Doom only supports 27.1 and newer"
emacs-version))))
(print! (start "Checking for Doom's prerequisites..."))
(print-group!

View file

@ -625,72 +625,7 @@ testing advice (when combined with `rotate-text').
;;
;;; Backports
(eval-when! (version< emacs-version "27.0.90")
;; DEPRECATED Backported from Emacs 27
(defmacro setq-local (&rest pairs)
"Make variables in PAIRS buffer-local and assign them the corresponding values.
PAIRS is a list of variable/value pairs. For each variable, make
it buffer-local and assign it the corresponding value. The
variables are literal symbols and should not be quoted.
The second VALUE is not computed until after the first VARIABLE
is set, and so on; each VALUE can use the new value of variables
set earlier in the setq-local. The return value of the
setq-local form is the value of the last VALUE.
\(fn [VARIABLE VALUE]...)"
(declare (debug setq))
(unless (zerop (mod (length pairs) 2))
(error "PAIRS must have an even number of variable/value members"))
(let ((expr nil))
(while pairs
(unless (symbolp (car pairs))
(error "Attempting to set a non-symbol: %s" (car pairs)))
;; Can't use backquote here, it's too early in the bootstrap.
(setq expr
(cons
(list 'set
(list 'make-local-variable (list 'quote (car pairs)))
(car (cdr pairs)))
expr))
(setq pairs (cdr (cdr pairs))))
(macroexp-progn (nreverse expr)))))
(eval-when! (version< emacs-version "27.1")
;; DEPRECATED Backported from Emacs 27. Remove when 26.x support is dropped.
(defun executable-find (command &optional remote)
"Search for COMMAND in `exec-path' and return the absolute file name.
Return nil if COMMAND is not found anywhere in `exec-path'. If
REMOTE is non-nil, search on the remote host indicated by
`default-directory' instead."
(if (and remote (file-remote-p default-directory))
(let ((res (locate-file
command
(mapcar
(lambda (x) (concat (file-remote-p default-directory) x))
(exec-path))
exec-suffixes 'file-executable-p)))
(when (stringp res) (file-local-name res)))
;; Use 1 rather than file-executable-p to better match the
;; behavior of call-process.
(let ((default-directory
(let (file-name-handler-alist)
(file-name-quote default-directory))))
(locate-file command exec-path exec-suffixes 1)))))
(eval-when! (not (fboundp 'exec-path))
;; DEPRECATED Backported from Emacs 27.1. Remove when 26.x support is dropped.
(defun exec-path ()
"Return list of directories to search programs to run in remote subprocesses.
The remote host is identified by `default-directory'. For remote
hosts that do not support subprocesses, this returns `nil'.
If `default-directory' is a local directory, this function returns
the value of the variable `exec-path'."
(let ((handler (find-file-name-handler default-directory 'exec-path)))
(if handler
(funcall handler 'exec-path)
exec-path))))
;; None at the moment!
(provide 'core-lib)
;;; core-lib.el ends here

View file

@ -667,16 +667,17 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(dolist (fn '(switch-to-buffer display-buffer))
(advice-add fn :around #'doom-run-switch-buffer-hooks-a)))
;; Apply `doom-font' et co
(add-hook 'doom-after-init-modules-hook #'doom-init-fonts-h -100)
;; Apply `doom-theme'
(add-hook (if (daemonp)
'after-make-frame-functions
'doom-after-init-modules-hook)
#'doom-init-theme-h)
#'doom-init-theme-h
-90)
;; Apply `doom-font' et co
(add-hook 'doom-after-init-modules-hook #'doom-init-fonts-h)
(add-hook 'window-setup-hook #'doom-init-ui-h 'append)
(add-hook 'window-setup-hook #'doom-init-ui-h 100)
;;
@ -702,25 +703,11 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(fset 'define-fringe-bitmap #'ignore))
(after! whitespace
(defun doom-disable-whitespace-mode-in-childframes-a (orig-fn)
(defun doom-is-childframes-p ()
"`whitespace-mode' inundates child frames with whitespace markers, so
disable it to fix all that visual noise."
(unless (frame-parameter nil 'parent-frame)
(funcall orig-fn)))
(add-function :around whitespace-enable-predicate #'doom-disable-whitespace-mode-in-childframes-a))
;; Don't display messages in the minibuffer when using the minibuffer
;; DEPRECATED Remove when Emacs 26.x support is dropped.
(eval-when! (not EMACS27+)
(defmacro doom-silence-motion-key (command key)
(let ((key-command (intern (format "doom/silent-%s" command))))
`(progn
(defun ,key-command ()
(interactive)
(ignore-errors (call-interactively ',command)))
(define-key minibuffer-local-map (kbd ,key) #',key-command))))
(doom-silence-motion-key backward-delete-char "<backspace>")
(doom-silence-motion-key delete-char "<delete>"))
(frame-parameter nil 'parent-frame))
(add-function :before-while whitespace-enable-predicate #'doom-is-childframes-p))
(provide 'core-ui)
;;; core-ui.el ends here

View file

@ -355,7 +355,6 @@ config.el instead."
(when (boundp 'libgnutls-version)
(concat "SECURE128:+SECURE192:-VERS-ALL"
(if (and (not IS-WINDOWS)
(not (version< emacs-version "26.3"))
(>= libgnutls-version 30605))
":+VERS-TLS1.3")
":+VERS-TLS1.2"))

View file

@ -37,8 +37,6 @@
(package! helpful :pin "7e4b1f0d5572a4e2b8ee7a9b084ef863d0315a73")
(package! pcre2el :pin "0b5b2a2c173aab3fd14aac6cf5e90ad3bf58fa7d")
(package! smartparens :pin "911cc896a0f2eb8b5fbdd6fc8331523ad9889a3a")
;; DEPRECATED Built into Emacs 27+; remove when we drop 26 support
(package! so-long :built-in 'prefer :pin "1da43ed63b5f9a8188eb8107bbad842d10831537")
(package! ws-butler
;; Use my fork of ws-butler, which has a few choice improvements and
;; optimizations (the original has been abandoned).