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

@ -41,8 +41,8 @@ module to be loaded."
(user-error ":feature workspaces is required, but disabled"))
(unless (+workspace-get "eshell" t)
(+workspace/new "eshell"))
(if-let (buf (cl-find-if (lambda (it) (string-match-p "^\\*doom:eshell" (buffer-name (window-buffer it))))
(doom-visible-windows)))
(if-let* ((buf (cl-find-if (lambda (it) (string-match-p "^\\*doom:eshell" (buffer-name (window-buffer it))))
(doom-visible-windows))))
(select-window (get-buffer-window buf))
(+eshell/open))
(doom/workspace-display)

View file

@ -4,7 +4,7 @@
(defun +gist/open-current ()
(interactive)
(gist-fetch-current)
(when-let (win (get-buffer-window "*github:gists*"))
(when-let* ((win (get-buffer-window "*github:gists*")))
(doom/popup-close win)))
;;;###autoload

View file

@ -21,7 +21,7 @@
(defun +neotree/collapse-or-up ()
"Collapse an expanded directory node or go to the parent node."
(interactive)
(when-let (node (neo-buffer--get-filename-current-line))
(when-let* ((node (neo-buffer--get-filename-current-line)))
(if (file-directory-p node)
(if (neo-buffer--expanded-node-p node)
(+neotree/collapse)
@ -32,7 +32,7 @@
(defun +neotree/collapse ()
"Collapse a neotree node."
(interactive)
(when-let (node (neo-buffer--get-filename-current-line))
(when-let* ((node (neo-buffer--get-filename-current-line)))
(when (file-directory-p node)
(neo-buffer--set-expand node nil)
(neo-buffer--refresh t))
@ -43,7 +43,7 @@
(defun +neotree/expand-or-open ()
"Expand or open a neotree node."
(interactive)
(when-let (node (neo-buffer--get-filename-current-line))
(when-let* ((node (neo-buffer--get-filename-current-line)))
(cond ((file-directory-p node)
(neo-buffer--set-expand node t)
(neo-buffer--refresh t)

View file

@ -13,7 +13,7 @@
;;;###autoload
(defun +pass-get-field (entry fields)
(unless noninteractive
(if-let (data (if (listp entry) entry (auth-pass-parse-entry entry)))
(if-let* ((data (if (listp entry) entry (auth-pass-parse-entry entry))))
(cl-loop for key in (doom-enlist fields)
when (assoc key data)
return (cdr it))
@ -28,7 +28,7 @@
(+pass-get-field entry 'secret))
(defun +pass-ivy-action--open-url (entry)
(if-let (url (+pass-get-field entry +pass-url-fields))
(if-let* ((url (+pass-get-field entry +pass-url-fields)))
(and (or (string-match-p "https?://" url)
(error "Field for %s doesn't look like an url" item))
(browse-url url))
@ -48,7 +48,7 @@
(error "Couldn't find entry: %s" item))))
(defun +pass-ivy-action--copy-username (entry)
(if-let (user (+pass-get-field entry +pass-user-fields))
(if-let* ((user (+pass-get-field entry +pass-user-fields)))
(progn (password-store-clear)
(message "Copied username to the kill ring.")
(kill-new user))

View file

@ -108,11 +108,11 @@ but do not execute them."
;;;###autoload
(defun +tmux-list-windows (&optional session)
(if-let (lines
(+tmux (format "list-windows %s -F '#{window_id};#{session_id};#{window_active};#{window_name};#{window_activity_flag}'"
(if session
(concat "-t " (car session))
"-a"))))
(if-let* ((lines
(+tmux (format "list-windows %s -F '#{window_id};#{session_id};#{window_active};#{window_name};#{window_activity_flag}'"
(if session
(concat "-t " (car session))
"-a")))))
(cl-loop for line in (string-split lines "\n" t)
collect (let ((window (string-split line ";")))
(list (nth 0 window)
@ -124,13 +124,13 @@ but do not execute them."
;;;###autoload
(defun +tmux-list-panes (&optional sess-or-win)
(if-let (lines
(+tmux (format "list-panes %s -F '#{pane_id};#{window_id};#{session_id};#{pane_active};#{pane_title};#{pane_current_path}'"
(if sess-or-win
(concat (if (string-prefix-p "$" (car sess-or-win)) "-s ")
"-t "
(car sess-or-win))
"-a"))))
(if-let* ((lines
(+tmux (format "list-panes %s -F '#{pane_id};#{window_id};#{session_id};#{pane_active};#{pane_title};#{pane_current_path}'"
(if sess-or-win
(concat (if (string-prefix-p "$" (car sess-or-win)) "-s ")
"-t "
(car sess-or-win))
"-a")))))
(cl-loop for line in (string-split lines "\n" t)
collect (let ((pane (split-string line ";")))
(list (nth 0 pane)