File: dot.vm-manoj-current

package info (click to toggle)
vm 6.47-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,704 kB
  • ctags: 1,521
  • sloc: lisp: 22,580; makefile: 260; sh: 201
file content (372 lines) | stat: -rw-r--r-- 12,291 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
;;; (load-file
;;;  (expand-file-name
;;;   (concat plgm-emacs-config-dir "/plgm-vmrc.elc")))

(require 'message)
;;; (setq vm-summary-format "%n %*%a %-17.17F %-3.3m %2d %4l/%-5c, %I\"%UA\"\n")
;;; (autoload 'mime/decode-string "tiny-mime" "Decode an RFC 1522 header")
;;; (defun vm-summary-function-A (m)
;;;   (mime/decode-string (vm-su-subject m)))


;;(require 'browse-url)
;;(defvaralias 'vm-url-browser 'browse-url-browser-function))
(setq-default vm-summary-show-threads t)

(setq
 vm-auto-center-summary 0
 vm-auto-decode-mime-messages t
 vm-auto-displayed-mime-content-types '("text" "multipart" "message/rfc822" )
 vm-crash-inbox (concat my-mail-dir "/INBOX.CRASH")
 vm-delete-after-archiving t
 vm-delete-after-bursting t
 vm-delete-after-saving t
 vm-folder-directory (concat my-mail-dir "/")
 vm-follow-summary-cursor t
 vm-forwarding-subject-format "Forwarded message from %F, %h %w,%d %m %y"
 vm-highlighted-header-regexp (if window-system nil "^From\\|^Subject")
 vm-honor-page-delimiters t
 vm-in-reply-to-format "%i:%F's message of %h %w,%d %m %y "
 vm-included-text-headers '("\\bFrom\\b" "\\bSubject\\b" "\\bDate\\b")
 vm-inhibit-startup-message t
 vm-keep-sent-messages 2
 vm-mail-header-from (or user-mail-address (concat (user-login-name)
						   "@datasync.com"))

 vm-move-after-deleting t
 vm-move-after-killing t
 vm-preferences-file "~/etc/vm.preferences"
 vm-popup-menu-on-mouse-3 nil
 vm-preview-read-messages nil
 vm-primary-inbox (concat my-mail-dir "/INBOX")
 vm-reply-ignored-addresses (list (concat "\\b" (regexp-quote
						 (user-login-name)) "\\b"))
 vm-reply-subject-prefix "Re: "
 vm-search-using-regexps t
 vm-skip-deleted-messages 0
 vm-skip-read-messages nil
 vm-spool-files
 (list
  (list "INBOX"  "~/mbox"  "INBOX.CRASH" )
  (list "INBOX" (concat "/usr/mail/" (user-login-name)) "INBOX.CRASH" )
  (list "INBOX" (concat "/usr/spool/mail/" (user-login-name))
	"INBOX.CRASH" )
  (list "INBOX" (concat real-home-directory "/var/spool/mail/important")
	"INBOX.CRASH" )
  (list "ADMIN" (concat real-home-directory "/var/spool/mail/admin")
	"ADMIN.CRASH")
  (list "BCAST" (concat real-home-directory "/var/spool/mail/bcast")
	"BCAST.CRASH")
  (list "CONSULT" (concat real-home-directory "/var/spool/mail/consult")
	"CONSULT.CRASH")
  (list "DIGITAL" (concat real-home-directory "/var/spool/mail/digital")
	"DIGITAL.CRASH")
  (list "spam" (concat real-home-directory "/var/spool/mail/spam")
	"spam.CRASH")
	)
 vm-startup-with-summary 1
 vm-strip-reply-headers t
 vm-summary-format "%2n %*%a %-17.17F %-3.3m %2d %4l/%-5c %I\"%s\"\n"
 vm-summary-uninteresting-senders (concat "\\b" (regexp-quote
						 (user-login-name)) "\\b")
 vm-summary-uninteresting-senders-arrow "==> "
 vm-use-menus t
 vm-visit-when-saving 'okay
 vm-virtual-folder-alist
 '(
   ("misc"
    (("ADMIN" "BCAST" "MISCBOX" ) ;;;;
     (any)))
   )
 vm-window-configuration-file "~/etc/vm.windows"
)
;;"%2n %*%a %-17.17F %-3.3m %2d %4l/%-5c \"%s\"\n"
;;"%2n %*%a %-17.17U %-3.3m %2d %4l/%-5c \"%s\"\n"

(defun my-vm-mode-function ()
  "Added quitting, no  backups, and load a few libs."
  (interactive)
  (make-local-variable 'version-control)
  (setq version-control 'never); keep minimal backups
;;  (load-library "jwz-vm-summary")
  (require 'sendmail)
  (load-library "ml-alias")
;;  (require 'vm-sort)
  (require 'message)
  (add-hook 'local-write-file-hooks 'bbdb-offer-save)
  )

(setq vm-mode-hooks 'my-vm-mode-function)
(add-hook 'vm-quit-hook 'vm-expunge-folder)
(add-hook 'vm-quit-hook 'bbdb-save-db)

;;; For a while, I used to do a BBDB save only when quitting out of my
;;; primary "in" box.  For that, I did this:
;;;   (add-hook 'vm-quit-hook
;;;           (function
;;;            (lambda ()
;;;              (if (string-equal (buffer-name (current-buffer)) "INBOX")
;;;                  (progn
;;;                    (bbdb-save-db))))))

(setq mail-yank-ignored-headers
      (concat
       "^Content-Length:\\|"
       "^Content-Type:\\|"
       "^Email-Version:\\|"
       "^End-of-Header:\\|"
       "^End-of-Protocol:\\|"
       "^Full-Name:\\|"
       "^Message-Version:\\|"
       "^Message-Service:\\|"
       "^Reply-Path:\\|"
       "^Reply-To:\\|"
       "^>To:\\|"
       "^UA-Content-ID:\\|"
       "^UA-Message-ID:\\|"
       "^X-at-.*:\\|"
       mail-yank-ignored-headers)
      )


(autoload 'bbdb/vm-update-record "bbdb-vm" nil t)

;;  (bbdb-insinuate-vm) ;; good stuff but defective now
(defun gec-vm-mode-hook ()
  (add-hook 'vm-select-message-hook 'bbdb/vm-update-record)
  (define-key vm-mode-map ":" 'bbdb/vm-show-sender)
  (define-key vm-mode-map ";" 'bbdb/vm-edit-notes)
  (define-key vm-mail-mode-map "\M-\t" 'bbdb-complete-name)
  (define-key vm-mode-map "\C-c\C-u" 'bbdb-update-from-body)
  )


(if need-BBDB
    (progn
      (makunbound 'vm-show-message-hook)
      (add-hook 'vm-mode-hooks 'gec-vm-mode-hook)
      ))


(defvar vm-ml-ids
	'(
	  "info-vm-request"
          "info-mm"
	  "ange-ftp-lovers"
	  "info-gnuplot-request"
	  "lucid-emacs"
	  "Gutenberg"
	  "hyperbole"
          "auc-tex"
	  "owner-supercite"
	  "fsp-discussion"
	  )
	"*List of strings naming the mailing lists that VM should know
 about. VM archives mailing-lists that appear in vm-mailing-lists in
 their own folder. See also info on function vm-make-mailinglist-regexp.")

(defun vm-make-mailing-list-regexp (listname)
       "This function is used only to construct the variable
 vm-auto-folder-alist. It returns the cons of a regexp and a
 foldername. The regexp is supposed to match the To, Cc, or Sender
 field in the message. The foldername is the LISTNAME prepended with
 \"M-\" and the result is used as the name of the folder to append the
 message to."
       (cons
	(concat
	 "\\<" listname
	 "\\|" (upcase listname)
	 "\\|" listname "-list"
	 "\\|" (upcase listname) "-LIST"
	 "\\>")
	(concat "M-" listname)))

(setq
 vm-auto-folder-alist
 (list
  ;; First we check if this is a mailing-list. The name of the
  ;; mailing-list is usually in the To-field, but sometimes in the Cc-
 ;; or Sender-field:


   (cons "To"     (mapcar 'vm-make-mailing-list-regexp vm-ml-ids))
   (cons "Cc"     (mapcar 'vm-make-mailing-list-regexp vm-ml-ids))
   (cons "Sender" (mapcar 'vm-make-mailing-list-regexp vm-ml-ids))
   ;; if it's not a mailing list, then use sender's name as folder name:
   (list "Newsgroups"
    (cons "gnu.emacs.sources"  "emacs")
    )
   (list "Subject"
    (cons ".*[oO]pen ?[lL]ook.*"  "xnews")
    (cons ".*\\(MOTIF\\|X11\\| X \\).*"  "x11")
    (cons ".*\\(OSF\\).*"  "osf1")
    (cons ".*[vV][mM].*"  "vm")
    (cons ".*[cC]\\+\\+.*"  "c++")
    (cons "Returned mail"  "Receipts")
    )
   (list "From"
	 (cons my-login-name-regexp
	       '(list (list "To"
			    '( "ART" . "gaylord")
			    ;; match id with IN%
			    '( "IN%\"\\([^>@%]+\\)" .
			       (buffer-substring
				(match-beginning 1) (match-end 1)))
			    ;; match id in <>
			    '( "<\\([^>@%]+\\)" .
			       (buffer-substring
				(match-beginning 1) (match-end 1)))
			    ;; match id with @
			    '( "\\([^@%:]+\\)[@%]" .
			       (buffer-substring
				(match-beginning 1) (match-end 1)))
			    ;; match id with ::
			    '("[^:]+\:\:\\(\\w+\\|\\w+\\W\\w+\\)" .
			      (buffer-substring
			       (match-beginning 1) (match-end 1)))
			    ;; match first word
			    '("\\(\\w+\\)" .
			      (buffer-substring
			       (match-beginning 1) (match-end 1)))
			    )

		  ))
	 '("IN%\"\\([^>@%]+\\)" .
	   (buffer-substring (match-beginning 1) (match-end 1)))
	 ;; Kyle's catch-all:
	 '( "ART" . "gaylord")
	 ;; match id with IN%
	 '("<\\([^ \t\n\f@%()<>]+\\)[@%]\\([^ \t\n\f<>()]+\\)>" .
	   (buffer-substring (match-beginning 1) (match-end 1)))
	 '("<\\([^>]+\\)>" .
	   (buffer-substring (match-beginning 1) (match-end 1)))
;;	 '("\\([^ \t\n\f@%()<>]+\\)\\([@%]\\([^ \t\n\f<>()]+\\)\\)?"
;;	   (buffer-substring (match-beginning 1) (match-end 1)))
    ;; match id in <>
	 '("<\\([^>@%]+\\)" .
	   (buffer-substring (match-beginning 1) (match-end 1)))
	 ;; match id with @
	 '("\\([^@%:]+\\)[@%]" .
	   (buffer-substring (match-beginning 1) (match-end 1)))
	 ;; match id with ::
	 '("[^:]+\:\:\\(\\w+\\|\\w+\\W\\w+\\)" .
	   (buffer-substring (match-beginning 1) (match-end 1)))
	 ;; match first word
	 '("\\(\\w+\\)" .
	   (buffer-substring (match-beginning 1) (match-end 1)))
	 )
   ))

(if (eq 'x window-system)
    (progn


      (defun vm-highlight-headers (message window)
	"Using font-lock; highlight From: and Subject: fields in mail
 messages displayed by VM."
	(save-excursion
	  ;; As of v18.52, this call to save-window-excursion is needed!
	  ;; Somehow window point can get fouled in here, and drag the
	  ;; buffer point along with it.  This problem only manifests
	  ;; itself when operating VM from the summary buffer, subsequent
	  ;; to using vm-beginning-of-message or vm-end-of-message.
	  ;; After running a next or previous message command, point
	  ;; somehow ends up at the end of the message.
	  (save-window-excursion
	    (font-lock-mode 1)
	    )))
      ))

;; Define the highlighting function. Basically just redefine the
;;  standard VM function so it uses font-lock buttons.
(defun my-vm-bbdb-mailto ()
"a completing-read function to use in the To:
field of msgs originated with VM."
(interactive)
(mail-to)
(insert (bbdb-read-addresses-with-completion "Name/id: ")))

(define-key vm-mail-mode-map "\C-c\C-ft" 'my-vm-bbdb-mailto)

(setq  tm-vm/automatic-mime-preview nil)
;;(require 'tm-vm)

(defun vm-folder-count ()
  "Count buffers visiting mail folders."
  (save-excursion
    (let ((folder-count 0))
      (mapcar (function
	       (lambda (buf)
		 (set-buffer buf)
		 (and (eq major-mode 'vm-mode)
		      (setq folder-count (+ folder-count 1)))))
	      (buffer-list))
      folder-count)))

;;; From: kyle_jones@wonderworks.com (Kyle Jones)

;;;  > Is there anyway I can get a 50/50 split on everything, without having to
;;;  > explicitly save to *all* window configurations?

;;; Yes.  You only need to save to the main classes: startup,
;;; reading-message, composing-message, editing-message, and for the
;;; command config for vm-summarize.

;;; ;;;;
;;; ;;;; Wastebasket support
;;; ;;;;
;;; ;;;; By default, deleted mail goes into the "wastebasket" directory,
;;; ;;;; which is a subdirectory of vm-folder-directory.  There is a
;;; ;;;; wastebasket file for each month; the file name format is
;;; ;;;; wastebasket-yymm.
;;; ;;;;

;;; (require 'cl)

;;; (defvar *vm-wastebasket-directory*
;;;   (concat (file-name-as-directory vm-folder-directory)
;;;           (format "wastebasket/wastebasket")))

;;; (defvar *vm-wastebasket-months*
;;;   '("Jan" "Feb" "Mar" "Apr" "May" "Jun"
;;;     "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"))

;;; (defvar *vm-wastebasket-date-regexp*
;;;   (concat "\\(" (mapconcat 'identity *vm-wastebasket-months* "\\|") "\\)"
;;;           ".*"
;;;           "[0-9][0-9]\\([0-9][0-9]\\)"))

;;; (defun vm-wastebasket ()
;;;   (format
;;;    "%s-%s"
;;;    *vm-wastebasket-directory*
;;;    (if (fboundp 'time-yymm)             ;Use my private hack first
;;;        (time-yymm)
;;;        (let ((time (current-time-string)))
;;;          (string-match *vm-wastebasket-date-regexp* time)
;;;          (unless (and (match-beginning 1) (match-beginning 2))
;;;            (error "Unable to extract month and year from current-time-string"))
;;;          (let* ((month (substring time (match-beginning 1) (match-end 1)))
;;;                 (month-number (1+ (position month *vm-wastebasket-months*
;;;                                             :test 'string-equal)))
;;;                 (year (substring time (match-beginning 2) (match-end 2))))
;;;            (concat year (format "%02d" month-number)))))))

;;; (defun vm-save-in-wastebasket (&rest ignore)
;;;   (interactive)
;;;   (vm-save-message (vm-wastebasket)))

;;; (defun vm-visit-wastebasket (prefix &optional read-only-p)
;;;   (interactive "P")
;;;   (vm-visit-folder (vm-wastebasket) (or prefix read-only-p)))

;;; ;;; Move the "d" key to "D", and add "T" to read the wastebasket
;;; (define-key vm-mode-map "D" 'vm-delete-message)
;;; (define-key vm-mode-map "d" 'vm-save-in-wastebasket)
;;; (define-key vm-mode-map "T" 'vm-visit-wastebasket)

;;; Local Variables:
;;; mode: emacs-lisp
;;; comment-start: ";;; "
;;; End: