-
-
Save remi-gelinas/ca51b5eb59f3aca7d765679d6cf8d9c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- lisp-interaction -*- | |
# vim: set ft=lisp: | |
(file-error "Creating directory") | |
(signal file-error ("Creating directory" "Permission denied" "/nix/store/y0rwwmkxvw7isb81g9x6nipyb8i4lwq4-doom-src/Executing git is not allowed; command line: rev-parse --git-path hooks")) | |
(files--ensure-directory "/nix/store/y0rwwmkxvw7isb81g9x6nipyb8i4lwq4-doom-src/Executing git is not allowed; command line: rev-parse --git-path hooks") | |
(make-directory "Executing git is not allowed; command line: rev-parse --git-path hooks" parents) | |
(let* ((default-directory doom-emacs-dir) (dir (cdr (doom-call-process "git" "rev-parse" "--git-path" "hooks")))) (make-directory dir 'parents) (let ((--dolist-tail-- '("commit-msg" "pre-push"))) (while --dolist-tail-- (let ((hook (car --dolist-tail--))) (let ((file (doom-path dir hook))) (if (and (file-exists-p file) noforce) nil (let ((temp-file file) (temp-buffer (generate-new-buffer " *temp file*"))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert "#!/usr/bin/env sh\n" (doom-path doom-emacs-dir "bin/doom") " --nocolor ci hook-" hook " \"$@\"")) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (set-file-modes file 448) (doom--print (doom--format (format (doom--output-class 'success "Created %s") (doom--output-class 'relpath file)))))) (setq --dolist-tail-- (cdr --dolist-tail--)))))) | |
(doom-cli--ci-deploy-hooks) | |
(let ((default-directory (doom-path "~"))) (if noconfig-p (doom--print (doom--format (format (doom--output-class 'warn "Not copying private config template, as requested")))) (if (and (not (file-directory-p doom-private-dir)) (not (getenv "DOOMDIR"))) (progn (let ((xdg-config-dir (or (getenv "XDG_CONFIG_HOME") "~/.config"))) (if (file-in-directory-p doom-emacs-dir xdg-config-dir) (progn (setq doom-private-dir (expand-file-name "doom/" xdg-config-dir))))))) (doom--print (doom--format (format (doom--output-class 'start "Creating %s") (doom--output-class 'relpath doom-private-dir)))) (make-directory doom-private-dir 'parents) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom--print (doom--format (format (doom--output-class 'success "Created %s") (doom--output-class 'relpath doom-private-dir))))) (mapc #'(lambda (file) (let* ((template file) (filename (if template (car-safe (prog1 template (setq template (cdr template)))) (signal 'wrong-number-of-arguments (list '(filename . template) (length template)))))) (if (let ((p (let ((file filename)) (and (stringp file) (let ((default-directory doom-private-dir)) (file-exists-p file)) file)))) (and p (expand-file-name p doom-private-dir))) (doom--print (doom--format (format (doom--output-class 'warn "%s already exists, skipping") filename))) (doom--print (doom--format (format (doom--output-class 'info "Creating %s%s") (doom--output-class 'relpath doom-private-dir) filename))) (let ((temp-file (doom-path doom-private-dir filename)) (temp-buffer (generate-new-buffer " *temp file*"))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-file-contents template)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (doom--print (doom--format (format (doom--output-class 'success "Done!"))))))) (list (cons "init.el" (doom-path doom-emacs-dir "init.example.el")) (cons "config.el" (doom-path doom-core-dir "templates/config.example.el")) (cons "packages.el" (doom-path doom-core-dir "templates/packages.example.el"))))) (doom-initialize-modules 'force 'no-config) (if noenv-p (doom--print (doom--format (format (doom--output-class 'warn "Not generating envvars file, as requested")))) (if (file-exists-p doom-env-file) (doom--print (doom--format (format (doom--output-class 'info "Envvar file already exists, skipping")))) (if (or doom-auto-accept (y-or-n-p "Generate an envvar file? (see `doom help env` for details)")) (progn (doom-cli-reload-env-file 'force-p))))) (if noinstall-p (doom--print (doom--format (format (doom--output-class 'warn "Not installing plugins, as requested")))) (doom--print (doom--format (format "Installing plugins"))) (doom-cli-packages-install)) (doom--print (doom--format (format "Regenerating autoloads files"))) (doom-autoloads-reload) (doom--print (doom--format (format "Deploying commit-msg and pre-push git hooks"))) (doom-cli--ci-deploy-hooks) (cond (nofonts-p) (IS-WINDOWS (doom--print (doom--format (format (doom--output-class 'warn "Doom cannot install all-the-icons' fonts on Windows!\n")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom--print (doom--format (format (concat "You'll have to do so manually:\n\n" " 1. Launch Doom Emacs\n" " 2. Execute 'M-x all-the-icons-install-fonts' to download the fonts\n" " 3. Open the download location in windows explorer\n" " 4. Open each font file to install them")))))) ((or doom-auto-accept (y-or-n-p "Download and install all-the-icon's fonts?")) (require 'all-the-icons) (let ((window-system (cond (IS-MAC 'ns) (IS-LINUX 'x)))) (all-the-icons-install-fonts 'yes)))) (if (file-exists-p "~/.emacs") (progn (doom--print (doom--format (format (doom--output-class 'warn "A ~/.emacs file was detected. This conflicts with Doom and should be deleted!")))))) (doom--print (doom--format (format (doom--output-class 'success "\nFinished! Doom is ready to go!\n")))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents (doom-path doom-core-dir "templates/QUICKSTART_INTRO")) (doom--print (doom--format (format "%s" (buffer-string))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) | |
(let ((noconfig-p (cdr (assq 'noconfig-p --alist--))) (noenv-p (cdr (assq 'noenv-p --alist--))) (noinstall-p (cdr (assq 'noinstall-p --alist--))) (nofonts-p (cdr (assq 'nofonts-p --alist--)))) (doom--print (doom--format (format (doom--output-color 'green "Installing Doom Emacs!\n")))) (let ((default-directory (doom-path "~"))) (if noconfig-p (doom--print (doom--format (format (doom--output-class 'warn "Not copying private config template, as requested")))) (if (and (not (file-directory-p doom-private-dir)) (not (getenv "DOOMDIR"))) (progn (let ((xdg-config-dir (or (getenv "XDG_CONFIG_HOME") "~/.config"))) (if (file-in-directory-p doom-emacs-dir xdg-config-dir) (progn (setq doom-private-dir (expand-file-name "doom/" xdg-config-dir))))))) (doom--print (doom--format (format (doom--output-class 'start "Creating %s") (doom--output-class 'relpath doom-private-dir)))) (make-directory doom-private-dir 'parents) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom--print (doom--format (format (doom--output-class 'success "Created %s") (doom--output-class 'relpath doom-private-dir))))) (mapc #'(lambda (file) (let* ((template file) (filename (if template (car-safe (prog1 template (setq template (cdr template)))) (signal 'wrong-number-of-arguments (list '(filename . template) (length template)))))) (if (let ((p (let ((file filename)) (and (stringp file) (let ((default-directory doom-private-dir)) (file-exists-p file)) file)))) (and p (expand-file-name p doom-private-dir))) (doom--print (doom--format (format (doom--output-class 'warn "%s already exists, skipping") filename))) (doom--print (doom--format (format (doom--output-class 'info "Creating %s%s") (doom--output-class 'relpath doom-private-dir) filename))) (let ((temp-file (doom-path doom-private-dir filename)) (temp-buffer (generate-new-buffer " *temp file*"))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-file-contents template)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (doom--print (doom--format (format (doom--output-class 'success "Done!"))))))) (list (cons "init.el" (doom-path doom-emacs-dir "init.example.el")) (cons "config.el" (doom-path doom-core-dir "templates/config.example.el")) (cons "packages.el" (doom-path doom-core-dir "templates/packages.example.el"))))) (doom-initialize-modules 'force 'no-config) (if noenv-p (doom--print (doom--format (format (doom--output-class 'warn "Not generating envvars file, as requested")))) (if (file-exists-p doom-env-file) (doom--print (doom--format (format (doom--output-class 'info "Envvar file already exists, skipping")))) (if (or doom-auto-accept (y-or-n-p "Generate an envvar file? (see `doom help env` for details)")) (progn (doom-cli-reload-env-file 'force-p))))) (if noinstall-p (doom--print (doom--format (format (doom--output-class 'warn "Not installing plugins, as requested")))) (doom--print (doom--format (format "Installing plugins"))) (doom-cli-packages-install)) (doom--print (doom--format (format "Regenerating autoloads files"))) (doom-autoloads-reload) (doom--print (doom--format (format "Deploying commit-msg and pre-push git hooks"))) (doom-cli--ci-deploy-hooks) (cond (nofonts-p) (IS-WINDOWS (doom--print (doom--format (format (doom--output-class 'warn "Doom cannot install all-the-icons' fonts on Windows!\n")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom--print (doom--format (format (concat "You'll have to do so manually:\n\n" " 1. Launch Doom Emacs\n" " 2. Execute 'M-x all-the-icons-install-fonts' to download the fonts\n" " 3. Open the download location in windows explorer\n" " 4. Open each font file to install them")))))) ((or doom-auto-accept (y-or-n-p "Download and install all-the-icon's fonts?")) (require 'all-the-icons) (let ((window-system (cond (IS-MAC 'ns) (IS-LINUX 'x)))) (all-the-icons-install-fonts 'yes)))) (if (file-exists-p "~/.emacs") (progn (doom--print (doom--format (format (doom--output-class 'warn "A ~/.emacs file was detected. This conflicts with Doom and should be deleted!")))))) (doom--print (doom--format (format (doom--output-class 'success "\nFinished! Doom is ready to go!\n")))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents (doom-path doom-core-dir "templates/QUICKSTART_INTRO")) (doom--print (doom--format (format "%s" (buffer-string))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))) | |
((closure ((plist) (aliases i) (name . install) t) (--alist--) (ignore --alist--) (let ((noconfig-p (cdr (assq 'noconfig-p --alist--))) (noenv-p (cdr (assq 'noenv-p --alist--))) (noinstall-p (cdr (assq 'noinstall-p --alist--))) (nofonts-p (cdr (assq 'nofonts-p --alist--)))) (doom--print (doom--format (format (doom--output-color 'green "Installing Doom Emacs!\n")))) (let ((default-directory (doom-path "~"))) (if noconfig-p (doom--print (doom--format (format (doom--output-class 'warn "Not copying private config template, as requested")))) (if (and (not (file-directory-p doom-private-dir)) (not (getenv "DOOMDIR"))) (progn (let ((xdg-config-dir (or (getenv "XDG_CONFIG_HOME") "~/.config"))) (if (file-in-directory-p doom-emacs-dir xdg-config-dir) (progn (setq doom-private-dir (expand-file-name "doom/" xdg-config-dir))))))) (doom--print (doom--format (format (doom--output-class 'start "Creating %s") (doom--output-class 'relpath doom-private-dir)))) (make-directory doom-private-dir 'parents) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom--print (doom--format (format (doom--output-class 'success "Created %s") (doom--output-class 'relpath doom-private-dir))))) (mapc #'(lambda (file) (let* ((template file) (filename (if template (car-safe (prog1 template (setq template (cdr template)))) (signal 'wrong-number-of-arguments (list '(filename . template) (length template)))))) (if (let ((p (let ((file filename)) (and (stringp file) (let ((default-directory doom-private-dir)) (file-exists-p file)) file)))) (and p (expand-file-name p doom-private-dir))) (doom--print (doom--format (format (doom--output-class 'warn "%s already exists, skipping") filename))) (doom--print (doom--format (format (doom--output-class 'info "Creating %s%s") (doom--output-class 'relpath doom-private-dir) filename))) (let ((temp-file (doom-path doom-private-dir filename)) (temp-buffer (generate-new-buffer " *temp file*"))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-file-contents template)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (doom--print (doom--format (format (doom--output-class 'success "Done!"))))))) (list (cons "init.el" (doom-path doom-emacs-dir "init.example.el")) (cons "config.el" (doom-path doom-core-dir "templates/config.example.el")) (cons "packages.el" (doom-path doom-core-dir "templates/packages.example.el"))))) (doom-initialize-modules 'force 'no-config) (if noenv-p (doom--print (doom--format (format (doom--output-class 'warn "Not generating envvars file, as requested")))) (if (file-exists-p doom-env-file) (doom--print (doom--format (format (doom--output-class 'info "Envvar file already exists, skipping")))) (if (or doom-auto-accept (y-or-n-p "Generate an envvar file? (see `doom help env` for details)")) (progn (doom-cli-reload-env-file 'force-p))))) (if noinstall-p (doom--print (doom--format (format (doom--output-class 'warn "Not installing plugins, as requested")))) (doom--print (doom--format (format "Installing plugins"))) (doom-cli-packages-install)) (doom--print (doom--format (format "Regenerating autoloads files"))) (doom-autoloads-reload) (doom--print (doom--format (format "Deploying commit-msg and pre-push git hooks"))) (doom-cli--ci-deploy-hooks) (cond (nofonts-p) (IS-WINDOWS (doom--print (doom--format (format (doom--output-class 'warn "Doom cannot install all-the-icons' fonts on Windows!\n")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom--print (doom--format (format (concat "You'll have to do so manually:\n\n" " 1. Launch Doom Emacs\n" " 2. Execute 'M-x all-the-icons-install-fonts' to download the fonts\n" " 3. Open the download location in windows explorer\n" " 4. Open each font file to install them")))))) ((or doom-auto-accept (y-or-n-p "Download and install all-the-icon's fonts?")) (require 'all-the-icons) (let ((window-system (cond (IS-MAC 'ns) (IS-LINUX 'x)))) (all-the-icons-install-fonts 'yes)))) (if (file-exists-p "~/.emacs") (progn (doom--print (doom--format (format (doom--output-class 'warn "A ~/.emacs file was detected. This conflicts with Doom and should be deleted!")))))) (doom--print (doom--format (format (doom--output-class 'success "\nFinished! Doom is ready to go!\n")))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents (doom-path doom-core-dir "templates/QUICKSTART_INTRO")) (doom--print (doom--format (format "%s" (buffer-string))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))) nil) | |
(funcall (closure ((plist) (aliases i) (name . install) t) (--alist--) (ignore --alist--) (let ((noconfig-p (cdr (assq 'noconfig-p --alist--))) (noenv-p (cdr (assq 'noenv-p --alist--))) (noinstall-p (cdr (assq 'noinstall-p --alist--))) (nofonts-p (cdr (assq 'nofonts-p --alist--)))) (doom--print (doom--format (format (doom--output-color 'green "Installing Doom Emacs!\n")))) (let ((default-directory (doom-path "~"))) (if noconfig-p (doom--print (doom--format (format (doom--output-class 'warn "Not copying private config template, as requested")))) (if (and (not (file-directory-p doom-private-dir)) (not (getenv "DOOMDIR"))) (progn (let ((xdg-config-dir (or (getenv "XDG_CONFIG_HOME") "~/.config"))) (if (file-in-directory-p doom-emacs-dir xdg-config-dir) (progn (setq doom-private-dir (expand-file-name "doom/" xdg-config-dir))))))) (doom--print (doom--format (format (doom--output-class 'start "Creating %s") (doom--output-class 'relpath doom-private-dir)))) (make-directory doom-private-dir 'parents) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom--print (doom--format (format (doom--output-class 'success "Created %s") (doom--output-class 'relpath doom-private-dir))))) (mapc #'(lambda (file) (let* ((template file) (filename (if template (car-safe (prog1 template (setq template (cdr template)))) (signal 'wrong-number-of-arguments (list '(filename . template) (length template)))))) (if (let ((p (let ((file filename)) (and (stringp file) (let ((default-directory doom-private-dir)) (file-exists-p file)) file)))) (and p (expand-file-name p doom-private-dir))) (doom--print (doom--format (format (doom--output-class 'warn "%s already exists, skipping") filename))) (doom--print (doom--format (format (doom--output-class 'info "Creating %s%s") (doom--output-class 'relpath doom-private-dir) filename))) (let ((temp-file (doom-path doom-private-dir filename)) (temp-buffer (generate-new-buffer " *temp file*"))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-file-contents template)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (doom--print (doom--format (format (doom--output-class 'success "Done!"))))))) (list (cons "init.el" (doom-path doom-emacs-dir "init.example.el")) (cons "config.el" (doom-path doom-core-dir "templates/config.example.el")) (cons "packages.el" (doom-path doom-core-dir "templates/packages.example.el"))))) (doom-initialize-modules 'force 'no-config) (if noenv-p (doom--print (doom--format (format (doom--output-class 'warn "Not generating envvars file, as requested")))) (if (file-exists-p doom-env-file) (doom--print (doom--format (format (doom--output-class 'info "Envvar file already exists, skipping")))) (if (or doom-auto-accept (y-or-n-p "Generate an envvar file? (see `doom help env` for details)")) (progn (doom-cli-reload-env-file 'force-p))))) (if noinstall-p (doom--print (doom--format (format (doom--output-class 'warn "Not installing plugins, as requested")))) (doom--print (doom--format (format "Installing plugins"))) (doom-cli-packages-install)) (doom--print (doom--format (format "Regenerating autoloads files"))) (doom-autoloads-reload) (doom--print (doom--format (format "Deploying commit-msg and pre-push git hooks"))) (doom-cli--ci-deploy-hooks) (cond (nofonts-p) (IS-WINDOWS (doom--print (doom--format (format (doom--output-class 'warn "Doom cannot install all-the-icons' fonts on Windows!\n")))) (let ((doom-output-indent (+ doom-output-indent-increment doom-output-indent))) (doom--print (doom--format (format (concat "You'll have to do so manually:\n\n" " 1. Launch Doom Emacs\n" " 2. Execute 'M-x all-the-icons-install-fonts' to download the fonts\n" " 3. Open the download location in windows explorer\n" " 4. Open each font file to install them")))))) ((or doom-auto-accept (y-or-n-p "Download and install all-the-icon's fonts?")) (require 'all-the-icons) (let ((window-system (cond (IS-MAC 'ns) (IS-LINUX 'x)))) (all-the-icons-install-fonts 'yes)))) (if (file-exists-p "~/.emacs") (progn (doom--print (doom--format (format (doom--output-class 'warn "A ~/.emacs file was detected. This conflicts with Doom and should be deleted!")))))) (doom--print (doom--format (format (doom--output-class 'success "\nFinished! Doom is ready to go!\n")))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents (doom-path doom-core-dir "templates/QUICKSTART_INTRO")) (doom--print (doom--format (format "%s" (buffer-string))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))) nil) | |
(if cli (funcall (progn (or (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 (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 "install") | |
(apply doom-cli-execute "install" nil) | |
(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 (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 (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 (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 (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 (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 (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*"))) (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 (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*"))) (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 (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*"))) (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 (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*"))) (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 (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*"))) (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 (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*"))) (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 (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*"))) (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 --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 (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*"))) (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 --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 (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*"))) (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 --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)))) ((command . "install"))) | |
(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 (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*"))) (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 --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)))) ((command . "install"))) | |
(if cli (funcall (progn (or (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 (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 "install") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment