emacs - Add prompt for exit

It will only continue if you type out "yes".
Everything else is ignored.
This commit is contained in:
madmaurice 2017-10-18 19:06:46 +02:00
parent 258c3d5046
commit 7bbcc270cf

View file

@ -8,6 +8,15 @@
;; Change all prompts to y or n ;; Change all prompts to y or n
(fset 'yes-or-no-p 'y-or-n-p) (fset 'yes-or-no-p 'y-or-n-p)
;; my prompt
(defun my/yes-or-whatever-p (prompt)
(string= "yes"
(downcase
(read-from-minibuffer
(concat prompt "(yes or whatever) ")))))
;; Ask if you want to quit emacs
(setq confirm-kill-emacs 'my/yes-or-whatever-p)
;; Nope function ;; Nope function
(defun nope () (defun nope ()
(interactive) (interactive)