Fix obsolete (when|if)-let messages in Emacs 26
This commit is contained in:
parent
e168118243
commit
76a4ae459d
40 changed files with 110 additions and 103 deletions
|
@ -13,7 +13,7 @@
|
|||
"Evaluate a region between BEG and END and display the output."
|
||||
(interactive "r")
|
||||
(let ((load-file-name buffer-file-name))
|
||||
(if-let (runner (cdr (assq major-mode +eval-runners)))
|
||||
(if-let* ((runner (cdr (assq major-mode +eval-runners))))
|
||||
(funcall runner beg end)
|
||||
(quickrun-region beg end))))
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
(or (eq (current-buffer) +eval-repl-buffer)
|
||||
(progn
|
||||
(if (and +eval-repl-buffer (buffer-live-p +eval-repl-buffer))
|
||||
(if-let (win (get-buffer-window +eval-repl-buffer))
|
||||
(if-let* ((win (get-buffer-window +eval-repl-buffer)))
|
||||
(select-window win)
|
||||
(doom-popup-buffer +eval-repl-buffer))
|
||||
(when command
|
||||
|
@ -29,7 +29,7 @@
|
|||
"Opens (or reopens) the REPL associated with the current major-mode and place
|
||||
the cursor at the prompt."
|
||||
(interactive)
|
||||
(when-let (command (cdr (assq major-mode +eval-repls)))
|
||||
(when-let* ((command (cdr (assq major-mode +eval-repls))))
|
||||
(when (+eval--ensure-in-repl-buffer command)
|
||||
(when (bound-and-true-p evil-mode)
|
||||
(call-interactively #'evil-append-line))
|
||||
|
|
|
@ -74,7 +74,7 @@ function that creates and returns the REPL buffer."
|
|||
|
||||
(defun +eval*quickrun-auto-close (&rest _)
|
||||
"Allows us to silently re-run quickrun from within the quickrun buffer."
|
||||
(when-let (win (get-buffer-window quickrun--buffer-name))
|
||||
(when-let* ((win (get-buffer-window quickrun--buffer-name)))
|
||||
(let ((inhibit-message t))
|
||||
(quickrun--kill-running-process)
|
||||
(message ""))
|
||||
|
|
|
@ -77,7 +77,7 @@ overwrite the destination file if it exists, without confirmation."
|
|||
(pcase (catch 'status
|
||||
(let ((old-path (buffer-file-name))
|
||||
(new-path (expand-file-name new-path)))
|
||||
(when-let (dest (+evil--copy-file old-path new-path force-p))
|
||||
(when-let* ((dest (+evil--copy-file old-path new-path force-p)))
|
||||
(delete-file old-path)
|
||||
(kill-this-buffer)
|
||||
(find-file new-path)
|
||||
|
@ -95,7 +95,7 @@ overwrite the destination file if it exists, without confirmation."
|
|||
:repeat nil
|
||||
(interactive "<f><!>")
|
||||
(pcase (catch 'status
|
||||
(when-let (dest (+evil--copy-file (buffer-file-name) new-path force-p))
|
||||
(when-let* ((dest (+evil--copy-file (buffer-file-name) new-path force-p)))
|
||||
(message "File successfully copied to %s" dest)))
|
||||
('overwrite-self (error "Cannot overwrite self"))
|
||||
('aborted (message "Aborted"))
|
||||
|
|
|
@ -180,11 +180,11 @@ across windows."
|
|||
(evil-embrace-enable-evil-surround-integration)
|
||||
|
||||
(defun +evil--embrace-get-pair (char)
|
||||
(if-let (pair (cdr-safe (assoc (string-to-char char) evil-surround-pairs-alist)))
|
||||
(if-let* ((pair (cdr-safe (assoc (string-to-char char) evil-surround-pairs-alist))))
|
||||
pair
|
||||
(if-let (pair (assoc-default char embrace--pairs-list))
|
||||
(if-let (real-pair (and (functionp (embrace-pair-struct-read-function pair))
|
||||
(funcall (embrace-pair-struct-read-function pair))))
|
||||
(if-let* ((pair (assoc-default char embrace--pairs-list)))
|
||||
(if-let* ((real-pair (and (functionp (embrace-pair-struct-read-function pair))
|
||||
(funcall (embrace-pair-struct-read-function pair)))))
|
||||
real-pair
|
||||
(cons (embrace-pair-struct-left pair) (embrace-pair-struct-right pair)))
|
||||
(cons char char))))
|
||||
|
|
|
@ -70,8 +70,8 @@ properties:
|
|||
(defun +jump|init ()
|
||||
"Initialize `+jump-current-functions', used by `+jump/definition',
|
||||
`+jump/references' and `+jump/documentation'."
|
||||
(when-let (plist (cdr (assq major-mode +jump-function-alist)))
|
||||
(when-let (backend (plist-get plist :xref-backend))
|
||||
(when-let* ((plist (cdr (assq major-mode +jump-function-alist))))
|
||||
(when-let* ((backend (plist-get plist :xref-backend)))
|
||||
(make-variable-buffer-local 'xref-backend-functions)
|
||||
(cl-pushnew backend xref-backend-functions :test #'eq))
|
||||
(setq-local +jump-current-functions plist)))
|
||||
|
|
|
@ -11,7 +11,7 @@ and switches to insert mode if there are editable fields."
|
|||
(cl-letf (((symbol-function 'region-beginning) (lambda () evil-visual-beginning))
|
||||
((symbol-function 'region-end) (lambda () evil-visual-end)))
|
||||
(yas-insert-snippet))
|
||||
(when-let (snippet (car-safe (yas-active-snippets)))
|
||||
(when-let* ((snippet (car-safe (yas-active-snippets))))
|
||||
(let ((fields (yas--snippet-fields snippet)))
|
||||
(evil-insert-state +1)
|
||||
(unless fields (evil-change-state 'normal)))))
|
||||
|
|
|
@ -27,7 +27,7 @@ repository root."
|
|||
(defun +vcs/git-browse-issues ()
|
||||
"Open the github issues page for current repo."
|
||||
(interactive)
|
||||
(if-let (root (+vcs-root))
|
||||
(if-let* ((root (+vcs-root)))
|
||||
(browse-url (concat root "/issues"))
|
||||
(user-error "No git root found!")))
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
;;;###autoload
|
||||
(defun +workspace-get (name &optional noerror)
|
||||
"Returns a workspace (perspective hash table) named NAME."
|
||||
(when-let (persp (persp-get-by-name name))
|
||||
(when-let* ((persp (persp-get-by-name name)))
|
||||
(cond ((+workspace-p persp) persp)
|
||||
((not noerror) (error "'%s' is an invalid workspace" name)))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue