diff options
author | Tianxiang Xiong <tianxiang.xiong@gmail.com> | 2017-12-11 01:17:50 -0800 |
---|---|---|
committer | Bozhidar Batsov <bozhidar.batsov@gmail.com> | 2017-12-11 16:09:54 +0000 |
commit | b34057a1944354cbd2100e2beb08d6c6e1e06da3 (patch) | |
tree | a033bdacf950d04623b1f78824c171ee7dceab07 /cider-repl.el | |
parent | b484daa718c09c3d41e260878f93a35f05edb5b4 (diff) |
Replace `if-let` and `when-let` with starred versions
Fix #2130.
Emacs 26 obsoletes `if-let` and `when-let`, replacing them with `if-let*` and
`when-let*`. This raises byte-compilation warnings (treated as errors) when
testing against Emacs 26.
See: http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-26#n1278
Diffstat (limited to 'cider-repl.el')
-rw-r--r-- | cider-repl.el | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cider-repl.el b/cider-repl.el index 99d6398e..367c68c0 100644 --- a/cider-repl.el +++ b/cider-repl.el @@ -219,11 +219,11 @@ via `cider-current-connection'.") ;; Metadata changed, so signatures may have changed too. (setq cider-eldoc-last-symbol nil) (when (or cider-mode (derived-mode-p 'cider-repl-mode)) - (when-let ((ns-dict (or (nrepl-dict-get changed-namespaces (cider-current-ns)) - (let ((ns-dict (cider-resolve--get-in (cider-current-ns)))) - (when (seq-find (lambda (ns) (nrepl-dict-get changed-namespaces ns)) - (nrepl-dict-get ns-dict "aliases")) - ns-dict))))) + (when-let* ((ns-dict (or (nrepl-dict-get changed-namespaces (cider-current-ns)) + (let ((ns-dict (cider-resolve--get-in (cider-current-ns)))) + (when (seq-find (lambda (ns) (nrepl-dict-get changed-namespaces ns)) + (nrepl-dict-get ns-dict "aliases")) + ns-dict))))) (cider-refresh-dynamic-font-lock ns-dict)))))))))) (declare-function cider-default-err-handler "cider-interaction") @@ -562,7 +562,7 @@ When there is a possible unfinished ansi control sequence, (defun cider-repl--ns-form-changed-p (ns-form connection) "Return non-nil if NS-FORM for CONNECTION changed since last eval." - (when-let ((ns (cider-ns-from-form ns-form))) + (when-let* ((ns (cider-ns-from-form ns-form))) (not (string= ns-form (lax-plist-get (buffer-local-value 'cider-repl--ns-forms-plist connection) @@ -580,7 +580,7 @@ When there is a possible unfinished ansi control sequence, (defun cider-repl--cache-ns-form (ns-form connection) "Given NS-FORM cache root ns in CONNECTION." (with-current-buffer connection - (when-let ((ns (cider-ns-from-form ns-form))) + (when-let* ((ns (cider-ns-from-form ns-form))) ;; cache ns-form (setq cider-repl--ns-forms-plist (lax-plist-put cider-repl--ns-forms-plist ns ns-form)) @@ -901,7 +901,7 @@ text property `cider-old-input'." (defun cider-repl-switch-to-other () "Switch between the Clojure and ClojureScript REPLs for the current project." (interactive) - (if-let (other-connection (cider-other-connection)) + (if-let* ((other-connection (cider-other-connection)) (switch-to-buffer other-connection) (message "There's no other REPL for the current project"))) @@ -1073,7 +1073,7 @@ for locref look up." This function is used from help-echo property inside REPL buffers and uses regexes from `cider-locref-regexp-alist' to infer locations at point." (interactive) - (if-let ((loc (cider-locref-at-point pos))) + (if-let* ((loc (cider-locref-at-point pos))) (let* ((var (plist-get loc :var)) (line (plist-get loc :line)) (file (or @@ -1108,7 +1108,7 @@ One for all REPLs.") "Function for help-echo property in REPL buffers. WIN, BUFFER and POS are the window, buffer and point under mouse position." (with-current-buffer buffer - (if-let ((hl (plist-get (cider-locref-at-point pos) :highlight))) + (if-let* ((hl (plist-get (cider-locref-at-point pos) :highlight))) (move-overlay cider-locref-hoover-overlay (car hl) (cdr hl)) (delete-overlay cider-locref-hoover-overlay)) nil)) |