Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- lisp-interaction -*-
- # vim: set ft=lisp:
- (error "Failed to fetch from upstream")
- (error "Failed to fetch from upstream")
- (or (= 0 (car (setq result (doom-call-process "git" "fetch" "--force" "--tags" doom-repo-remote (format "%s:%s" branch target-remote))))) (error "Failed to fetch from upstream"))
- (let (result) (or (= 0 (car (doom-call-process "git" "remote" "add" doom-repo-remote doom-repo-url))) (error "Failed to add %s to remotes" doom-repo-remote)) (or (= 0 (car (setq result (doom-call-process "git" "fetch" "--force" "--tags" doom-repo-remote (format "%s:%s" branch target-remote))))) (error "Failed to fetch from upstream")) (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)) (error "Failed to get revisions for %s" target-remote)) ((equal this-rev new-rev) (doom--print (doom--format (format (doom--output-class 'success "Doom is already up-to-date!")))) nil) ((doom--print (doom--format (format (doom--output-class 'info "A new version of Doom Emacs is available!\n\n Old revision: %s (%s)\n New revision: %s (%s)\n" (substring this-rev 0 10) (cdr (doom-call-process "git" "log" "-1" "--format=%cr" "HEAD")) (substring new-rev 0 10) (cdr (doom-call-process "git" "log" "-1" "--format=%cr" target-remote)))))) (let ((diff-url (format "%s/compare/%s...%s" doom-repo-url this-rev new-rev))) (doom--print (doom--format (format "Link to diff: %s" diff-url))) (if (and (not auto-accept-p) (y-or-n-p "View the comparison diff in your browser?")) (progn (doom--print (doom--format (format (doom--output-class 'info "Opened github in your browser.")))) (browse-url diff-url)))) (if (not (or auto-accept-p (y-or-n-p "Proceed with upgrade?"))) (ignore (doom--print (doom--format (format (doom--output-class 'error "Aborted"))))) (doom--print (doom--format (format (doom--output-class 'start "Upgrading Doom Emacs...")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom-clean-byte-compiled-files) (let ((straight-recipe (doom--get-straight-recipe))) (or (and (= 0 (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))) (if (equal straight-recipe (doom--get-straight-recipe)) nil (doom--print (doom--format (format (doom--output-class 'info "Preparing straight for an update")))) (delete-directory (doom-path straight-base-dir "straight/repos/straight.el") 'recursive))) (doom--print (doom--format (format (doom--output-class 'info "%s") (cdr result)))) t))))))
- (unwind-protect (let (result) (or (= 0 (car (doom-call-process "git" "remote" "add" doom-repo-remote doom-repo-url))) (error "Failed to add %s to remotes" doom-repo-remote)) (or (= 0 (car (setq result (doom-call-process "git" "fetch" "--force" "--tags" doom-repo-remote (format "%s:%s" branch target-remote))))) (error "Failed to fetch from upstream")) (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)) (error "Failed to get revisions for %s" target-remote)) ((equal this-rev new-rev) (doom--print (doom--format (format (doom--output-class 'success "Doom is already up-to-date!")))) nil) ((doom--print (doom--format (format (doom--output-class 'info "A new version of Doom Emacs is available!\n\n Old revision: %s (%s)\n New revision: %s (%s)\n" (substring this-rev 0 10) (cdr (doom-call-process "git" "log" "-1" "--format=%cr" "HEAD")) (substring new-rev 0 10) (cdr (doom-call-process "git" "log" "-1" "--format=%cr" target-remote)))))) (let ((diff-url (format "%s/compare/%s...%s" doom-repo-url this-rev new-rev))) (doom--print (doom--format (format "Link to diff: %s" diff-url))) (if (and (not auto-accept-p) (y-or-n-p "View the comparison diff in your browser?")) (progn (doom--print (doom--format (format (doom--output-class 'info "Opened github in your browser.")))) (browse-url diff-url)))) (if (not (or auto-accept-p (y-or-n-p "Proceed with upgrade?"))) (ignore (doom--print (doom--format (format (doom--output-class 'error "Aborted"))))) (doom--print (doom--format (format (doom--output-class 'start "Upgrading Doom Emacs...")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom-clean-byte-compiled-files) (let ((straight-recipe (doom--get-straight-recipe))) (or (and (= 0 (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))) (if (equal straight-recipe (doom--get-straight-recipe)) nil (doom--print (doom--format (format (doom--output-class 'info "Preparing straight for an update")))) (delete-directory (doom-path straight-base-dir "straight/repos/straight.el") 'recursive))) (doom--print (doom--format (format (doom--output-class 'info "%s") (cdr result)))) t)))))) (condition-case nil (progn (doom-call-process "git" "branch" "-D" target-remote) (doom-call-process "git" "remote" "remove" doom-repo-remote)) (error nil)))
- (let* ((branch (replace-regexp-in-string "^\\(?:[^/]+/[^/]+/\\)?\\(.+\\)\\(?:~[0-9]+\\)?$" "\\1" (cdr (doom-call-process "git" "name-rev" "--name-only" "HEAD")))) (target-remote (format "%s_%s" doom-repo-remote branch))) (if branch nil (error (doom--format (format (if (let ((p (let ((file ".git")) (and (stringp file) (let ((default-directory doom-emacs-dir)) (file-exists-p file)) file)))) (and p (expand-file-name p doom-emacs-dir))) "Couldn't find Doom's .git directory. Was Doom cloned properly?" "Couldn't detect what branch you're on. Is Doom detached?"))))) (let* ((dirty (and t (doom--working-tree-dirty-p default-directory)))) (if dirty (if (not force-p) (user-error (doom--format (format "%s\n\n%s\n\n %s" (format "Refusing to upgrade because %S has been modified." (doom--output-class 'path doom-emacs-dir)) "Either stash/undo your changes or run 'doom upgrade -f' to discard local changes." (string-join dirty "\n")))) (doom--print (doom--format (format (doom--output-class 'info "You have local modifications in Doom's source. Discarding them...")))) (doom-call-process "git" "reset" "--hard" (format "origin/%s" branch)) (doom-call-process "git" "clean" "-ffd")) nil)) (doom-call-process "git" "remote" "remove" doom-repo-remote) (unwind-protect (let (result) (or (= 0 (car (doom-call-process "git" "remote" "add" doom-repo-remote doom-repo-url))) (error "Failed to add %s to remotes" doom-repo-remote)) (or (= 0 (car (setq result (doom-call-process "git" "fetch" "--force" "--tags" doom-repo-remote (format "%s:%s" branch target-remote))))) (error "Failed to fetch from upstream")) (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)) (error "Failed to get revisions for %s" target-remote)) ((equal this-rev new-rev) (doom--print (doom--format (format (doom--output-class 'success "Doom is already up-to-date!")))) nil) ((doom--print (doom--format (format (doom--output-class 'info "A new version of Doom Emacs is available!\n\n Old revision: %s (%s)\n New revision: %s (%s)\n" (substring this-rev 0 10) (cdr (doom-call-process "git" "log" "-1" "--format=%cr" "HEAD")) (substring new-rev 0 10) (cdr (doom-call-process "git" "log" "-1" "--format=%cr" target-remote)))))) (let ((diff-url (format "%s/compare/%s...%s" doom-repo-url this-rev new-rev))) (doom--print (doom--format (format "Link to diff: %s" diff-url))) (if (and (not auto-accept-p) (y-or-n-p "View the comparison diff in your browser?")) (progn (doom--print (doom--format (format (doom--output-class 'info "Opened github in your browser.")))) (browse-url diff-url)))) (if (not (or auto-accept-p (y-or-n-p "Proceed with upgrade?"))) (ignore (doom--print (doom--format (format (doom--output-class 'error "Aborted"))))) (doom--print (doom--format (format (doom--output-class 'start "Upgrading Doom Emacs...")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom-clean-byte-compiled-files) (let ((straight-recipe (doom--get-straight-recipe))) (or (and (= 0 (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))) (if (equal straight-recipe (doom--get-straight-recipe)) nil (doom--print (doom--format (format (doom--output-class 'info "Preparing straight for an update")))) (delete-directory (doom-path straight-base-dir "straight/repos/straight.el") 'recursive))) (doom--print (doom--format (format (doom--output-class 'info "%s") (cdr result)))) t)))))) (condition-case nil (progn (doom-call-process "git" "branch" "-D" target-remote) (doom-call-process "git" "remote" "remove" doom-repo-remote)) (error nil))))
- (let ((default-directory doom-emacs-dir) process-file-side-effects) (doom--print (doom--format (format (doom--output-class 'start "Preparing to upgrade Doom Emacs and its packages...")))) (let* ((branch (replace-regexp-in-string "^\\(?:[^/]+/[^/]+/\\)?\\(.+\\)\\(?:~[0-9]+\\)?$" "\\1" (cdr (doom-call-process "git" "name-rev" "--name-only" "HEAD")))) (target-remote (format "%s_%s" doom-repo-remote branch))) (if branch nil (error (doom--format (format (if (let ((p (let ((file ".git")) (and (stringp file) (let ((default-directory doom-emacs-dir)) (file-exists-p file)) file)))) (and p (expand-file-name p doom-emacs-dir))) "Couldn't find Doom's .git directory. Was Doom cloned properly?" "Couldn't detect what branch you're on. Is Doom detached?"))))) (let* ((dirty (and t (doom--working-tree-dirty-p default-directory)))) (if dirty (if (not force-p) (user-error (doom--format (format "%s\n\n%s\n\n %s" (format "Refusing to upgrade because %S has been modified." (doom--output-class 'path doom-emacs-dir)) "Either stash/undo your changes or run 'doom upgrade -f' to discard local changes." (string-join dirty "\n")))) (doom--print (doom--format (format (doom--output-class 'info "You have local modifications in Doom's source. Discarding them...")))) (doom-call-process "git" "reset" "--hard" (format "origin/%s" branch)) (doom-call-process "git" "clean" "-ffd")) nil)) (doom-call-process "git" "remote" "remove" doom-repo-remote) (unwind-protect (let (result) (or (= 0 (car (doom-call-process "git" "remote" "add" doom-repo-remote doom-repo-url))) (error "Failed to add %s to remotes" doom-repo-remote)) (or (= 0 (car (setq result (doom-call-process "git" "fetch" "--force" "--tags" doom-repo-remote (format "%s:%s" branch target-remote))))) (error "Failed to fetch from upstream")) (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)) (error "Failed to get revisions for %s" target-remote)) ((equal this-rev new-rev) (doom--print (doom--format (format (doom--output-class 'success "Doom is already up-to-date!")))) nil) ((doom--print (doom--format (format (doom--output-class 'info "A new version of Doom Emacs is available!\n\n Old revision: %s (%s)\n New revision: %s (%s)\n" (substring this-rev 0 10) (cdr (doom-call-process "git" "log" "-1" "--format=%cr" "HEAD")) (substring new-rev 0 10) (cdr (doom-call-process "git" "log" "-1" "--format=%cr" target-remote)))))) (let ((diff-url (format "%s/compare/%s...%s" doom-repo-url this-rev new-rev))) (doom--print (doom--format (format "Link to diff: %s" diff-url))) (if (and (not auto-accept-p) (y-or-n-p "View the comparison diff in your browser?")) (progn (doom--print (doom--format (format (doom--output-class 'info "Opened github in your browser.")))) (browse-url diff-url)))) (if (not (or auto-accept-p (y-or-n-p "Proceed with upgrade?"))) (ignore (doom--print (doom--format (format (doom--output-class 'error "Aborted"))))) (doom--print (doom--format (format (doom--output-class 'start "Upgrading Doom Emacs...")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom-clean-byte-compiled-files) (let ((straight-recipe (doom--get-straight-recipe))) (or (and (= 0 (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))) (if (equal straight-recipe (doom--get-straight-recipe)) nil (doom--print (doom--format (format (doom--output-class 'info "Preparing straight for an update")))) (delete-directory (doom-path straight-base-dir "straight/repos/straight.el") 'recursive))) (doom--print (doom--format (format (doom--output-class 'info "%s") (cdr result)))) t)))))) (condition-case nil (progn (doom-call-process "git" "branch" "-D" target-remote) (doom-call-process "git" "remote" "remove" doom-repo-remote)) (error nil)))))
- (doom-cli-upgrade "-y" "-f")
- (cond (packages-only-p (doom-cli-execute "sync" "-u") (doom--print (doom--format (format (doom--output-class 'success "Finished upgrading Doom Emacs"))))) ((doom-cli-upgrade doom-auto-accept doom-auto-discard) (doom--print (doom--format (format (doom--output-class 'info "Reloading Doom Emacs")))) (throw 'exit (list "doom" "upgrade" "-p" (if force-p "-f")))) ((doom--print (doom--format (format "Doom is up-to-date!"))) (doom-cli-execute "sync" "-u")))
- (let ((doom-auto-discard force-p)) (cond (packages-only-p (doom-cli-execute "sync" "-u") (doom--print (doom--format (format (doom--output-class 'success "Finished upgrading Doom Emacs"))))) ((doom-cli-upgrade doom-auto-accept doom-auto-discard) (doom--print (doom--format (format (doom--output-class 'info "Reloading Doom Emacs")))) (throw 'exit (list "doom" "upgrade" "-p" (if force-p "-f")))) ((doom--print (doom--format (format "Doom is up-to-date!"))) (doom-cli-execute "sync" "-u"))))
- (let ((force-p (cdr (assq 'force-p --alist--))) (packages-only-p (cdr (assq 'packages-only-p --alist--)))) :bare t (let ((doom-auto-discard force-p)) (cond (packages-only-p (doom-cli-execute "sync" "-u") (doom--print (doom--format (format (doom--output-class 'success "Finished upgrading Doom Emacs"))))) ((doom-cli-upgrade doom-auto-accept doom-auto-discard) (doom--print (doom--format (format (doom--output-class 'info "Reloading Doom Emacs")))) (throw 'exit (list "doom" "upgrade" "-p" (if force-p "-f")))) ((doom--print (doom--format (format "Doom is up-to-date!"))) (doom-cli-execute "sync" "-u")))))
- ((closure ((plist :bare t) (aliases up) (name . upgrade) t) (--alist--) (ignore --alist--) (let ((force-p (cdr (assq 'force-p --alist--))) (packages-only-p (cdr (assq 'packages-only-p --alist--)))) :bare t (let ((doom-auto-discard force-p)) (cond (packages-only-p (doom-cli-execute "sync" "-u") (doom--print (doom--format (format (doom--output-class 'success "Finished upgrading Doom Emacs"))))) ((doom-cli-upgrade doom-auto-accept doom-auto-discard) (doom--print (doom--format (format (doom--output-class 'info "Reloading Doom Emacs")))) (throw 'exit (list "doom" "upgrade" "-p" (if force-p "-f")))) ((doom--print (doom--format (format "Doom is up-to-date!"))) (doom-cli-execute "sync" "-u")))))) ((force-p . "-f")))
- (funcall (closure ((plist :bare t) (aliases up) (name . upgrade) t) (--alist--) (ignore --alist--) (let ((force-p (cdr (assq 'force-p --alist--))) (packages-only-p (cdr (assq 'packages-only-p --alist--)))) :bare t (let ((doom-auto-discard force-p)) (cond (packages-only-p (doom-cli-execute "sync" "-u") (doom--print (doom--format (format (doom--output-class 'success "Finished upgrading Doom Emacs"))))) ((doom-cli-upgrade doom-auto-accept doom-auto-discard) (doom--print (doom--format (format (doom--output-class 'info "Reloading Doom Emacs")))) (throw 'exit (list "doom" "upgrade" "-p" (if force-p "-f")))) ((doom--print (doom--format (format "Doom is up-to-date!"))) (doom-cli-execute "sync" "-u")))))) ((force-p . "-f")))
- (if cli (funcall (progn (or (progn (and (memq (type-of cli) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cli))) (aref cli 7)) (doom--cli-process cli (remq nil args))) (user-error "Couldn't find any %S command" command))
- (let* ((cli (and t (doom-cli-get command)))) (if cli (funcall (progn (or (progn (and (memq (type-of cli) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cli))) (aref cli 7)) (doom--cli-process cli (remq nil args))) (user-error "Couldn't find any %S command" command)))
- (doom-cli-execute "upgrade" "-f")
- (apply doom-cli-execute "upgrade" "-f")
- (and t (apply #'doom-cli-execute command args))
- (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil))
- (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))
- (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil))))
- (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))
- (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil))))))
- (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))
- (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil))))))))
- (unwind-protect (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))) (save-current-buffer (set-buffer log-buffer) (require 'ansi-color) (ansi-color-filter-region (point-min) (point-max))) (let ((dest doom--cli-log-buffer)) (cond ((bufferp dest) (save-current-buffer (set-buffer dest) (insert-buffer-substring log-buffer))) ((stringp dest) (make-directory (file-name-directory dest) 'parents) (let ((temp-file dest) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-buffer-substring log-buffer)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (kill-buffer log-buffer)))
- (progn (fset #'message vnew) (unwind-protect (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))) (save-current-buffer (set-buffer log-buffer) (require 'ansi-color) (ansi-color-filter-region (point-min) (point-max))) (let ((dest doom--cli-log-buffer)) (cond ((bufferp dest) (save-current-buffer (set-buffer dest) (insert-buffer-substring log-buffer))) ((stringp dest) (make-directory (file-name-directory dest) 'parents) (let ((temp-file dest) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-buffer-substring log-buffer)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (kill-buffer log-buffer))))
- (unwind-protect (progn (fset #'message vnew) (unwind-protect (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))) (save-current-buffer (set-buffer log-buffer) (require 'ansi-color) (ansi-color-filter-region (point-min) (point-max))) (let ((dest doom--cli-log-buffer)) (cond ((bufferp dest) (save-current-buffer (set-buffer dest) (insert-buffer-substring log-buffer))) ((stringp dest) (make-directory (file-name-directory dest) 'parents) (let ((temp-file dest) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-buffer-substring log-buffer)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (kill-buffer log-buffer)))) (fset #'message old))
- (let* ((vnew #'(lambda (msg &rest args) "\n\n(fn MSG &rest ARGS)" (progn (if msg (progn (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (save-current-buffer (set-buffer log-buffer) (insert (doom--format (apply #'format msg args)) "\n")) (if (or doom-debug-p (not inhibit-message)) (progn (doom--print (doom--format (apply #'format msg args)))))))) message))) (old (symbol-function #'message))) (unwind-protect (progn (fset #'message vnew) (unwind-protect (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))) (save-current-buffer (set-buffer log-buffer) (require 'ansi-color) (ansi-color-filter-region (point-min) (point-max))) (let ((dest doom--cli-log-buffer)) (cond ((bufferp dest) (save-current-buffer (set-buffer dest) (insert-buffer-substring log-buffer))) ((stringp dest) (make-directory (file-name-directory dest) 'parents) (let ((temp-file dest) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-buffer-substring log-buffer)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (kill-buffer log-buffer)))) (fset #'message old)))
- (let ((message (symbol-function #'message))) (ignore message) (let* ((vnew #'(lambda (msg &rest args) "\n\n(fn MSG &rest ARGS)" (progn (if msg (progn (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (save-current-buffer (set-buffer log-buffer) (insert (doom--format (apply #'format msg args)) "\n")) (if (or doom-debug-p (not inhibit-message)) (progn (doom--print (doom--format (apply #'format msg args)))))))) message))) (old (symbol-function #'message))) (unwind-protect (progn (fset #'message vnew) (unwind-protect (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))) (save-current-buffer (set-buffer log-buffer) (require 'ansi-color) (ansi-color-filter-region (point-min) (point-max))) (let ((dest doom--cli-log-buffer)) (cond ((bufferp dest) (save-current-buffer (set-buffer dest) (insert-buffer-substring log-buffer))) ((stringp dest) (make-directory (file-name-directory dest) 'parents) (let ((temp-file dest) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-buffer-substring log-buffer)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (kill-buffer log-buffer)))) (fset #'message old))))
- (let* ((log-buffer (generate-new-buffer " *doom log*")) (standard-output #'(lambda (out) (save-current-buffer (set-buffer log-buffer) (insert-char out)) (send-string-to-terminal (char-to-string out))))) (let ((message (symbol-function #'message))) (ignore message) (let* ((vnew #'(lambda (msg &rest args) "\n\n(fn MSG &rest ARGS)" (progn (if msg (progn (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (save-current-buffer (set-buffer log-buffer) (insert (doom--format (apply #'format msg args)) "\n")) (if (or doom-debug-p (not inhibit-message)) (progn (doom--print (doom--format (apply #'format msg args)))))))) message))) (old (symbol-function #'message))) (unwind-protect (progn (fset #'message vnew) (unwind-protect (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))) (save-current-buffer (set-buffer log-buffer) (require 'ansi-color) (ansi-color-filter-region (point-min) (point-max))) (let ((dest doom--cli-log-buffer)) (cond ((bufferp dest) (save-current-buffer (set-buffer dest) (insert-buffer-substring log-buffer))) ((stringp dest) (make-directory (file-name-directory dest) 'parents) (let ((temp-file dest) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-buffer-substring log-buffer)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (kill-buffer log-buffer)))) (fset #'message old)))))
- (condition-case e (let* ((log-buffer (generate-new-buffer " *doom log*")) (standard-output #'(lambda (out) (save-current-buffer (set-buffer log-buffer) (insert-char out)) (send-string-to-terminal (char-to-string out))))) (let ((message (symbol-function #'message))) (ignore message) (let* ((vnew #'(lambda (msg &rest args) "\n\n(fn MSG &rest ARGS)" (progn (if msg (progn (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (save-current-buffer (set-buffer log-buffer) (insert (doom--format (apply #'format msg args)) "\n")) (if (or doom-debug-p (not inhibit-message)) (progn (doom--print (doom--format (apply #'format msg args)))))))) message))) (old (symbol-function #'message))) (unwind-protect (progn (fset #'message vnew) (unwind-protect (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))) (save-current-buffer (set-buffer log-buffer) (require 'ansi-color) (ansi-color-filter-region (point-min) (point-max))) (let ((dest doom--cli-log-buffer)) (cond ((bufferp dest) (save-current-buffer (set-buffer dest) (insert-buffer-substring log-buffer))) ((stringp dest) (make-directory (file-name-directory dest) 'parents) (let ((temp-file dest) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-buffer-substring log-buffer)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (kill-buffer log-buffer)))) (fset #'message old))))) (doom-cli-command-not-found-error (doom--print (doom--format (format (doom--output-class 'error "Command 'doom %s' not recognized") (string-join (cdr e) " ")))) (doom--print (doom--format (format "\nDid you mean one of these commands?"))) (apply #'doom-cli-execute "help" "--similar" (string-join (cdr e) " ")) 5) (doom-cli-wrong-number-of-arguments-error (let* ((--cl-rest-- (cdr e)) (route (if (= (length --cl-rest--) 5) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal 'wrong-number-of-arguments (list '(route opt arg n d) (length --cl-rest--))))) (opt (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (arg (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (n (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (d (car-safe --cl-rest--))) (progn (doom--print (doom--format (format (doom--output-class 'error "doom %s: %S requires %d arguments, but %d given\n") (mapconcat #'symbol-name route " ") arg n d))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (apply #'doom-cli-execute "help" (mapcar #'symbol-name route))))) 6) (doom-cli-unrecognized-option-error (let ((option (car (cdr e)))) (doom--print (doom--format (format (doom--output-class 'error "Unrecognized option: %S") option))) (if (string-match "^--[^=]+=\\(.+\\)$" option) (progn (doom--print (doom--format (format "The %S syntax isn't supported. Use '%s %s' instead." option (car (split-string option "=")) (match-string 1 option))))))) 7) (doom-cli-deprecated-error (let* ((commands (cdr e)) (route (if commands (car-safe (prog1 commands (setq commands (cdr commands)))) (signal 'wrong-number-of-arguments (list '(route . commands) (length commands)))))) (progn (doom--print (doom--format (format (doom--output-class 'warn "The 'doom %s' command was removed and replaced with:\n") (mapconcat #'symbol-name route " ")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let ((--dolist-tail-- commands)) (while --dolist-tail-- (let ((command (car --dolist-tail--))) (doom--print (doom--format (format (doom--output-class 'info "%s") command))) (setq --dolist-tail-- (cdr --dolist-tail--)))))))) 8) (user-error (doom--print (doom--format (format (doom--output-class 'warn "%s") (car (cdr e))))) 9))
- (let ((help-p (cdr (assq 'help-p --alist--))) (auto-accept-p (cdr (assq 'auto-accept-p --alist--))) (debug-p (cdr (assq 'debug-p --alist--))) (loadfile (cdr (assq 'loadfile --alist--))) (doomdir (cdr (assq 'doomdir --alist--))) (localdir (cdr (assq 'localdir --alist--))) (nocolor (cdr (assq 'nocolor --alist--))) (command (cdr (assq 'command --alist--))) (args (cdr (assq 'args --alist--)))) (condition-case e (let* ((log-buffer (generate-new-buffer " *doom log*")) (standard-output #'(lambda (out) (save-current-buffer (set-buffer log-buffer) (insert-char out)) (send-string-to-terminal (char-to-string out))))) (let ((message (symbol-function #'message))) (ignore message) (let* ((vnew #'(lambda (msg &rest args) "\n\n(fn MSG &rest ARGS)" (progn (if msg (progn (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (save-current-buffer (set-buffer log-buffer) (insert (doom--format (apply #'format msg args)) "\n")) (if (or doom-debug-p (not inhibit-message)) (progn (doom--print (doom--format (apply #'format msg args)))))))) message))) (old (symbol-function #'message))) (unwind-protect (progn (fset #'message vnew) (unwind-protect (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))) (save-current-buffer (set-buffer log-buffer) (require 'ansi-color) (ansi-color-filter-region (point-min) (point-max))) (let ((dest doom--cli-log-buffer)) (cond ((bufferp dest) (save-current-buffer (set-buffer dest) (insert-buffer-substring log-buffer))) ((stringp dest) (make-directory (file-name-directory dest) 'parents) (let ((temp-file dest) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-buffer-substring log-buffer)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (kill-buffer log-buffer)))) (fset #'message old))))) (doom-cli-command-not-found-error (doom--print (doom--format (format (doom--output-class 'error "Command 'doom %s' not recognized") (string-join (cdr e) " ")))) (doom--print (doom--format (format "\nDid you mean one of these commands?"))) (apply #'doom-cli-execute "help" "--similar" (string-join (cdr e) " ")) 5) (doom-cli-wrong-number-of-arguments-error (let* ((--cl-rest-- (cdr e)) (route (if (= (length --cl-rest--) 5) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal 'wrong-number-of-arguments (list '(route opt arg n d) (length --cl-rest--))))) (opt (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (arg (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (n (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (d (car-safe --cl-rest--))) (progn (doom--print (doom--format (format (doom--output-class 'error "doom %s: %S requires %d arguments, but %d given\n") (mapconcat #'symbol-name route " ") arg n d))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (apply #'doom-cli-execute "help" (mapcar #'symbol-name route))))) 6) (doom-cli-unrecognized-option-error (let ((option (car (cdr e)))) (doom--print (doom--format (format (doom--output-class 'error "Unrecognized option: %S") option))) (if (string-match "^--[^=]+=\\(.+\\)$" option) (progn (doom--print (doom--format (format "The %S syntax isn't supported. Use '%s %s' instead." option (car (split-string option "=")) (match-string 1 option))))))) 7) (doom-cli-deprecated-error (let* ((commands (cdr e)) (route (if commands (car-safe (prog1 commands (setq commands (cdr commands)))) (signal 'wrong-number-of-arguments (list '(route . commands) (length commands)))))) (progn (doom--print (doom--format (format (doom--output-class 'warn "The 'doom %s' command was removed and replaced with:\n") (mapconcat #'symbol-name route " ")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let ((--dolist-tail-- commands)) (while --dolist-tail-- (let ((command (car --dolist-tail--))) (doom--print (doom--format (format (doom--output-class 'info "%s") command))) (setq --dolist-tail-- (cdr --dolist-tail--)))))))) 8) (user-error (doom--print (doom--format (format (doom--output-class 'warn "%s") (car (cdr e))))) 9)))
- ((closure ((plist) (aliases) (name . :doom) t) (--alist--) (ignore --alist--) (let ((help-p (cdr (assq 'help-p --alist--))) (auto-accept-p (cdr (assq 'auto-accept-p --alist--))) (debug-p (cdr (assq 'debug-p --alist--))) (loadfile (cdr (assq 'loadfile --alist--))) (doomdir (cdr (assq 'doomdir --alist--))) (localdir (cdr (assq 'localdir --alist--))) (nocolor (cdr (assq 'nocolor --alist--))) (command (cdr (assq 'command --alist--))) (args (cdr (assq 'args --alist--)))) (condition-case e (let* ((log-buffer (generate-new-buffer " *doom log*")) (standard-output #'(lambda (out) (save-current-buffer (set-buffer log-buffer) (insert-char out)) (send-string-to-terminal (char-to-string out))))) (let ((message (symbol-function #'message))) (ignore message) (let* ((vnew #'(lambda (msg &rest args) "\n\n(fn MSG &rest ARGS)" (progn (if msg (progn (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (save-current-buffer (set-buffer log-buffer) (insert (doom--format (apply #'format msg args)) "\n")) (if (or doom-debug-p (not inhibit-message)) (progn (doom--print (doom--format (apply #'format msg args)))))))) message))) (old (symbol-function #'message))) (unwind-protect (progn (fset #'message vnew) (unwind-protect (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))) (save-current-buffer (set-buffer log-buffer) (require 'ansi-color) (ansi-color-filter-region (point-min) (point-max))) (let ((dest doom--cli-log-buffer)) (cond ((bufferp dest) (save-current-buffer (set-buffer dest) (insert-buffer-substring log-buffer))) ((stringp dest) (make-directory (file-name-directory dest) 'parents) (let ((temp-file dest) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-buffer-substring log-buffer)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (kill-buffer log-buffer)))) (fset #'message old))))) (doom-cli-command-not-found-error (doom--print (doom--format (format (doom--output-class 'error "Command 'doom %s' not recognized") (string-join (cdr e) " ")))) (doom--print (doom--format (format "\nDid you mean one of these commands?"))) (apply #'doom-cli-execute "help" "--similar" (string-join (cdr e) " ")) 5) (doom-cli-wrong-number-of-arguments-error (let* ((--cl-rest-- (cdr e)) (route (if (= (length --cl-rest--) 5) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal 'wrong-number-of-arguments (list '(route opt arg n d) (length --cl-rest--))))) (opt (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (arg (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (n (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (d (car-safe --cl-rest--))) (progn (doom--print (doom--format (format (doom--output-class 'error "doom %s: %S requires %d arguments, but %d given\n") (mapconcat #'symbol-name route " ") arg n d))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (apply #'doom-cli-execute "help" (mapcar #'symbol-name route))))) 6) (doom-cli-unrecognized-option-error (let ((option (car (cdr e)))) (doom--print (doom--format (format (doom--output-class 'error "Unrecognized option: %S") option))) (if (string-match "^--[^=]+=\\(.+\\)$" option) (progn (doom--print (doom--format (format "The %S syntax isn't supported. Use '%s %s' instead." option (car (split-string option "=")) (match-string 1 option))))))) 7) (doom-cli-deprecated-error (let* ((commands (cdr e)) (route (if commands (car-safe (prog1 commands (setq commands (cdr commands)))) (signal 'wrong-number-of-arguments (list '(route . commands) (length commands)))))) (progn (doom--print (doom--format (format (doom--output-class 'warn "The 'doom %s' command was removed and replaced with:\n") (mapconcat #'symbol-name route " ")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let ((--dolist-tail-- commands)) (while --dolist-tail-- (let ((command (car --dolist-tail--))) (doom--print (doom--format (format (doom--output-class 'info "%s") command))) (setq --dolist-tail-- (cdr --dolist-tail--)))))))) 8) (user-error (doom--print (doom--format (format (doom--output-class 'warn "%s") (car (cdr e))))) 9)))) ((args "-f") (command . "upgrade") (debug-p . "-d") (auto-accept-p . "-y")))
- (funcall (closure ((plist) (aliases) (name . :doom) t) (--alist--) (ignore --alist--) (let ((help-p (cdr (assq 'help-p --alist--))) (auto-accept-p (cdr (assq 'auto-accept-p --alist--))) (debug-p (cdr (assq 'debug-p --alist--))) (loadfile (cdr (assq 'loadfile --alist--))) (doomdir (cdr (assq 'doomdir --alist--))) (localdir (cdr (assq 'localdir --alist--))) (nocolor (cdr (assq 'nocolor --alist--))) (command (cdr (assq 'command --alist--))) (args (cdr (assq 'args --alist--)))) (condition-case e (let* ((log-buffer (generate-new-buffer " *doom log*")) (standard-output #'(lambda (out) (save-current-buffer (set-buffer log-buffer) (insert-char out)) (send-string-to-terminal (char-to-string out))))) (let ((message (symbol-function #'message))) (ignore message) (let* ((vnew #'(lambda (msg &rest args) "\n\n(fn MSG &rest ARGS)" (progn (if msg (progn (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (save-current-buffer (set-buffer log-buffer) (insert (doom--format (apply #'format msg args)) "\n")) (if (or doom-debug-p (not inhibit-message)) (progn (doom--print (doom--format (apply #'format msg args)))))))) message))) (old (symbol-function #'message))) (unwind-protect (progn (fset #'message vnew) (unwind-protect (progn (if nocolor (progn (setq doom-output-backend nil))) (catch 'exit (if (and (not (getenv "__DOOMRESTART")) (or doomdir localdir debug-p auto-accept-p)) (progn (if doomdir (progn (setenv "DOOMDIR" (file-name-as-directory doomdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMDIR=%s") doomdir))))) (if localdir (progn (setenv "DOOMLOCALDIR" (file-name-as-directory localdir)) (doom--print (doom--format (format (doom--output-class 'info "DOOMLOCALDIR=%s") localdir))))) (if debug-p (progn (setenv "DEBUG" "1") (doom--print (doom--format (format (doom--output-class 'info "DEBUG=1")))))) (if auto-accept-p (progn (setenv "YES" auto-accept-p) (doom--print (doom--format (format (doom--output-class 'info "Confirmations auto-accept enabled")))))) (throw 'exit "__DOOMRESTART=1 $@"))) (if loadfile (progn (load (doom-path loadfile) nil t t))) (if help-p (progn (if command (progn (setq args (cons command args)))) (setq command "help"))) (cons t (if (null command) (doom-cli-execute "help") (let ((start-time (current-time))) (run-hooks 'doom-cli-pre-hook) (if (getenv "__DOOMRESTART") nil (doom--print (doom--format (format (doom--output-class 'start "Executing 'doom %s' with Emacs %s at %s") (string-join (cons (or (condition-case nil (progn (let ((cl-x (doom-cli-get command))) (progn (or (progn (and (memq (type-of cl-x) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cl-x))) (aref cl-x 1)))) (error nil)) command) args) " ") emacs-version (format-time-string "%Y-%m-%d %H:%M:%S"))))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let* ((result (and t (apply #'doom-cli-execute command args)))) (if result (progn (run-hooks 'doom-cli-post-hook) (doom--print (doom--format (format (doom--output-class 'success "Finished in %s") (let* ((duration (float-time (time-subtract (current-time) before-init-time))) (hours (/ (truncate duration) 60 60)) (minutes (- (/ (truncate duration) 60) (* hours 60))) (seconds (- duration (* hours 60 60) (* minutes 60)))) (string-join (delq nil (list (if (= 0 hours) nil (format "%dh" hours)) (if (= 0 minutes) nil (format "%dm" minutes)) (format (if (> duration 60) "%ds" "%.4fs") seconds)))))))) result) nil)))))))) (save-current-buffer (set-buffer log-buffer) (require 'ansi-color) (ansi-color-filter-region (point-min) (point-max))) (let ((dest doom--cli-log-buffer)) (cond ((bufferp dest) (save-current-buffer (set-buffer dest) (insert-buffer-substring log-buffer))) ((stringp dest) (make-directory (file-name-directory dest) 'parents) (let ((temp-file dest) (temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-buffer-substring log-buffer)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (kill-buffer log-buffer)))) (fset #'message old))))) (doom-cli-command-not-found-error (doom--print (doom--format (format (doom--output-class 'error "Command 'doom %s' not recognized") (string-join (cdr e) " ")))) (doom--print (doom--format (format "\nDid you mean one of these commands?"))) (apply #'doom-cli-execute "help" "--similar" (string-join (cdr e) " ")) 5) (doom-cli-wrong-number-of-arguments-error (let* ((--cl-rest-- (cdr e)) (route (if (= (length --cl-rest--) 5) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal 'wrong-number-of-arguments (list '(route opt arg n d) (length --cl-rest--))))) (opt (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (arg (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (n (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (d (car-safe --cl-rest--))) (progn (doom--print (doom--format (format (doom--output-class 'error "doom %s: %S requires %d arguments, but %d given\n") (mapconcat #'symbol-name route " ") arg n d))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (apply #'doom-cli-execute "help" (mapcar #'symbol-name route))))) 6) (doom-cli-unrecognized-option-error (let ((option (car (cdr e)))) (doom--print (doom--format (format (doom--output-class 'error "Unrecognized option: %S") option))) (if (string-match "^--[^=]+=\\(.+\\)$" option) (progn (doom--print (doom--format (format "The %S syntax isn't supported. Use '%s %s' instead." option (car (split-string option "=")) (match-string 1 option))))))) 7) (doom-cli-deprecated-error (let* ((commands (cdr e)) (route (if commands (car-safe (prog1 commands (setq commands (cdr commands)))) (signal 'wrong-number-of-arguments (list '(route . commands) (length commands)))))) (progn (doom--print (doom--format (format (doom--output-class 'warn "The 'doom %s' command was removed and replaced with:\n") (mapconcat #'symbol-name route " ")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (let ((--dolist-tail-- commands)) (while --dolist-tail-- (let ((command (car --dolist-tail--))) (doom--print (doom--format (format (doom--output-class 'info "%s") command))) (setq --dolist-tail-- (cdr --dolist-tail--)))))))) 8) (user-error (doom--print (doom--format (format (doom--output-class 'warn "%s") (car (cdr e))))) 9)))) ((args "-f") (command . "upgrade") (debug-p . "-d") (auto-accept-p . "-y")))
- (if cli (funcall (progn (or (progn (and (memq (type-of cli) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cli))) (aref cli 7)) (doom--cli-process cli (remq nil args))) (user-error "Couldn't find any %S command" command))
- (let* ((cli (and t (doom-cli-get command)))) (if cli (funcall (progn (or (progn (and (memq (type-of cli) cl-struct-doom-cli-tags) t)) (signal 'wrong-type-argument (list 'doom-cli cli))) (aref cli 7)) (doom--cli-process cli (remq nil args))) (user-error "Couldn't find any %S command" command)))
- (doom-cli-execute :doom "-y" "-d" "upgrade" "-f")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement