summaryrefslogtreecommitdiff
path: root/dot_config/emacs/lisp/doom-quit.el
diff options
context:
space:
mode:
Diffstat (limited to 'dot_config/emacs/lisp/doom-quit.el')
-rw-r--r--dot_config/emacs/lisp/doom-quit.el62
1 files changed, 62 insertions, 0 deletions
diff --git a/dot_config/emacs/lisp/doom-quit.el b/dot_config/emacs/lisp/doom-quit.el
new file mode 100644
index 0000000..009aff0
--- /dev/null
+++ b/dot_config/emacs/lisp/doom-quit.el
@@ -0,0 +1,62 @@
+(defvar +doom-quit-messages
+ `(;; from Doom 1
+ "Please don't leave, there's more demons to toast!"
+ "Let's beat it -- This is turning into a bloodbath!"
+ ,(format "I wouldn't leave if I were you. %s is much worse."
+ (if (featurep :system 'windows) "DOS" "UNIX"))
+ "Don't leave yet -- There's a demon around that corner!"
+ "Ya know, next time you come in here I'm gonna toast ya."
+ "Go ahead and leave. See if I care."
+ "Are you sure you want to quit this great editor?"
+ ;; from Doom 2
+ ,(format "Don't go now, there's a dimensional shambler waiting at the %s prompt!"
+ (if (featurep :system 'windows) "DOS" "UNIX"))
+ "Get outta here and go back to your boring operating system."
+ "Look, bud. You leave now and you forfeit your body count!"
+ "Just leave. When you come back, I'll be waiting with a bat."
+ "You're lucky I don't smack you for thinking about leaving."
+ ;; from Portal
+ "Thank you for participating in this Aperture Science computer-aided enrichment activity."
+ "You can't fire me, I quit!"
+ "I don't know what you think you are doing, but I don't like it. I want you to stop."
+ "This isn't brave. It's murder. What did I ever do to you?"
+ "I'm the man who's going to burn your house down! With the lemons!"
+ "Okay, look. We've both said a lot of things you're going to regret..."
+ ;; Custom
+ "(setq nothing t everything 'permitted)"
+ "Emacs will remember that."
+ "Emacs, Emacs never changes."
+ "Hey! Hey, M-x listen!"
+ "It's not like I'll miss you or anything, b-baka!"
+ "Wake up, Mr. Stallman. Wake up and smell the ashes."
+ "You are *not* prepared!"
+ "Please don't go. The drones need you. They look up to you."
+ "Don't forget, you're here forever.")
+ "A list of quit messages, picked randomly by `+doom-quit'. Taken from
+http://doom.wikia.com/wiki/Quit_messages and elsewhere.")
+
+(defun +doom-quit-fn (&rest _)
+ (doom-quit-p
+ (format "%s %s"
+ (propertize (nth (random (length +doom-quit-messages))
+ +doom-quit-messages)
+ 'face '(italic default))
+ "Really quit Emacs?")))
+
+
+(defun doom-quit-p (&optional prompt)
+ (if use-dialog-box
+ (x-popup-dialog
+ t `("Really quit Emacs?"
+ ("Yes" . t)
+ ("Cancel" . nil)))
+ (let ((confirmed (y-or-n-p (format "%s" (or prompt "Really quit Emacs?")))))
+ (if confirmed
+ t
+ (progn
+ (message "Aborted")
+ nil)))))
+
+(setq confirm-kill-emacs #'+doom-quit-fn)
+
+(provide 'doom-quit)