Minor refactors across the board
- when-let* -> when-let - Fix projectile-locate-dominating-file for connected remote files
This commit is contained in:
parent
4ecf6c9414
commit
9a02bd8ac8
42 changed files with 114 additions and 110 deletions
|
@ -128,7 +128,7 @@ If BUFFER-OR-NAME is omitted or nil, the current buffer is tested."
|
|||
(or (bufferp buffer-or-name)
|
||||
(stringp buffer-or-name)
|
||||
(signal 'wrong-type-argument (list '(bufferp stringp) buffer-or-name)))
|
||||
(when-let* ((buf (get-buffer buffer-or-name)))
|
||||
(when-let (buf (get-buffer buffer-or-name))
|
||||
(and (buffer-live-p buf)
|
||||
(not (doom-temp-buffer-p buf))
|
||||
(or (buffer-local-value 'doom-real-buffer-p buf)
|
||||
|
|
|
@ -167,7 +167,7 @@ file if it exists, without confirmation."
|
|||
(list (read-file-name "Copy file to: ")
|
||||
current-prefix-arg))
|
||||
(pcase (catch 'status
|
||||
(when-let* ((dest (doom--copy-file (buffer-file-name) new-path force-p)))
|
||||
(when-let (dest (doom--copy-file (buffer-file-name) new-path force-p))
|
||||
(doom--update-file new-path)
|
||||
(message "File successfully copied to %s" dest)))
|
||||
(`overwrite-self (error "Cannot overwrite self"))
|
||||
|
@ -184,7 +184,7 @@ 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 (doom--copy-file old-path new-path force-p)))
|
||||
(when-let (dest (doom--copy-file old-path new-path force-p))
|
||||
(when (file-exists-p old-path)
|
||||
(delete-file old-path))
|
||||
(kill-current-buffer)
|
||||
|
|
|
@ -27,7 +27,7 @@ acceptable values for this variable.")
|
|||
|
||||
(defun doom--font-name (fontname frame)
|
||||
(when (query-fontset fontname)
|
||||
(when-let* ((ascii (assq 'ascii (aref (fontset-info fontname frame) 2))))
|
||||
(when-let (ascii (assq 'ascii (aref (fontset-info fontname frame) 2)))
|
||||
(setq fontname (nth 2 ascii))))
|
||||
(or (x-decompose-font-name fontname)
|
||||
(error "Cannot decompose font name")))
|
||||
|
|
|
@ -309,9 +309,9 @@ current file is in, or d) the module associated with the current major mode (see
|
|||
(when (memq (car-safe sexp) '(featurep! require!))
|
||||
(format "%s %s" (nth 1 sexp) (nth 2 sexp)))))))
|
||||
((and buffer-file-name
|
||||
(when-let* ((mod (doom-module-from-path buffer-file-name)))
|
||||
(when-let (mod (doom-module-from-path buffer-file-name))
|
||||
(format "%s %s" (car mod) (cdr mod)))))
|
||||
((when-let* ((mod (cdr (assq major-mode doom--help-major-mode-module-alist))))
|
||||
((when-let (mod (cdr (assq major-mode doom--help-major-mode-module-alist)))
|
||||
(format "%s %s"
|
||||
(symbol-name (car mod))
|
||||
(symbol-name (cadr mod)))))))
|
||||
|
@ -498,7 +498,7 @@ If prefix arg is present, refresh the cache."
|
|||
(defun doom--package-url (package)
|
||||
(cond ((assq package package--builtins)
|
||||
(user-error "Package is built into Emacs and cannot be looked up"))
|
||||
((when-let* ((location (locate-library (symbol-name package))))
|
||||
((when-let (location (locate-library (symbol-name package)))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents (concat (file-name-sans-extension location) ".el")
|
||||
nil 0 4096)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue