Fix obsolete (when|if)-let messages in Emacs 26

This commit is contained in:
Henrik Lissner 2017-12-10 14:49:52 -05:00
parent e168118243
commit 76a4ae459d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
40 changed files with 110 additions and 103 deletions

View file

@ -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))))

View file

@ -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))

View file

@ -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 ""))

View file

@ -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"))

View file

@ -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))))

View file

@ -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)))

View file

@ -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)))))

View file

@ -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!")))

View file

@ -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)))))