X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=vm;h=f863e60eca85a43de1c98e5ef231ddc9d0deb294;hb=85c4238d46e71c1ded36f9ba912d66a6de4db708;hp=319968dec3dbf3eede60bf3e9e93ad685b86c9d9;hpb=45e682fbdb4a5f3ba322498315ebb0e452e927f4;p=elisp.git
diff --git a/vm b/vm
index 319968d..f863e60 100644
--- a/vm
+++ b/vm
@@ -1,4 +1,4 @@
-;; -*-Emacs-Lisp-*-
+;; -*- mode: Emacs-Lisp; mode: rainbow; -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This program is free software: you can redistribute it and/or modify ;;
@@ -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
@@ -33,11 +48,16 @@
vm-confirm-new-folders t
vm-mutable-windows t
vm-mutable-frames nil
- vm-summary-uninteresting-senders-arrow "->"
+ 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-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
@@ -55,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
@@ -77,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:")
@@ -93,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")
@@ -116,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")
@@ -136,6 +157,7 @@
;; (add-to-list 'vm-mime-default-face-charsets "utf-8")
(add-to-list 'vm-mime-default-face-charsets "iso-8859-1")
+;; (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)))
@@ -145,15 +167,20 @@
;; (add-to-list 'vm-mime-type-converter-alist '("text/html" "text/plain" "cat"))
;; (add-to-list 'vm-mime-type-converter-alist '("text/html" "text/plain" "lynx -nolist -force_html -dump -stdin"))
+;; (add-to-list 'vm-mime-type-converter-alist
+;; '("text/html" "text/plain"
+;; "w3m -cols 75 -graph -dump -T text/html"
+;; ))
+
;; (add-to-list 'vm-mime-type-converter-alist
;; '("text/html" "text/plain"
- ;; "w3m -cols 75 -graph -dump -T text/html"
+ ;; "html2text -style pretty -nobs"
;; ))
-(add-to-list 'vm-mime-type-converter-alist
- '("text/html" "text/plain"
- "html2text -nobs"
- ))
+;; (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"
@@ -171,15 +198,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
@@ -249,7 +276,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)
@@ -299,7 +328,8 @@ attachement from mail."
;; To have a slightly darker background for headers
(ff/configure-faces
- '((ff/mail-header-face :background "#d0d0e8"))
+ ;; '((ff/mail-header-face :background "#c8c8ff"))
+ '((ff/mail-header-face :foreground "blue4"))
)
(defun ff/colorize-headers () (interactive)
@@ -313,8 +343,6 @@ attachement from mail."
;; (vm-matched-header-contents-end)
(point-min)
(point-at-bol)
- ;; '(face (:background "gray85"))
- ;; '(face (:background "gray50" :foreground "gray95"))
'(face ff/mail-header-face)
)
)))
@@ -322,6 +350,20 @@ attachement from mail."
(defadvice vm-highlight-headers (after ff/colorize-headers nil activate)
(ff/colorize-headers))
+(defun ff/highlight-important-words ()
+ (let ((inhibit-read-only t))
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "Fleuret" nil t)
+ (message "%d-%d" (match-beginning 0) (match-end 0))
+ ;; (add-text-properties (match-beginning 0) (match-end 0)
+ ;; '(face (:background "red"))
+ ;; )
+ ))
+ ))
+
+;; (add-hook 'vm-select-message-hook 'ff/highlight-important-words)
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; I want to have a file associated to every mail I am writing
@@ -334,7 +376,9 @@ attachement from mail."
(set-visited-file-name (format
"%s/mail-%s"
ff/vm-mail-draft-directory
- (format-time-string "%04Y%02m%02d-%02H%02M%02S" (current-time))))
+ (format-time-string
+ "%04Y%02m%02d-%02H%02M%02S"
+ (current-time))))
(set-buffer-modified-p nil)))
(add-hook 'mail-setup-hook 'ff/associate-file-to-vm-mail-buffer)
@@ -358,13 +402,14 @@ attachement from mail."
"Save the file under a new name and set the associated file to nil."
(let ((bn (buffer-file-name)))
(when bn
- (set-visited-file-name (concat (file-name-directory bn)
- "sent-"
- (file-name-nondirectory bn)
- "-"
- (replace-regexp-in-string "[^a-zA-Z0-9]+" "_"
- (ff/mail-header-field "Subject"))
- ))
+ (set-visited-file-name
+ (concat (file-name-directory bn)
+ "sent-"
+ (file-name-nondirectory bn)
+ "-"
+ (replace-regexp-in-string "[^a-zA-Z0-9]+" "_"
+ (ff/mail-header-field "Subject"))
+ ))
(save-buffer)
(set-visited-file-name nil))
)
@@ -398,7 +443,7 @@ attachement from mail."
(interactive "FFind file: \np")
- (if (string-match "^\\(mail\\|sent-mail\\)-[^/]+$"
+ (if (string-match "^\\(mail\\|sent\\)-[^/]+$"
(file-name-nondirectory filename))
(if (find-buffer-visiting filename)
@@ -500,9 +545,14 @@ 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)))
+;; (condition-case nil (mc-encrypt)
+;; (error nil)))
;; (add-hook 'vm-mail-send-hook 'ff/encrypt-mail-if-possible t)
@@ -564,9 +614,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)