No interactive prompts in noninteractive mode

This commit is contained in:
Benson Chu 2023-02-27 21:15:23 -06:00
parent ff5a8274f9
commit d67c6e2984
2 changed files with 28 additions and 3 deletions

View file

@ -43,9 +43,16 @@
ec/my-variables-list)) ec/my-variables-list))
(add-to-list 'ec/my-variables-list (add-to-list 'ec/my-variables-list
(list ',type ,@args)) (list ',type ,@args))
(if (or override (not (boundp ,(car args)))) (if (not noninteractive)
,@body (if (or override (not (boundp ,(car args))))
(eval ,(car args))))) ,@body
(eval ,(car args)))
(when (not (featurep 'default-prompts))
(load (expand-file-name "prompts/default.el"
user-emacs-directory))
(message (format "%s: %s"
,@(last args)
,(car args)))))))
(defun-prompt ec/load-or-ask-pred predicate (sym prompt) (defun-prompt ec/load-or-ask-pred predicate (sym prompt)
(customize-save-variable sym (y-or-n-p prompt))) (customize-save-variable sym (y-or-n-p prompt)))

18
prompts/default.el Normal file
View file

@ -0,0 +1,18 @@
(custom-set-variables
'(my-ec/add-info-dir nil t)
'(my-ec/at-ti nil t)
'(my-ec/enable-exwm t t)
'(my-ec/is-wsl nil t)
'(my-ec/load-full-config t t)
'(my-ec/load-org-config t t)
'(my/is-plaintext-mega-folder t t)
'(my/keymap-key "\24" t)
'(my/keymap-key-key 20 t)
'(my/light-default nil t)
'(my/plaintext-mega-folder "/home/benson/MEGA/plaintext/" t)
'(my/plaintext-migration-folder "~/plaintext/" t)
'(my/puppet-p nil t)
'(org-agenda-files
'("/home/benson/plaintext/org/agenda/plan.org" "/home/benson/plaintext/org/agenda/refile.org" "/home/benson/plaintext/org/agenda/sandbox.org" "/home/benson/plaintext/org/agenda/dev.org" "/home/benson/plaintext/org/agenda/prod.org")))
(provide 'default-prompts)