mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-24 03:00:10 +00:00
Use when-let instead of when-let* since it's kept in Emacs 26.1.
This commit is contained in:
parent
ac0372958b
commit
ac186eb7d2
1 changed files with 2 additions and 14 deletions
|
@ -63,18 +63,6 @@
|
||||||
(require 'shrink-path)
|
(require 'shrink-path)
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;; Compatibility
|
|
||||||
;;
|
|
||||||
|
|
||||||
(unless (>= emacs-major-version 26)
|
|
||||||
(with-no-warnings
|
|
||||||
;; if-let and when-let are deprecated in Emacs 26+ in favor of their
|
|
||||||
;; if-let* variants, so we alias them for 25 users.
|
|
||||||
(defalias 'if-let* #'if-let)
|
|
||||||
(defalias 'when-let* #'when-let)))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Variables
|
;; Variables
|
||||||
;;
|
;;
|
||||||
|
@ -307,7 +295,7 @@ Example:
|
||||||
"Set the modeline format. Does nothing if the modeline KEY doesn't exist.
|
"Set the modeline format. Does nothing if the modeline KEY doesn't exist.
|
||||||
|
|
||||||
If DEFAULT is non-nil, set the default mode-line for all buffers."
|
If DEFAULT is non-nil, set the default mode-line for all buffers."
|
||||||
(when-let* ((modeline (doom-modeline key)))
|
(when-let ((modeline (doom-modeline key)))
|
||||||
(setf (if default
|
(setf (if default
|
||||||
(default-value 'mode-line-format)
|
(default-value 'mode-line-format)
|
||||||
(buffer-local-value 'mode-line-format (current-buffer)))
|
(buffer-local-value 'mode-line-format (current-buffer)))
|
||||||
|
@ -375,7 +363,7 @@ If STRICT-P, return nil if no project was found, otherwise return
|
||||||
(defvar doom-modeline-current-window (frame-selected-window))
|
(defvar doom-modeline-current-window (frame-selected-window))
|
||||||
(defun doom-modeline-set-selected-window (&rest _)
|
(defun doom-modeline-set-selected-window (&rest _)
|
||||||
"Set `doom-modeline-current-window' appropriately."
|
"Set `doom-modeline-current-window' appropriately."
|
||||||
(when-let* ((win (frame-selected-window)))
|
(when-let ((win (frame-selected-window)))
|
||||||
(unless (minibuffer-window-active-p win)
|
(unless (minibuffer-window-active-p win)
|
||||||
(setq doom-modeline-current-window win)
|
(setq doom-modeline-current-window win)
|
||||||
(force-mode-line-update))))
|
(force-mode-line-update))))
|
||||||
|
|
Loading…
Reference in a new issue