From 7bbcc270cfcb7b677912d11679470437c7ca5714 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Wed, 18 Oct 2017 19:06:46 +0200 Subject: [PATCH] emacs - Add prompt for exit It will only continue if you type out "yes". Everything else is ignored. --- emacs/.emacs.d/init.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 2a65fec..0e87dc6 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -8,6 +8,15 @@ ;; Change all prompts to y or n (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 (defun nope () (interactive)