Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 567 lines (555 sloc) 24.629 kb
eba0338 @elibarzilay Initial import
authored
1 (add-to-list 'load-path
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
2 (concat eli-extras-dir "vm/vm-8.1.93a/lisp"))
eba0338 @elibarzilay Initial import
authored
3 (add-to-list 'Info-default-directory-list
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
4 (concat eli-extras-dir "vm/vm-8.1.93a/info"))
5
eba0338 @elibarzilay Initial import
authored
6 ;; these are needed before requiring vm, for some reason
7 (require 'vm)
8
9 (setq
10 ;; >> vm
11 vm-assimilate-new-messages-sorted nil
12 vm-init-file (concat main-mail-directory ".vm")
13 vm-preferences-file (concat main-mail-directory ".vm.preferences")
14 vm-folder-directory main-mail-directory
15 vm-primary-inbox (concat main-mail-directory "INBOX")
16 vm-crash-box (concat main-mail-directory "INBOX.crash")
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
17 vm-fetched-message-limit 10
18 vm-index-file-suffix nil ; disable index files
19 ;; vm-spool-files '("/var/spool/mail/eli") ; <-- set automatically
eba0338 @elibarzilay Initial import
authored
20 vm-spool-file-suffixes '(".spool") ; automatic spools
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
21 vm-crash-box-suffix ".crash" ; crash needed for the above
eba0338 @elibarzilay Initial import
authored
22 vm-auto-get-new-mail t
23 vm-mail-check-interval 60
24 ;; vm-default-folder-type 'From_
25 ;; vm-default-From_-folder-type 'From_
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
26 ;; vm-trust-From_-with-Content-Length nil
eba0338 @elibarzilay Initial import
authored
27 vm-default-new-folder-line-ending-type 'lf
28 vm-check-folder-types t
29 vm-convert-folder-types t
30 vm-visible-headers
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
31 '("Resent-"
32 "From:"
33 ;; "Sender:"
34 "To:"
35 "Apparently-To:"
36 "Cc:"
37 "Subject:"
38 "Date:"
39 "Reply-To:")
40 vm-invisible-header-regexp nil
eba0338 @elibarzilay Initial import
authored
41 vm-highlighted-header-regexp "From:\\|Subject:\\|Reply-To:"
42 vm-preview-lines 0
43 vm-preview-read-messages nil
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
44 vm-word-wrap-paragraphs nil ; why not use emacs word-wrapping?
45 ;; NEWS file says: "Set to nil to enable the usual filling functionality"
46 vm-word-wrap-paragraphs-in-reply nil ; doesn't work well
eba0338 @elibarzilay Initial import
authored
47 vm-fill-paragraphs-containing-long-lines nil ; cute, but too slow
48 vm-paragraph-fill-column 72
49 vm-display-using-mime t
50 ;; ?? vm-mime-ignore-mime-version t
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
51 ;; ?? vm-mime-require-mime-version-header nil
eba0338 @elibarzilay Initial import
authored
52 ;; ?? vm-mime-ignore-composite-type-opaque-transfer-encoding t
53 ;; ?? vm-mime-ignore-missing-multipart-boundary t
54 vm-send-using-mime t
55 vm-honor-mime-content-disposition t ; and see below: no images
56 vm-auto-decode-mime-messages t
57 vm-mime-decode-for-preview nil ; no preview lines anyway
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
58 vm-auto-displayed-mime-content-types
59 '("text" "multipart" "message/rfc822") ; no images
60 vm-auto-displayed-mime-content-type-exceptions '("image")
eba0338 @elibarzilay Initial import
authored
61 vm-mime-internal-content-types t
62 vm-mime-internal-content-type-exceptions '("text/calendar")
63 vm-mime-external-content-types-alist
7ec2e6c @elibarzilay A smart DWIM return binding for mime objects.
authored
64 '(("text/html" "firefox") ("image" "qiv") ("video" "mplayer"))
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
65 vm-mime-external-content-type-exceptions '()
eba0338 @elibarzilay Initial import
authored
66 vm-mime-delete-viewer-processes t
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
67 vm-mime-type-converter-alist
68 (cond
69 ;; ((findif 'file-exists-p '("/usr/bin/w3m" "/usr/local/bin/w3m"))
70 ;; ;; use w3m to render html->text
71 ;; (add-to-list 'vm-mime-internal-content-type-exceptions "text/html")
72 ;; '(("text/html" "text/plain" "w3m -T text/html -no-cookie -dump")))
73 ;; ((findif 'file-exists-p '("/usr/bin/lynx" "/usr/local/bin/lynx"))
74 ;; ;; use lynx to render html->text
75 ;; (add-to-list 'vm-mime-internal-content-type-exceptions "text/html")
76 ;; '(("text/html" "text/plain" "lynx -force_html -dump /dev/stdin")))
77 (t nil))
78 vm-mime-alternative-select-method
79 '(favorite-internal "text/plain" "text/html" "text")
80 vm-mime-text/html-handler 'auto-select
81 vm-mime-text/html-blocker "<img[^>]*\\s-src=."
82 vm-mime-text/html-blocker-exceptions '()
eba0338 @elibarzilay Initial import
authored
83 vm-mime-default-face-charsets t ; just show all, emacs can deal with a lot now
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
84 vm-mime-default-face-charset-exceptions '() ; maybe add spam fonts?
eba0338 @elibarzilay Initial import
authored
85 vm-mime-use-image-strips nil ; this can be very slow on big messages
86 ;; vm-mime-display-image-strips-incrementally t
87 ;; vm-imagemagick-convert-program "/usr/bin/convert"
88 ;; vm-imagemagick-identify-program "/usr/bin/identify"
89 vm-mime-delete-after-saving nil
90 vm-mime-confirm-delete t
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
91 vm-mime-savable-types '("application" "x-unknown" "application/x-gzip")
92 vm-mime-savable-type-exceptions '("text") ; maybe remove this?
93 vm-mime-deletable-types '("application" "x-unknown" "application/x-gzip")
94 vm-mime-deletable-type-exceptions '("text")
95 vm-mime-parts-display-separator "\n" ; maybe two newlines?
eba0338 @elibarzilay Initial import
authored
96 ;; vm-mime-8bit-text-transfer-encoding 'quoted-printable
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
97 ;; needed?-- vm-mime-8bit-composition-charset "utf-8" ; avoid 2022-jp encoding
eba0338 @elibarzilay Initial import
authored
98 vm-mime-composition-armor-from-lines t ; nice to not have `>From's
99 ;; vm-mime-encode-headers-type 'Q
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
100 vm-mime-max-message-size (* 19 1000 1000) ; split bigger messages
101 vm-mime-attachment-save-directory ; saved attachments to some temp
eba0338 @elibarzilay Initial import
authored
102 (expand-file-name
103 (findif
104 'file-accessible-directory-p
105 (let ((tmps '("tmp/" "temp/" "Temp/" "TMP/")))
106 (append (mapcar (lambda (x) (concat "~/" x)) tmps)
107 (mapcar (lambda (x) (concat main-mail-directory x)) tmps)))
108 "~/"))
109 vm-mime-attachment-source-directory (expand-file-name "~/")
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
110 ;; ?? vm-mime-all-attachments-directory nil
111 vm-mime-yank-attachments t ; leave only buttons (it'd be nice to remove too)
eba0338 @elibarzilay Initial import
authored
112 vm-infer-mime-types t
113 vm-mime-attachment-infer-type-for-text-attachments nil
114 vm-mime-avoid-folding-content-type t
115 vm-mime-base64-decoder-program "base64-decode"
116 vm-mime-base64-decoder-switches '()
117 vm-mime-base64-encoder-program "base64-encode"
118 vm-mime-base64-encoder-switches '()
119 vm-mime-qp-decoder-program "qp-decode"
120 vm-mime-qp-decoder-switches '()
121 vm-mime-qp-encoder-program "qp-encode"
122 vm-mime-qp-encoder-switches '()
123 vm-mime-uuencode-decoder-program "uudecode"
124 vm-mime-uuencode-decoder-switches '()
125 vm-auto-next-message t
126 vm-honor-page-delimiters nil
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
127 ;; vm-page-continuation-glyph "...press SPACE to see more..." ; prvws & pages
128 vm-expunge-before-quit nil
129 vm-expunge-before-save nil
eba0338 @elibarzilay Initial import
authored
130 vm-confirm-quit 0
131 vm-confirm-new-folders t
132 vm-delete-empty-folders t
133 ;; ?? vm-folder-file-precious-flag t
134 ;; ?? vm-flush-interval 90
135 vm-visit-when-saving 0
136 vm-virtual-mirror t
137 vm-included-text-prefix mail-yank-prefix
138 vm-keep-sent-messages 1
139 vm-confirm-mail-send nil
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
140 vm-mail-mode-hidden-headers '("References" "In-Reply-To" "X-Mailer")
141 vm-mail-header-insert-date t
142 vm-mail-header-insert-message-id t
143 vm-do-fcc-before-mime-encode nil ; fcc with encoded (includes attachments)
eba0338 @elibarzilay Initial import
authored
144 vm-reply-subject-prefix "Re: "
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
145 ;; vm-reply-include-presentation nil ; looks like it's not used in the code
146 vm-include-text-from-presentation t ; experimental? (this is actually used)
147 ;; works, but looks like it will send an image, only it doesn't include it
148 ;; ?? vm-in-reply-to-format "%i"
149 vm-included-mime-types-list nil ; include all types that are known
150 ;; could use: '("text/plain" "text/enriched" "message/rfc822")
151 ;; ?? vm-included-text-headers '()
152 ;; ?? vm-included-text-discard-header-regexp nil
eba0338 @elibarzilay Initial import
authored
153 vm-forwarding-subject-format "[Forwarded from %F] %s"
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
154 ;; ?? vm-forwarded-headers '()
155 ;; ?? vm-unforwarded-header-regexp "none-to-be-dropped"
156 vm-forwarding-digest-type "mime" ; nil => textually include it
157 ;; ?? vm-mime-forward-local-external-bodies nil
158 ;; ?? vm-burst-digest-messages-inherit-labels t
159 vm-digest-preamble-format "%F: %s"
160 vm-digest-center-preamble nil
161 ;; ?? vm-digest-identifier-header-format "X-Digest: %s\n"
162 vm-digest-burst-type "guess"
163 vm-digest-send-type "mime"
164 vm-summary-format "%n%*%a%-12.12F %-3.3m %2d %4S %I%s\n" ; function-S below
165 vm-summary-attachment-indicator "$" ; used with %P - but doesn't work
166 ;; vm-summary-attachment-mime-types '()
167 ;; vm-summary-attachment-mime-type-exceptions '()
168 vm-summary-arrow "->" ; broken: "vm-summary.el" expects this arrow only
eba0338 @elibarzilay Initial import
authored
169 vm-mouse-track-summary nil ; no annoying highlights
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
170 vm-summary-show-threads nil ; buffer-local anyway
171 vm-summary-thread-indentation-by-references t ; nil = parents in folder
eba0338 @elibarzilay Initial import
authored
172 vm-summary-thread-indent-level 2
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
173 vm-summary-maximum-thread-indentation 20
eba0338 @elibarzilay Initial import
authored
174 vm-thread-using-subject t
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
175 vm-sort-threads-by-youngest-date t
eba0338 @elibarzilay Initial import
authored
176 vm-summary-uninteresting-senders-arrow "To: "
177 vm-auto-center-summary 0
178 vm-subject-ignored-prefix "^ *\\(re: *\\)+"
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
179 vm-subject-ignored-suffix "\\( +[[(]\\(?:fwd\\|forward\\)[])]\\| \\)+$"
eba0338 @elibarzilay Initial import
authored
180 vm-subject-significant-chars nil
181 vm-folders-summary-database (concat main-mail-directory ".vm.folders.db")
182 vm-folders-summary-format " %12f %4t total, %n new, %u unread, %s spooled\n"
183 vm-folders-summary-directories (list main-mail-directory)
184 vm-mutable-windows t ; change windows, but
185 vm-mutable-frames nil ; no new frames
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
186 vm-raise-frame-at-startup nil ; and don't mess with my windows!
187 vm-frame-per-folder nil ; no frames, no no no.
eba0338 @elibarzilay Initial import
authored
188 vm-frame-per-summary nil
189 vm-frame-per-folders-summary nil
190 vm-frame-per-composition nil
191 vm-frame-per-edit nil
192 vm-frame-per-help nil
193 vm-frame-per-completion nil
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
194 vm-search-other-frames nil ; not this too
195 ;; ?? vm-image-directory nil
eba0338 @elibarzilay Initial import
authored
196 vm-popup-menu-on-mouse-3 t
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
197 ;; vm-url-retrieval-methods '(lynx wget fetch curl w3m) ; maybe disable with nil?
198 vm-url-browser 'browse-url ; 'vm-mouse-send-url-to-firefox
eba0338 @elibarzilay Initial import
authored
199 vm-url-search-limit 24000
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
200 ;; vm-display-xfaces nil ; bleh
eba0338 @elibarzilay Initial import
authored
201 vm-startup-with-summary t
202 vm-follow-summary-cursor t
203 vm-jump-to-new-messages nil
204 vm-jump-to-unread-messages nil
205 vm-skip-deleted-messages t
206 vm-skip-read-messages nil
207 vm-move-after-deleting 'x
208 vm-move-after-undeleting nil
209 vm-move-after-killing 'x
210 vm-delete-after-saving t
211 vm-delete-after-archiving nil
212 vm-delete-after-bursting t
213 vm-circular-folders nil
214 vm-search-using-regexps nil
215 vm-move-messages-physically nil
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
216 vm-edit-message-mode 'indented-text-mode
217 ;; vm-print-command "lpr"
218 ;; vm-print-command-switches '()
219 ;; ?? vm-strip-reply-headers nil
220 vm-mime-deleted-object-label "[Deleted %f (%d;%t)]\n"
221 vm-emit-messages-for-mime-decoding t ; shows only nontrivial decoding
eba0338 @elibarzilay Initial import
authored
222 vm-default-folder-permission-bits #o600
223 vm-coding-system-priorities '(utf-8 iso-8859-1 iso-8859-15)
224 vm-mime-ucs-list '(utf-8 ctext escape-quoted)
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
225 ;; vm-drop-buffer-name-chars "[^ a-zA-Z0-9.,_\"'+-]"
226 vm-buffer-name-limit 50
227 vm-summary-enable-thread-folding t ; \
228 vm-summary-show-thread-count t ; > Experimental
229 vm-summary-thread-folding-on-motion t ; /
230 vm-enable-thread-operations t
231 ;; vm-vs-attachment-regexp "^Content-Disposition: attachment"
232 vm-spam-words-file (concat main-mail-directory ".spam-words")
233 vm-vs-spam-score-headers
234 '(("X-Spam-Score:" "[-+]?[0-9]*\\.?[0-9]+" string-to-number)
235 ("X-Spam-Status:" "[-+]?[0-9]*\\.?[0-9]+" string-to-number)
236 ("X-Spam-Level:" "\\*+" length))
237 vm-enable-addons '(check-recipients check-for-empty-subject encode-headers)
238 vm-summary-enable-faces nil ; doesn't seem to work anyway
239 vm-mime-thumbnail-max-geometry "80x80"
240 vm-delete-message-action "vm-next-message"
241 ;; --- IMAP (all experimental)
242 vm-load-headers-only t ; effective only for IMAP
243 vm-imap-max-message-size (* 4 1024 1024)
244 vm-imap-messages-per-session nil
245 vm-imap-bytes-per-session nil
246 ;; vm-imap-expunge-after-retrieving t <-- "when used as a spool file"??
247 ;; vm-imap-auto-expunge-alist '()
248 vm-imap-folder-cache-directory
249 (findif 'file-accessible-directory-p
250 (list (concat main-mail-directory "imap/")))
251 vm-imap-save-to-server t
252 vm-imap-ensure-active-sessions t
253 vm-imap-sync-on-get t ; maybe set this to nil?
254 ;; >> vm/vm-faces
eba0338 @elibarzilay Initial import
authored
255 vm-highlighted-header-face (simple-make-face '*/h004-bold-underline)
256 vm-mime-button-face (simple-make-face 'cyan1/brown4-bold)
257 vm-summary-highlight-face (simple-make-face 'yellow/purple4-bold)
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
258 vm-highlight-url-face (simple-make-face 'bold-underline)
259 ;; >> vm/vm-summary-faces
260 ;; not working anyway
261 ;; vm-summary-faces-alist
262 ;; '(((or (header "Priority: urgent")
263 ;; (header "Importance: high")
264 ;; (header "X-Priority: 1")
265 ;; (label "!")
266 ;; (label "\\flagged")
267 ;; (header "X-VM-postponed-data:"))
268 ;; vm-summary-high-priority)
269 ;; ((deleted) vm-summary-deleted)
270 ;; ((new) vm-summary-new)
271 ;; ((unread) vm-summary-unread)
272 ;; ((marked) vm-summary-marked)
273 ;; ((replied) vm-summary-replied)
274 ;; ((or (filed) (written)) vm-summary-saved)
275 ;; ((or (forwarded) (redistributed)) vm-summary-forwarded)
276 ;; ((edited) vm-summary-edited)
277 ;; ((outgoing) vm-summary-outgoing)
278 ;; ((any) vm-summary-default))
279 ;; vm/vm-rfaddons
280 vm-fill-long-lines-in-reply-column nil
281 ;; vm-spamassassin-strip-report "spamassassin -d"
282 ;; ?? vm-mail-subject-prefix-replacements
283 ;; ?? '(("\\(\\(re\\|aw\\|antw\\)\\(\\[[0-9]+\\]\\)?:[ \t]*\\)+" . "Re: ")
284 ;; ?? ("\\(\\(fo\\|wg\\)\\(\\[[0-9]+\\]\\)?:[ \t]*\\)+" . "Fo: "))
285 ;; works only with (add-hook 'vm-mail-mode-hook 'vm-mail-subject-cleanup):
286 ;; vm-mail-subject-number-reply nil
287 ;; doesn't look useful:
288 ;; vm-handle-return-receipt-mode 'edit
289 ;; vm-handle-return-receipt-peek 500
290 ;; vm-mime-attach-files-in-directory-default-type nil
291 ;; vm-mime-attach-files-in-directory-default-charset 'guess
292 ;; vm-mime-auto-save-all-attachments-subdir nil
293 vm-mail-prompt-if-subject-empty t ; maybe do a hook that adds "(no subject)"?
294 vm-assimilate-html-command "striptags" ; is it needed with the include thing?
295 vm-assimilate-html-mixed t
296 ;; used only in `vm-mail-mode-citation-clean-up':
297 ;; vm-mail-mode-citation-kill-regexp-alist
298 ;; '(("^\\( > [|{}>:;][^\n]*\n\\)+" . "[...]\n")
299 ;; ("^\\([^|{}>:;]+.*\\)\n > [|{}>:;]*$" . "\\1")
300 ;; ("^ > [|{}>:;]*\n\\([^|{}>:;]\\)" . "\\1")
301 ;; ("^ > [|{}>:;]*\\s-*\n\\( > [|{}>:;]*\\s-*\n\\)+" . " > \n")
302 ;; ("\n\n\n+" . "\n\n")
303 ;; ("^ > --[^\n]*\n\\( > [^\n]*\n\\)+" . "\n")
304 ;; ("^ > ________[^\n]*\n\\( > [^\n]*\n\\)+" . "\n"))
305 vm-summary-attachment-label "$" ; does this have any effect?
306 vm-mail-mode-open-line-regexp "[ \t]*>"
307 ;; used only in `vm-mail-mode-elide-reply-region':
308 ;; vm-mail-mode-elide-reply-region "[...]\n"
309 ;; ??vm-mime-display-internal-multipart/mixed-separater
310 ;; "\n-----------------------------------------------------------------\n"
311 ;; ?? vm-mail-mode-fake-date-p t
eba0338 @elibarzilay Initial import
authored
312 )
313
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
314 ;; For times in quote attributions
315 (defun eli-reply-time-ago (msg msg-time real-msg-date)
316 (let* ((now-time (current-time))
317 (secs (round (- (time-to-seconds now-time)
318 (time-to-seconds msg-time))))
319 (mins (round secs 60))
320 (hrs (round secs (* 60 60)))
321 ;; days goes by the actual day (my timezone)
322 (days (- (time-to-days now-time) (time-to-days msg-time)))
323 (weeks (round days 7))
324 (msg-date (decode-time msg-time))
325 (dow (nth (nth 6 msg-date) '("Sunday" "Monday" "Tuesday" "Wednesday"
326 "Thursday" "Friday" "Saturday")))
327 (2str (lambda (n)
328 (case n ((1) "One") ((2) "Two") ((3) "Three") ((4) "Four")
329 (t (number-to-string n))))))
330 (cond
331 ;; includes negatives -- assume that it's always very recent
332 ((<= secs 45) "A few seconds ago")
333 ;; being precise isn't important
334 ((<= secs 90) "About a minute ago")
335 ((<= mins 10) (format "%s minutes ago" (funcall 2str mins)))
336 ((<= mins 30) (format "%s minutes ago"
337 (funcall 2str (* 5 (round mins 5)))))
338 ((<= mins 54) (format "%s minutes ago"
339 (funcall 2str (* 10 (round mins 10)))))
340 ((<= mins 75) "An hour ago")
341 ;; can't really say that it's 1 or 2 hours
342 ((<= mins 105) "An hour and a half ago")
343 ((<= hrs 12) (format "%s hours ago" (funcall 2str hrs)))
344 ;; more than this, and we switch to days (based on my timezone)
345 ((<= days 0) "Earlier today")
346 ((<= days 1) "Yesterday")
347 ;; this would be "shilshom"
348 ((<= days 2) (format "%s days ago" (funcall 2str days)))
349 ;; switch to the day's name
350 ((<= days 6) (format "On %s" dow))
351 ;; and now to a count of weeks
352 ((<= days 7) "A week ago")
353 ;; can't really say that it's a week
354 ((<= weeks 1) "More than a week ago")
355 ;; weeks are longer, so say "about"
356 ((<= weeks 3) (format "About %s weeks ago"
357 (downcase (funcall 2str weeks))))
358 ;; note that this counts by days
359 ((<= days 40) "About a month ago")
360 ;; finally switch to the date, same year => drop it
361 ;; (use the time from the message, might be different than in my zone)
362 (t (let ((D (nth 3 real-msg-date))
363 (M (nth 4 real-msg-date))
364 (Y (nth 5 real-msg-date)))
365 (concat
366 "On "
367 (nth (1- M) '("January" "February" "March" "April" "May" "June"
368 "July" "August" "September" "October" "November"
369 "December"))
370 " " (number-to-string D)
371 (if (= 1 (/ D 10)) "th"
372 (case (% D 10) ((1) "st") ((2) "nd") ((3) "rd") (t "th")))
373 (if (= (nth 5 (decode-time)) Y)
374 "" (concat " " (number-to-string Y)))))))))
375 (defun vm-summary-function-R (msg)
376 (let* ((author (vm-full-name-of msg))
377 (msg-time (vm-summary-sprintf "%y-%02M-%02d %h %z" msg))
378 (msg-time* (parse-time-string msg-time))
379 (msg-time (apply 'encode-time msg-time*)))
380 (format "%s, %s wrote:\n"
381 (eli-reply-time-ago msg msg-time msg-time*)
382 author)))
383 (setq vm-included-text-attribution-format "%UR")
384
eba0338 @elibarzilay Initial import
authored
385 (setq
386 vm-mode-line-format
387 '("" "%&%& "
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
388 (;; "VM " vm-version ": "
389 "VM: "
390 ;; (vm-folder-read-only "read-only ")
eba0338 @elibarzilay Initial import
authored
391 (vm-folder-read-only "READ-ONLY ")
392 (vm-virtual-folder-definition (vm-virtual-mirror "mirrored "))
393 "%b"
394 (vm-mail-buffer (vm-ml-sort-keys ("" " by " vm-ml-sort-keys)))
395 (vm-message-list
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
396 ;; (" " vm-ml-message-number " (of " vm-ml-highest-message-number ")")
eba0338 @elibarzilay Initial import
authored
397 (" " vm-ml-message-number "/" vm-ml-highest-message-number)
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
398 ;; (vm-folder-type " (unrecognized folder type)" " (no messages)")
399 (vm-folder-type " (UNRECOGNIZED FOLDER TYPE)" " (no messages)")))
eba0338 @elibarzilay Initial import
authored
400 (vm-spooled-mail-waiting " Mail")
401 (vm-message-list
402 (" %[ " vm-ml-message-attributes-alist
403 (vm-ml-labels ("; " vm-ml-labels)) " %] ")
404 (" %[%] "))
405 "%p" " " global-mode-string))
406
407 ;; Hack ignored from field using user-mail-address with and without local
408 ;; machine name. This must be done after loading Emacs, since it is only set
409 ;; then.
410 (let ((add (downcase
411 (if (string-match "^\\([^@]*\\)@[^.]*[.]\\(.*\\..*\\)$"
412 user-mail-address)
413 (concat (regexp-quote (match-string 1 user-mail-address))
414 "@\\([a-z]*\\.\\)?"
415 (regexp-quote (match-string 2 user-mail-address)))
416 (regexp-quote user-mail-address)))))
417 (setq vm-summary-uninteresting-senders
418 (if vm-summary-uninteresting-senders
419 (concat "\\(" add "\\|" vm-summary-uninteresting-senders "\\)")
420 add))
421 (add-to-list 'vm-reply-ignored-addresses add))
422
423 ;;; This detects standard signatures and selects them so it is easy to delete
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
424 ;;; them when replying, especially with delsel on. For now, just go there.
425 (defun citation-yank-goto-sig ()
426 "Goto the sig of a cited mail"
eba0338 @elibarzilay Initial import
authored
427 (interactive)
428 (let ((qprefix (regexp-quote vm-included-text-prefix)) end sig start)
429 (save-excursion
7ec2e6c @elibarzilay A smart DWIM return binding for mime objects.
authored
430 (goto-char (point-max))
eba0338 @elibarzilay Initial import
authored
431 (setq end (search-backward-regexp
432 "-- " (and (> (point) 400) (- (point) 400)) t))
433 (setq sig (and end (search-backward-regexp
434 (concat "^" qprefix "\\(-?-?[A-Za-z]+\\.?\\|-- *\\)$")
435 nil t)))
436 (when (and sig (> (count-lines sig end) 5))
437 (goto-char sig)
438 (setq sig nil))
439 (forward-line -1)
440 (while (looking-at "^[>|: \t]*$") (forward-line -1))
441 (forward-line 1)
442 (setq start (point)))
443 (when (and end start (> (1- end) start))
444 ;; (ensure-nomark)
445 (goto-char (1- end))
446 ;; (ensure-mark)
447 (goto-char start))))
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
448 (add-hook 'vm-reply-hook 'citation-yank-goto-sig)
eba0338 @elibarzilay Initial import
authored
449
450 ;; Keep the mail indication more useful when we're doing stuff
451 (add-hook 'vm-arrived-messages-hook 'display-time-update)
452 (add-hook 'vm-quit-hook 'display-time-update)
453
7ec2e6c @elibarzilay A smart DWIM return binding for mime objects.
authored
454 ;; A smart DWIM thing for mime objects
455 (defvar eli-vm-textual-block-delimiter-face
456 (simple-make-face 'yellow/h600-bold-underline))
457 (defun eli-vm-mime-operation ()
458 "Ask what to do with the current mime object."
459 (interactive)
460 (let* ((button (vm-mime-run-display-function-at-point 'identity))
461 (layout (vm-extent-property button 'vm-mime-layout))
462 (type (car (vm-mm-layout-type layout)))
463 (isimage (save-match-data (string-match "^image/" type)))
464 (external (let ((vm-mime-external-content-type-exceptions nil))
465 (vm-mime-find-external-viewer type)))
466 (internal (vm-mime-should-display-internal layout))
467 (ch (progn
468 (goto-char (vm-extent-start-position button))
469 (message
470 (concat "[s]ave, [d]elete, view as [i]nline "
471 (if isimage "image" "text")
472 " or"
473 " [e]xternally (with "
474 (prin1-to-string (if external (car external) "cat"))
475 ")"))
476 (downcase (read-char)))))
477 (case ch
478 ((?s)
479 (message "Saving...")
480 (call-interactively 'vm-mime-reader-map-save-message))
481 ((?d)
482 (message "Deleting...")
483 (call-interactively 'vm-delete-mime-object))
484 ((?i)
485 (message "Viewing as inline %s..." (if isimage "image" "text"))
486 (save-excursion
487 (let ((buffer-read-only nil) p)
488 (unless (bolp) (insert "\n"))
489 (setq p (point))
490 (insert "{{{----------")
491 (insert (format "%s" (vm-mm-layout-type layout)))
492 (insert "----------{{{\n")
493 (set-region-face p (point) eli-vm-textual-block-delimiter-face))
494 (if isimage
495 (let ((buffer-read-only nil))
496 (delete-region (vm-extent-start-position button)
497 (vm-extent-end-position button))
498 ;; don't insert the image here ...
499 (insert "\n"))
500 (vm-mime-display-body-as-text button))
501 (let ((buffer-read-only nil))
502 (unless (bolp) (insert "\n"))
503 (setq p (point))
504 (insert "}}}------------------------------}}}\n")
505 (set-region-face p (1- (point))
506 eli-vm-textual-block-delimiter-face)
507 (when isimage
508 ;; ... do it here so it appears between the markers
509 ;; (but don't do it for texts, since we won't know if a
510 ;; newline is needed until the text is there)
511 (goto-char (1- p))
512 (vm-mime-display-generic layout)))))
513 ((?e)
514 (message "Viewing with %s..." (if external (car external) "cat"))
515 (if external
516 (vm-mime-display-external-generic layout)
517 (let (;; HACK1: force it to hop into the window
518 (vm-mutable-windows nil)
519 (prev-win-conf (current-window-configuration)))
520 (vm-mime-pipe-body-to-command "cat" layout)
521 ;; HACK2: restore sanity, instead of an editable buffer
522 (run-with-idle-timer 0.01 nil
523 `(lambda ()
524 (goto-char (point-min))
525 ;; HACK3: exit back to prev conf (and cheat dynamic scope)
526 (view-mode-enter nil
527 (lambda (b)
528 (bury-buffer b)
529 (set-window-configuration ,prev-win-conf))))))))
530 ((?1) (vm-mime-display-internal-application/octet-stream layout))
531 ((?2) (vm-mime-display-generic layout))
532 (t (error "Huh?")))))
533
eba0338 @elibarzilay Initial import
authored
534 (defun vm-expunge-and-quit ()
535 (interactive)
536 (vm-expunge-folder)
537 (vm-quit))
538
7ec2e6c @elibarzilay A smart DWIM return binding for mime objects.
authored
539 (define-keys
540 vm-mode-map
eba0338 @elibarzilay Initial import
authored
541 '("#" vm-expunge-folder)
542 '("Q" vm-expunge-and-quit)
543 '("X" vm-quit-no-change)
544 '("x" vm-expunge-folder)
545 '("\t" vm-move-to-next-button)
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
546 '([(? )] vm-scroll-forward)
547 '([(shift ? )] vm-scroll-backward)
548 '([(control ?j)] vm-scroll-forward-one-line)
549 '([(control ?m)] vm-scroll-forward-one-line)
550 '([(return)] vm-scroll-forward-one-line)
551 '([(control shift ?j)] vm-scroll-backward-one-line)
552 '([(control shift ?m)] vm-scroll-backward-one-line)
553 '([(shift return)] vm-scroll-backward-one-line)
554 '("\\" vm-toggle-thread)
555 '("/" vm-toggle-thread)
7ec2e6c @elibarzilay A smart DWIM return binding for mime objects.
authored
556 '(save-buffer vm-save-folder)
557 ;;
558 vm-mime-reader-map
559 '([(return)] eli-vm-mime-operation))
7033f1f @elibarzilay Upgrade vm to 8.1.93a
authored
560
561 (add-hook 'vm-summary-mode-hook
562 ;; HACK: cua-set-rectable-mark cannot be overridden in a normal keymap, so
563 ;; instead the S-return key is bound to `eli-override-cua-set-rectangle-mark'
564 ;; which can be overridden via this buffer local variable
565 (lambda ()
566 (setq eli-override-cua-set-rectangle-mark 'vm-scroll-backward-one-line)))
Something went wrong with that request. Please try again.