X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=vm;h=fac1ae7cbe4ba2331defafe77f25aa9b23caa4ee;hb=0785fb27e9d9eeb8d19dd8e1bfad8e520b04bb4c;hp=6f41d75ba8516252b47cedce7f3af05aee29d6ce;hpb=5ba6c861c5c215cd9b3e1e1a15c2f01999ee329e;p=elisp.git diff --git a/vm b/vm index 6f41d75..fac1ae7 100644 --- a/vm +++ b/vm @@ -14,11 +14,26 @@ ;; along with this program. If not, see . ;; ;; ;; ;; Written by and Copyright (C) Francois Fleuret ;; -;; Contact < francois@fleuret.org > for comments & bug reports ;; +;; Contact for comments & bug reports ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq-default vm-summary-show-threads t) +;; (setq vm-preview-lines nil) + +;; (setq vm-auto-displayed-mime-content-types '("text"));; "multipart"));; "image/xpm" + +(setq vm-mime-thumbnail-max-geometry nil) + +(setq vm-auto-displayed-mime-content-types '( + "text" + ;; "image/jpeg" + ;; "image/png" + "multipart" + "message/rfc822" + )) + + (setq vm-startup-message-displayed t ;; Yes, we already saw it, no need to insist vm-use-menus nil vm-skip-deleted-messages nil @@ -34,11 +49,15 @@ vm-mutable-windows t vm-mutable-frames nil vm-summary-thread-indent-level 1 - vm-summary-uninteresting-senders-arrow "->" + ;; vm-summary-uninteresting-senders-arrow "->" + ;; vm-summary-uninteresting-senders-arrow "►" + vm-summary-uninteresting-senders-arrow ">" + ;; vm-summary-uninteresting-senders-arrow "➔" + ;; vm-summary-uninteresting-senders-arrow "➤" vm-summary-arrow "> " vm-included-text-prefix " > " vm-forwarding-digest-type "mime" - vm-mime-attachment-save-directory "~/" + vm-mime-attachment-save-directory "~/misc/attachments" vm-use-toolbar nil vm-frame-per-folder nil vm-frame-per-summary nil @@ -56,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 @@ -78,7 +97,8 @@ ) -;; (add-to-list 'vm-visible-headers "Reply-To:" t) +;; (add-to-list 'vm-visible-headers "From " 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:") @@ -94,17 +114,17 @@ vm-infer-mime-types t vm-mime-use-image-strips nil - vm-mime-base64-decoder-program "mimencode" - vm-mime-base64-decoder-switches '("-u") - vm-mime-base64-encoder-program "mimencode" + vm-mime-base64-decoder-program "base64" + vm-mime-base64-decoder-switches '("-d") + vm-mime-base64-encoder-program "base64" vm-mime-base64-encoder-switches '() - vm-auto-displayed-mime-content-types '( - ;; "plain text" - "text" - "multipart" - "image/xpm" - ) + ;; vm-auto-displayed-mime-content-types '( + ;; ;; "plain text" + ;; "text" + ;; "multipart" + ;; "image/xpm" + ;; ) ;; vm-auto-displayed-mime-content-type-exceptions '("text/html") @@ -117,7 +137,7 @@ ) ;; To force it to be converted to plain text - vm-mime-internal-content-type-exceptions '("text/html") + ;; vm-mime-internal-content-type-exceptions '("text/html") vm-mime-external-content-types-alist '( ("application/x-dvi" "xdvi") @@ -134,9 +154,12 @@ (require 'vm-rfaddons) +(setq vm-mime-default-face-charsets t) ;; (add-to-list 'vm-mime-default-face-charsets "utf-8") -(add-to-list 'vm-mime-default-face-charsets "iso-8859-1") +;; (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))) @@ -156,10 +179,10 @@ ;; "html2text -style pretty -nobs" ;; )) -(add-to-list 'vm-mime-type-converter-alist - '("text/html" "text/plain" - "html2text.sh" - )) +;; (add-to-list 'vm-mime-type-converter-alist + ;; '("text/html" "text/plain" + ;; "html2text.sh" + ;; )) (add-to-list 'vm-mime-type-converter-alist '("image" "image/xpm" @@ -177,15 +200,15 @@ ;; (add-hook 'vm-mail-send-hook 'ff/vm-remove-properties) -(defun ff/vm-mime-save-all-files (&optional delete) - "Save all the mail attachments. With delete argument, remove -the attachement from mail." - (interactive "P") - (let ((vm-mime-delete-after-saving delete)) - (while (and (vm-mime-reader-map-save-file) - (condition-case nil (vm-move-to-next-button 1) - (error nil))))) - ) +;; (defun ff/vm-mime-save-all-files (&optional delete) + ;; "Save all the mail attachments. With delete argument, remove +;; the attachement from mail." + ;; (interactive "P") + ;; (let ((vm-mime-delete-after-saving delete)) + ;; (while (and (vm-mime-reader-map-save-file) + ;; (condition-case nil (vm-move-to-next-button 1) + ;; (error nil))))) + ;; ) (defun ff/vm-mime-save-file (&optional delete) "Save the current attachement. With delete argument, remove the @@ -255,7 +278,9 @@ attachement from mail." (defun vm-summary-function-S (&optional message) (let ((s (string-to-int (vm-su-byte-count message)))) (if (> s 32768) - (propertize (concat (int-to-string (/ s 1024)) "k") 'face 'bold) + (propertize (concat (int-to-string (/ s 1024)) "k") + 'face 'italic + ) ""))) (defun ff/vm-delete-and-go-down () (interactive) @@ -263,7 +288,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) @@ -305,7 +333,8 @@ attachement from mail." ;; To have a slightly darker background for headers (ff/configure-faces - '((ff/mail-header-face :background "#c8c8ff")) + ;; '((ff/mail-header-face :background "#c8c8ff")) + '((ff/mail-header-face :foreground "blue4")) ) (defun ff/colorize-headers () (interactive) @@ -521,6 +550,11 @@ an attachment") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; If we can, encrypt! +(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) + ;; (defun ff/encrypt-mail-if-possible () (interactive) ;; (condition-case nil (mc-encrypt) ;; (error nil))) @@ -585,9 +619,9 @@ an attachment") (ff/first-buffer-in-mode (cdr l) m)))) (defun ff/compose-mail (&optional force-new) - "Switch to an existing buffer with major mode `mail-mode', + "Cycles through an existing buffers with major mode `mail-mode', or invoke `vm-compose-mail' if none can be found or if FORCE-NEW -is t. If already in a mail buffer, burry it and go to the next." +is t." (interactive "P") (when (eq major-mode 'mail-mode) (bury-buffer)) (let ((buf (and (not force-new) @@ -605,9 +639,6 @@ is t. If already in a mail buffer, burry it and go to the next." (when (load "bbdb-vm" t) - ;; (defadvice define-mail-abbrev (before ff/remove-explicit-name (name definition &optional from-mailrc-file) activate) - ;; (message "%s -> %s" name definition)) - (defun ff/mail-aliases-from-bbdb () "Creates automatically mail aliases from the bbdb records. For instance, someone in bbdb named \"Paul Smith\" would generate an alias @@ -618,7 +649,8 @@ instance, someone in bbdb named \"Paul Smith\" would generate an alias (let* ((record (car records)) (name (concat (elt record 0) " " (elt record 1))) (email (car (elt record 6))) - (alias (downcase (replace-regexp-in-string "\\([a-zA-Z]?\\)[^- ]*[- ]*" "\\1" name)))) + (alias (downcase (replace-regexp-in-string + "\\([a-zA-Z]?\\)[^- ]*[- ]*" "\\1" name)))) (if (and (> (length alias) 1) ;; Do not overwrite an existing alias (not (and mail-abbrevs (intern-soft alias mail-abbrevs))))