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

@ -35,9 +35,9 @@ compilation database is present in the project.")
(or (file-exists-p (expand-file-name
(concat (file-name-sans-extension buffer-file-name)
".cpp")))
(when-let (file (car-safe (projectile-get-other-files
buffer-file-name
(projectile-current-project-files))))
(when-let* ((file (car-safe (projectile-get-other-files
buffer-file-name
(projectile-current-project-files)))))
(equal (file-name-extension file) "cpp")))))
(defun +cc-objc-header-file-p ()

View file

@ -10,14 +10,14 @@ ignore the cache."
(or (and (not refresh-p)
(gethash project-root +javascript-npm-conf))
(let ((package-file (expand-file-name "package.json" project-root)))
(when-let (json (and (file-exists-p package-file)
(json-read-file package-file)))
(when-let* ((json (and (file-exists-p package-file)
(json-read-file package-file))))
(puthash project-root json +javascript-npm-conf))))))
;;;###autoload
(defun +javascript-npm-dep-p (packages &optional project-root refresh-p)
(when-let (data (and (bound-and-true-p +javascript-npm-mode)
(+javascript-npm-conf project-root refresh-p)))
(when-let* ((data (and (bound-and-true-p +javascript-npm-mode)
(+javascript-npm-conf project-root refresh-p))))
(let ((deps (append (cdr (assq 'dependencies data))
(cdr (assq 'devDependencies data)))))
(cond ((listp packages)

View file

@ -27,8 +27,8 @@
(defun +javascript|init-flycheck-eslint ()
"Favor local eslint over global installs and configure flycheck for eslint."
(when (derived-mode-p 'js-mode)
(when-let ((exec-path (list (doom-project-expand "node_modules/.bin")))
(eslint (executable-find "eslint")))
(when-let* (((exec-path (list (doom-project-expand "node_modules/.bin")))
(eslint (executable-find "eslint"))))
(setq-local flycheck-javascript-eslint-executable eslint))
(when (flycheck-find-checker-executable 'javascript-eslint)
;; Flycheck has it's own trailing command and semicolon warning that was

View file

@ -35,8 +35,8 @@
;; (goto-char (point-min))
;; (while (progn (org-next-link) (not org-link-search-failed))
;; (setq element (org-element-context))
;; (when-let (file (and (eq (org-element-type element) 'link)
;; (expand-file-name (org-element-property :path element))))
;; (when-let* (file (and (eq (org-element-type element) 'link)
;; (expand-file-name (org-element-property :path element))))
;; (when (and (string= (org-element-property :type element) "file")
;; (string= (concat (file-name-base (directory-file-name (file-name-directory file))) "/")
;; org-attach-directory)

View file

@ -18,12 +18,12 @@
Uses the capture template specified by KEY. Otherwise, prompts you for one."
(interactive)
(let ((key (or key "n")))
(if-let (string (cond ((not (equal string ""))
string)
((region-active-p)
(buffer-substring-no-properties
(region-beginning)
(region-end)))))
(if-let* ((string (cond ((not (equal string ""))
string)
((region-active-p)
(buffer-substring-no-properties
(region-beginning)
(region-end))))))
(org-capture-string string key)
(org-capture nil key))))

View file

@ -4,7 +4,7 @@
"The directory where org files are kept.")
;; Ensure ELPA org is prioritized above built-in org.
(when-let (path (locate-library "org" nil doom--package-load-path))
(when-let* ((path (locate-library "org" nil doom--package-load-path)))
(setq load-path (delete path load-path))
(push (file-name-directory path) load-path))

View file

@ -9,6 +9,6 @@ ignore the cache."
(let ((project-root (or project-root (doom-project-root))))
(or (and (not refresh-p) (gethash project-root +php-composer-conf))
(let ((package-file (expand-file-name "composer.json" project-root)))
(when-let (data (and (file-exists-p package-file)
(json-read-file package-file)))
(when-let* ((data (and (file-exists-p package-file)
(json-read-file package-file))))
(puthash project-root data +php-composer-conf))))))

View file

@ -55,7 +55,7 @@ is loaded.")
(defun +python|detect-pyenv-version ()
"Detect the pyenv version for the current project and set the relevant
environment variables."
(when-let (version-str (shell-command-to-string "python --version 2>&1 | cut -d' ' -f2"))
(when-let* ((version-str (shell-command-to-string "python --version 2>&1 | cut -d' ' -f2")))
(setq version-str (string-trim version-str)
+python-current-version version-str)
(let ((pyenv-current-path (concat +python-pyenv-root "/versions/" version-str)))

View file

@ -43,7 +43,7 @@
(defun +ruby|detect-rbenv-version ()
"Detect the rbenv version for the current project and set the relevant
environment variables."
(when-let (version-str (shell-command-to-string "ruby --version 2>&1 | cut -d' ' -f2"))
(when-let* ((version-str (shell-command-to-string "ruby --version 2>&1 | cut -d' ' -f2")))
(setq version-str (string-trim version-str)
+ruby-current-version version-str)
(when (member version-str +ruby-rbenv-versions)