Skip to content

Commit

Permalink
Pacify Emacs 31 compiler warnings
Browse files Browse the repository at this point in the history
when-let* instead of in Emacs 31 deprecated when-let
  • Loading branch information
seagle0128 committed Nov 5, 2024
1 parent 0cec670 commit f518685
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lisp/init-base.el
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
(with-no-warnings
(defun my-list-processes--prettify ()
"Prettify process list."
(when-let ((entries tabulated-list-entries))
(when-let* ((entries tabulated-list-entries))
(setq tabulated-list-entries nil)
(dolist (p (process-list))
(when-let* ((val (cadr (assoc p entries)))
Expand Down
2 changes: 1 addition & 1 deletion lisp/init-edit.el
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
(node-end (treesit-node-end node)))
;; Node fits the region exactly. Try its parent node instead.
(when (and (= (region-beginning) node-start) (= (region-end) node-end))
(when-let ((node (treesit-node-parent node)))
(when-let* ((node (treesit-node-parent node)))
(setq node-start (treesit-node-start node)
node-end (treesit-node-end node))))
(set-mark node-end)
Expand Down
2 changes: 1 addition & 1 deletion lisp/init-elisp.el
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Lisp function does not specify a special indentation."

(let ((orig-point (point)))
(save-excursion
(when-let
(when-let*
((hook (progn (goto-char (point-min)) (symbol-at-point)))
(func (when (and
(or (re-search-forward (format "^Value:?[\s|\n]") nil t)
Expand Down
2 changes: 1 addition & 1 deletion lisp/init-funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ This issue has been addressed in 28."

(defun centaur--load-theme (theme)
"Disable others and enable new THEME."
(when-let ((theme (centaur--theme-name theme)))
(when-let* ((theme (centaur--theme-name theme)))
(mapc #'disable-theme custom-enabled-themes)
(load-theme theme t)))

Expand Down
4 changes: 2 additions & 2 deletions lisp/init-lsp.el
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,8 @@
;; @see https://github.com/emacs-lsp/emacs-ccls/issues/109
(cl-defmethod my-lsp-execute-command
((_server (eql ccls)) (command (eql ccls.xref)) arguments)
(when-let ((xrefs (lsp--locations-to-xref-items
(lsp--send-execute-command (symbol-name command) arguments))))
(when-let* ((xrefs (lsp--locations-to-xref-items
(lsp--send-execute-command (symbol-name command) arguments))))
(xref--show-xrefs xrefs nil)))
(advice-add #'lsp-execute-command :override #'my-lsp-execute-command)))

Expand Down
4 changes: 2 additions & 2 deletions lisp/init-markdown.el
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ mermaid.initialize({
;; mdopen doesn't need credentials, and only support external browsers
(if (executable-find "mdopen")
(setq grip-use-mdopen t)
(when-let ((credential (and (require 'auth-source nil t)
(auth-source-user-and-password "api.github.com"))))
(when-let* ((credential (and (require 'auth-source nil t)
(auth-source-user-and-password "api.github.com"))))
(setq grip-github-user (car credential)
grip-github-password (cadr credential)))))

Expand Down
4 changes: 2 additions & 2 deletions lisp/init-window.el
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@
(when (and ;(called-interactively-p 'interactive)
(not (region-active-p))
popper-open-popup-alist)
(when-let ((window (caar popper-open-popup-alist))
(buffer (cdar popper-open-popup-alist)))
(when-let* ((window (caar popper-open-popup-alist))
(buffer (cdar popper-open-popup-alist)))
(when (and (with-current-buffer buffer
(not (derived-mode-p 'eshell-mode
'shell-mode
Expand Down

0 comments on commit f518685

Please sign in to comment.