Do not attempt at expunging read-only buffers automatically on quit.
authorFrancois Fleuret <francois@fleuret.org>
Fri, 1 Feb 2013 21:41:55 +0000 (22:41 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Fri, 1 Feb 2013 21:41:55 +0000 (22:41 +0100)
vm

diff --git a/vm b/vm
index f863e60..f2019a4 100644 (file)
--- a/vm
+++ b/vm
@@ -286,7 +286,10 @@ attachement from mail."
   (vm-delete-message 1)
   (condition-case nil (vm-next-message-no-skip 1) (error nil)))
 
-(add-hook 'vm-quit-hook 'vm-expunge-folder)
+(defun ff/vm-expunge-folder ()
+  (unless vm-folder-read-only (vm-expunge-folder)))
+
+(add-hook 'vm-quit-hook 'ff/vm-expunge-folder)
 (add-hook 'vm-quit-hook 'bbdb-save-db)
 (add-hook 'vm-retrieved-spooled-mail-hook 'display-time-update)