;; 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)
)
)
)
s))
-
;; You can not have a line starting with "From:" in a pure text
;; mail. The smtp server would add a leading character to prevent it.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; If we can, encrypt!
-(autoload 'mc-install-write-mode "mailcrypt" nil t)
-(autoload 'mc-install-read-mode "mailcrypt" nil t)
+;; (autoload 'mc-install-write-mode "mailcrypt" nil t)
+;; (autoload 'mc-install-read-mode "mailcrypt" nil t)
-(add-hook 'vm-mode-hook 'mc-install-read-mode)
-(add-hook 'vm-summary-mode-hook 'mc-install-read-mode)
-(add-hook 'vm-virtual-mode-hook 'mc-install-read-mode)
-(add-hook 'vm-mail-mode-hook 'mc-install-write-mode)
-(add-hook 'vm-presentation-mode-hook 'mc-install-read-mode)
+;; (add-hook 'vm-mode-hook 'mc-install-read-mode)
+;; (add-hook 'vm-summary-mode-hook 'mc-install-read-mode)
+;; (add-hook 'vm-virtual-mode-hook 'mc-install-read-mode)
+;; (add-hook 'vm-mail-mode-hook 'mc-install-write-mode)
+;; (add-hook 'vm-presentation-mode-hook 'mc-install-read-mode)
;; (defun ff/encrypt-mail-if-possible () (interactive)
;; (condition-case nil (mc-encrypt-message)
(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))))
(defun ff/compose-mail (&optional force-new)
- "Cycles through an existing buffers with major mode `mail-mode',
+ "Cycles through existing buffers with major mode `mail-mode',
or invoke `vm-compose-mail' if none can be found or if FORCE-NEW
is t."
(interactive "P")
(when (eq major-mode 'mail-mode) (bury-buffer))
(let ((buf (and (not force-new)
+ ;; (not (eq major-mode 'mail-mode))
(ff/first-buffer-in-mode (buffer-list) 'mail-mode))))
(if buf (switch-to-buffer buf)
(vm-compose-mail))))
(vm-pipe-message-to-command (concat "munpack -t -C " dir))
(message "Wrote files to %s" dir)
)
-
)
)