Minor refactors & reformatting
This commit is contained in:
parent
86843d7569
commit
da1030985d
9 changed files with 52 additions and 48 deletions
|
@ -55,19 +55,18 @@ And jumps to your `doom!' block."
|
|||
|
||||
(defmacro doom--if-compile (command on-success &optional on-failure)
|
||||
(declare (indent 2))
|
||||
(let ((windowsym (make-symbol "doom-sync-window")))
|
||||
`(with-current-buffer (compile ,command t)
|
||||
(let ((,windowsym (get-buffer-window (current-buffer))))
|
||||
(select-window ,windowsym)
|
||||
(add-hook
|
||||
'compilation-finish-functions
|
||||
(lambda (_buf status)
|
||||
(if (equal status "finished\n")
|
||||
(progn
|
||||
(delete-window ,windowsym)
|
||||
,on-success)
|
||||
,on-failure))
|
||||
nil 'local)))))
|
||||
`(with-current-buffer (compile ,command t)
|
||||
(let ((w (get-buffer-window (current-buffer))))
|
||||
(select-window w)
|
||||
(add-hook
|
||||
'compilation-finish-functions
|
||||
(lambda (_buf status)
|
||||
(if (equal status "finished\n")
|
||||
(progn
|
||||
(delete-window w)
|
||||
,on-success)
|
||||
,on-failure))
|
||||
nil 'local))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/reload ()
|
||||
|
|
|
@ -26,7 +26,7 @@ following shell commands:
|
|||
(print! (info "Reloading Doom Emacs"))
|
||||
(doom-cli-execute-after "doom" "upgrade" "-p" (if force-p "-f")))
|
||||
|
||||
((print! "Nothing to do. Doom is up-to-date!")))))
|
||||
((print! "Doom is up-to-date!")))))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -47,7 +47,6 @@ following shell commands:
|
|||
|
||||
(defun doom-cli-upgrade (&optional auto-accept-p force-p)
|
||||
"Upgrade Doom to the latest version non-destructively."
|
||||
(require 'vc-git)
|
||||
(let ((default-directory doom-emacs-dir)
|
||||
process-file-side-effects)
|
||||
(print! (start "Preparing to upgrade Doom Emacs and its packages..."))
|
||||
|
@ -84,8 +83,8 @@ following shell commands:
|
|||
(or (zerop (car (setq result (doom-call-process "git" "fetch" "--tags" doom-repo-remote branch))))
|
||||
(error "Failed to fetch from upstream"))
|
||||
|
||||
(let ((this-rev (vc-git--rev-parse "HEAD"))
|
||||
(new-rev (vc-git--rev-parse target-remote)))
|
||||
(let ((this-rev (cdr (doom-call-process "git" "rev-parse" "HEAD")))
|
||||
(new-rev (cdr (doom-call-process "git" "rev-parse" target-remote))))
|
||||
(cond
|
||||
((and (null this-rev)
|
||||
(null new-rev))
|
||||
|
@ -114,9 +113,9 @@ following shell commands:
|
|||
(print! (start "Upgrading Doom Emacs..."))
|
||||
(print-group!
|
||||
(doom-clean-byte-compiled-files)
|
||||
(unless (and (zerop (car (doom-call-process "git" "reset" "--hard" target-remote)))
|
||||
(equal (vc-git--rev-parse "HEAD") new-rev))
|
||||
(error "Failed to check out %s" (substring new-rev 0 10)))
|
||||
(or (and (zerop (car (doom-call-process "git" "reset" "--hard" target-remote)))
|
||||
(equal (cdr (doom-call-process "git" "rev-parse" "HEAD")) new-rev))
|
||||
(error "Failed to check out %s" (substring new-rev 0 10)))
|
||||
(print! (info "%s") (cdr result))
|
||||
t))))))
|
||||
(ignore-errors
|
||||
|
|
|
@ -61,9 +61,9 @@ uses a straight or package.el command directly).")
|
|||
;; than pulled, so packages are often out of date with upstream.
|
||||
package-archives
|
||||
(let ((proto (if gnutls-verify-error "https" "http")))
|
||||
`(("gnu" . ,(concat proto "://elpa.gnu.org/packages/"))
|
||||
("melpa" . ,(concat proto "://melpa.org/packages/"))
|
||||
("org" . ,(concat proto "://orgmode.org/elpa/")))))
|
||||
(list (cons "gnu" (concat proto "://elpa.gnu.org/packages/"))
|
||||
(cons "melpa" (concat proto "://melpa.org/packages/"))
|
||||
(cons "org" (concat proto "://orgmode.org/elpa/")))))
|
||||
|
||||
;; package.el has no business modifying the user's init.el
|
||||
(advice-add #'package--ensure-init-file :override #'ignore)
|
||||
|
|
|
@ -26,6 +26,8 @@ debian, and derivatives). On most it's 'fd'.")
|
|||
projectile-locate-dominating-file)
|
||||
:init
|
||||
(setq projectile-cache-file (concat doom-cache-dir "projectile.cache")
|
||||
;; Auto-discovery is slow to do by default. Better to update the list
|
||||
;; when you need to (`projectile-discover-projects-in-search-path').
|
||||
projectile-auto-discover nil
|
||||
projectile-enable-caching doom-interactive-p
|
||||
projectile-globally-ignored-files '(".DS_Store" "Icon
" "TAGS")
|
||||
|
@ -165,8 +167,7 @@ And if it's a function, evaluate it."
|
|||
;; it respects .gitignore. This is recommended in the projectile docs.
|
||||
(cond
|
||||
((when-let
|
||||
(bin (if (or (null default-directory)
|
||||
(file-remote-p default-directory nil t))
|
||||
(bin (if (ignore-errors (file-remote-p default-directory nil t))
|
||||
(cl-find-if find-exe-fn (list "fdfind" "fd"))
|
||||
doom-projectile-fd-binary))
|
||||
(concat (format "%s . -0 -H -E .git --color=never --type file --type symlink --follow"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue