Do not attempt at expunging read-only buffers automatically on quit.
[elisp.git] / vm
diff --git a/vm b/vm
index 1c17c4e..f2019a4 100644 (file)
--- a/vm
+++ b/vm
@@ -14,7 +14,7 @@
 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.  ;;
 ;;                                                                       ;;
 ;; Written by and Copyright (C) Francois Fleuret                         ;;
-;; Contact < francois@fleuret.org > for comments & bug reports             ;;
+;; Contact <francois@fleuret.org> for comments & bug reports             ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (setq-default vm-summary-show-threads t)
@@ -75,7 +75,7 @@
       ;; vm-summary-format " %*%A %-3.3m %2d %5US %I%UA  %s\n"
       vm-summary-format " %*%a %-3.3m %2d %5US %I%UA  %s\n"
       ;; vm-highlighted-header-regexp "From:\\|Subject:\\|Cc:\\|To:\\|Bcc:\\|Reply-To:"
-      vm-highlighted-header-regexp "From:\\|Subject:"
+      vm-highlighted-header-regexp "From:\\|Subject:\\|Reply-To:"
 
       vm-auto-folder-case-fold-search t
 
@@ -98,7 +98,7 @@
       )
 
 ;; (add-to-list 'vm-visible-headers "From " t)
-;; (add-to-list 'vm-visible-headers "Reply-To:" t)
+(add-to-list 'vm-visible-headers "Reply-To:" t)
 ;; (add-to-list 'vm-visible-headers "X-Mailer:" t)
 ;; (add-to-list 'vm-visible-headers "X-from-in-bbdb:" t)
 ;; (add-to-list 'vm-visible-headers "Return-Path:")
@@ -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)