X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=elisp.git;a=blobdiff_plain;f=vm;h=be89663f13d7cf416f6d5db4650e84b322820e5f;hp=6b4b1fba9e18422160119e4364593b775a9298f0;hb=41d67536a6418bc1b6259cc3f390b892cb931417;hpb=a7e48c45060cc7f5a339818f8b1e29884d925182 diff --git a/vm b/vm index 6b4b1fb..be89663 100644 --- a/vm +++ b/vm @@ -31,6 +31,24 @@ (add-to-list 'recentf-exclude "/tmp/mymail-vm-.*\.mbox") ) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Store and restore the window configuration + +(defadvice vm (before ff/store-window-configuration nil activate) + (unless (boundp '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) + (set-window-configuration ff/window-configuration-before-vm) + (makunbound 'ff/window-configuration-before-vm) + ) +) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (setq-default vm-summary-show-threads t) ;; (setq vm-preview-lines nil) @@ -162,6 +180,7 @@ ;; (add-to-list 'vm-mime-default-face-charsets "iso-8859-1") ;; (add-to-list 'vm-mime-default-face-charsets "Windows-1251") ;; (add-hook 'vm-mail-send-hook 'ff/vm-remove-non-7bits-in-headers) + (add-hook 'vm-mail-send-hook 'vm-mime-encode-headers) (add-hook 'vm-mail-send-hook 'vm-mail-check-recipients) (add-hook 'vm-reply-hook (lambda () (set-buffer-modified-p nil))) @@ -337,7 +356,8 @@ attachement from mail." (ff/configure-faces ;; '((ff/mail-header-face :background "#c8c8ff")) - '((ff/mail-header-face :foreground "blue4")) + '((ff/mail-header-face :background "#f0f0f0")) + ;; '((ff/mail-header-face :foreground "blue4")) ) (defun ff/colorize-headers () (interactive) @@ -488,6 +508,21 @@ an attachment") ) +(defun ff/check-no-prolematic-dest () + "Check that there are no \">,[^\ $]\" in the header" + (let ((s "no-subject")) + (save-excursion + (goto-char (point-min)) + (let ((end-header (re-search-forward (concat "^" mail-header-separator "$") nil t))) + (when end-header + (goto-char (point-min)) + (re-search-forward ">,[^\ ]" end-header t 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. @@ -671,7 +706,8 @@ instance, someone in bbdb named \"Paul Smith\" would generate an alias (when (>= emacs-major-version 22) (bbdb-insinuate-vm) - (ff/mail-aliases-from-bbdb)) + (ff/mail-aliases-from-bbdb) + ) ) (defun ff/pipe-to-tmp () (interactive)