Add func 'my-prevent-kill-buffer' and prevent kill '*scratch*' buffer.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 06 Oct 2011 11:35:21 +0300
changeset 719 694f7e388f2b
parent 718 19ab21ec7640
child 721 3eb929c032f4
Add func 'my-prevent-kill-buffer' and prevent kill '*scratch*' buffer.
.emacs-my
--- a/.emacs-my	Thu Oct 06 11:26:17 2011 +0300
+++ b/.emacs-my	Thu Oct 06 11:35:21 2011 +0300
@@ -393,6 +393,10 @@
  x-gtk-show-hidden-files t
  )
 
+(defun my-prevent-kill-buffer ()
+  (if (equal (buffer-name) "*scratch*") nil t))
+(add-to-list 'kill-buffer-query-functions 'my-prevent-kill-buffer)
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (message "switching, creating, selecting buffers")