Update.
[elisp.git] / vm
diff --git a/vm b/vm
index 7326c1b..eb25a97 100644 (file)
--- a/vm
+++ b/vm
 
 ;; Store and restore the window configuration
 
+(setq ff/window-configuration-before-vm nil)
+
 (defadvice vm (before ff/store-window-configuration nil activate)
-  (unless (boundp 'ff/window-configuration-before-vm)
+  (unless ff/window-configuration-before-vm
     (setq ff/window-configuration-before-vm (current-window-configuration)))
   )
 
 (defadvice vm-quit (after ff/restore-window-configuration nil activate)
-  (when (boundp 'ff/window-configuration-before-vm)
+  (when ff/window-configuration-before-vm
     (set-window-configuration ff/window-configuration-before-vm)
-    (makunbound 'ff/window-configuration-before-vm)
+    (setq ff/window-configuration-before-vm nil)
     )
   )
 
@@ -657,8 +659,10 @@ an attachment")
 
 (defun ff/first-buffer-in-mode (l m)
   (if l
-      (if (eq (save-excursion
-                (set-buffer (car l)) major-mode) m)
+      (if (eq
+           ;; (save-excursion (set-buffer (car l)) major-mode)
+           (with-current-buffer (car l) major-mode)
+           m)
           (car l)
         (ff/first-buffer-in-mode (cdr l) m))))