1. Fuco
  2. .emacs.d


Fuco  committed 5ffb453

Added advice to prevent me from accidentaly killing scratch buffers. It now asks y-or-n

  • Participants
  • Parent commits c71e934
  • Branches default

Comments (0)

Files changed (1)

File files/advices.el

View file
           (progn (forward-char 1)
                  (just-one-space 0)
                  (backward-char 1)))))
+(defadvice kill-this-buffer (around warn-if-scratch activate)
+  "Warn me if I want to kill a scratch buffer"
+  (if (string-match-p "\\\\*scratch" (buffer-name (current-buffer)))
+    (when (y-or-n-p "Do you want to kill this scratch buffer?")
+        ad-do-it)
+    ad-do-it))