comparison lisp/vm/vm-startup.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 05472e90ae02
children c0c698873ce1
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
1 ;;; Entry points for VM 1 ;;; Entry points for VM
2 ;;; Copyright (C) 1994-1997 Kyle E. Jones 2 ;;; Copyright (C) 1994, 1995 Kyle E. Jones
3 ;;; 3 ;;;
4 ;;; This program is free software; you can redistribute it and/or modify 4 ;;; This program is free software; you can redistribute it and/or modify
5 ;;; it under the terms of the GNU General Public License as published by 5 ;;; it under the terms of the GNU General Public License as published by
6 ;;; the Free Software Foundation; either version 1, or (at your option) 6 ;;; the Free Software Foundation; either version 1, or (at your option)
7 ;;; any later version. 7 ;;; any later version.
23 to the value of vm-primary-inbox. The folder buffer is put into VM 23 to the value of vm-primary-inbox. The folder buffer is put into VM
24 mode, a major mode for reading mail. 24 mode, a major mode for reading mail.
25 25
26 Prefix arg or optional second arg READ-ONLY non-nil indicates 26 Prefix arg or optional second arg READ-ONLY non-nil indicates
27 that the folder should be considered read only. No attribute 27 that the folder should be considered read only. No attribute
28 changes, message additions or deletions will be allowed in the 28 changes, messages additions or deletions will be allowed in the
29 visited folder. 29 visited folder.
30 30
31 Visiting the primary inbox causes any contents of the system mailbox to 31 Visiting the primary inbox causes any contents of the system mailbox to
32 be moved and appended to the resulting buffer. 32 be moved and appended to the resulting buffer.
33 33
59 (let ((default-directory 59 (let ((default-directory
60 (or (and vm-folder-directory 60 (or (and vm-folder-directory
61 (expand-file-name vm-folder-directory)) 61 (expand-file-name vm-folder-directory))
62 default-directory)) 62 default-directory))
63 (inhibit-local-variables t) 63 (inhibit-local-variables t)
64 (enable-local-variables nil) 64 (enable-local-variables nil))
65 ;; for XEmacs/Mule 65 (vm-unsaved-message "Reading %s..." file)
66 (coding-system-for-read 'no-conversion))
67 (message "Reading %s..." file)
68 (prog1 (find-file-noselect file) 66 (prog1 (find-file-noselect file)
69 ;; update folder history 67 ;; update folder history
70 (let ((item (or folder vm-primary-inbox))) 68 (let ((item (or folder vm-primary-inbox)))
71 (if (not (equal item (car vm-folder-history))) 69 (if (not (equal item (car vm-folder-history)))
72 (setq vm-folder-history 70 (setq vm-folder-history
73 (cons item vm-folder-history)))) 71 (cons item vm-folder-history))))
74 (message "Reading %s... done" file)))))))) 72 (vm-unsaved-message "Reading %s... done" file))))))))
75 (set-buffer folder-buffer) 73 (set-buffer folder-buffer)
76 ;; for XEmacs/MULE
77 ;;
78 ;; If the file coding system is not a no-conversion variant,
79 ;; make it so by encoding all the text, then setting
80 ;; the file coding system and decoding it.
81 ;; This is only possible if a file is visited and then vm-mode
82 ;; is run on it afterwards.
83 (defvar buffer-file-coding-system)
84 (if (and vm-xemacs-mule-p
85 (not (eq (get-coding-system buffer-file-coding-system)
86 (get-coding-system 'no-conversion-unix)))
87 (not (eq (get-coding-system buffer-file-coding-system)
88 (get-coding-system 'no-conversion-dos)))
89 (not (eq (get-coding-system buffer-file-coding-system)
90 (get-coding-system 'no-conversion-mac)))
91 (not (eq (get-coding-system buffer-file-coding-system)
92 (get-coding-system 'binary))))
93 (let ((buffer-read-only nil)
94 (omodified (buffer-modified-p)))
95 (unwind-protect
96 (progn
97 (encode-coding-region (point-min) (point-max)
98 buffer-file-coding-system)
99 (set-buffer-file-coding-system 'no-conversion nil)
100 (decode-coding-region (point-min) (point-max)
101 buffer-file-coding-system))
102 (set-buffer-modified-p omodified))))
103 (vm-check-for-killed-summary) 74 (vm-check-for-killed-summary)
104 (vm-check-for-killed-presentation)
105 ;; If the buffer's not modified then we know that there can be no 75 ;; If the buffer's not modified then we know that there can be no
106 ;; messages in the folder that are not on disk. 76 ;; messages in the folder that are not on disk.
107 (or (buffer-modified-p) (setq vm-messages-not-on-disk 0)) 77 (or (buffer-modified-p) (setq vm-messages-not-on-disk 0))
108 (setq first-time (not (eq major-mode 'vm-mode)) 78 (setq first-time (not (eq major-mode 'vm-mode))
109 preserve-auto-save-file (and buffer-file-name 79 preserve-auto-save-file (and buffer-file-name
113 buffer-file-name))) 83 buffer-file-name)))
114 ;; Force the folder to be read only if the auto 84 ;; Force the folder to be read only if the auto
115 ;; save file contains information the user might not 85 ;; save file contains information the user might not
116 ;; want overwritten, i.e. recover-file might be 86 ;; want overwritten, i.e. recover-file might be
117 ;; desired. What we want to avoid is an auto-save. 87 ;; desired. What we want to avoid is an auto-save.
118 ;; Making the folder read only will keep 88 ;; Making the folder read only will keep it
119 ;; subsequent actions from modifying the buffer in a 89 ;; subsequent actions from modifying the buffer in a
120 ;; way that triggers an auto save. 90 ;; way that triggers an auto save.
121 ;; 91 ;;
122 ;; Also force the folder read-only if it was read only and 92 ;; Also force the folder read-only if it was read only and
123 ;; not already in vm-mode, since there's probably a good 93 ;; not already in vm-mode, since there's probably a good
148 (vm-start-itimers-if-needed))) 118 (vm-start-itimers-if-needed)))
149 119
150 ;; make a new frame if the user wants one. reuse an 120 ;; make a new frame if the user wants one. reuse an
151 ;; existing frame that is showing this folder. 121 ;; existing frame that is showing this folder.
152 (if (and full-startup 122 (if (and full-startup
123 vm-frame-per-folder
124 (vm-multiple-frames-possible-p)
153 ;; this so that "emacs -f vm" doesn't create a frame. 125 ;; this so that "emacs -f vm" doesn't create a frame.
154 this-command) 126 this-command)
155 (apply 'vm-goto-new-folder-frame-maybe 127 (let ((w (or (vm-get-buffer-window (current-buffer))
156 (if folder '(folder) '(primary-folder folder)))) 128 ;; summary == folder for the purpose
157 129 ;; of frame reuse.
158 ;; raise frame if requested and apply startup window 130 (and vm-summary-buffer
159 ;; configuration. 131 (vm-get-buffer-window vm-summary-buffer)))))
160 (if full-startup 132 (if (null w)
161 (let ((buffer-to-display (or vm-summary-buffer 133 (progn
162 vm-presentation-buffer 134 (if folder
163 (current-buffer)))) 135 (vm-goto-new-frame 'folder)
164 (vm-display buffer-to-display buffer-to-display 136 (vm-goto-new-frame 'primary-folder 'folder))
165 (list this-command) 137 (vm-set-hooks-for-frame-deletion))
166 (list (or this-command 'vm) 'startup)) 138 (save-excursion
167 (if vm-raise-frame-at-startup 139 (select-window w)
168 (vm-raise-frame)))) 140 (and vm-warp-mouse-to-new-frame
169 141 (vm-warp-mouse-to-frame-maybe (vm-window-frame w)))))))
142
170 ;; say this NOW, before the non-previewers read a message, 143 ;; say this NOW, before the non-previewers read a message,
171 ;; alter the new message count and confuse themselves. 144 ;; alter the new message count and confuse themselves.
172 (if full-startup 145 (if full-startup
173 ;; save blurb so we can repeat it later as necessary. 146 ;; save blurb so we can repeat it later as necessary.
174 (setq totals-blurb (vm-emit-totals-blurb))) 147 (setq totals-blurb (vm-emit-totals-blurb)))
175 148
176 (vm-thoughtfully-select-message) 149 (vm-thoughtfully-select-message)
177 (vm-update-summary-and-mode-line) 150 (if vm-message-list
151 (vm-preview-current-message)
152 (vm-update-summary-and-mode-line))
153 (if full-startup
154 (vm-display (current-buffer) t nil nil))
178 ;; need to do this after any frame creation because the 155 ;; need to do this after any frame creation because the
179 ;; toolbar sets frame-specific height and width specifiers. 156 ;; toolbar sets frame-specific height and width specifiers.
180 (and (vm-toolbar-support-possible-p) vm-use-toolbar 157 (and full-startup (vm-toolbar-support-possible-p) vm-use-toolbar
181 (progn 158 (progn
182 (vm-toolbar-install-toolbar) 159 (vm-toolbar-install-toolbar)
183 (vm-toolbar-update-toolbar))) 160 (vm-toolbar-update-toolbar)))
184 161
185 (and vm-use-menus (vm-menu-support-possible-p) 162 (and vm-use-menus (vm-menu-support-possible-p)
186 (vm-menu-install-visited-folders-menu)) 163 (vm-menu-install-visited-folders-menu))
187 164
188 (if full-startup 165 (if full-startup
189 (progn 166 (save-excursion
190 (if (and (vm-should-generate-summary) 167 (vm-display (current-buffer) t nil nil)
168 (if (and (vm-should-generate-summary)
191 ;; don't generate a summary if recover-file is 169 ;; don't generate a summary if recover-file is
192 ;; likely to happen, since recover-file does 170 ;; likely to happen, since recover-file does
193 ;; nothing useful in a summary buffer. 171 ;; nothing useful in a summary buffer.
194 (not preserve-auto-save-file)) 172 (not preserve-auto-save-file))
195 (vm-summarize t nil)) 173 (vm-summarize t))
196 ;; raise the summary frame if the user wants frames 174 ;; People were confused that (vm) behaved differently
197 ;; raised and if there is a summary frame. 175 ;; than M-x vm. We used to list all the various VM
198 (if (and vm-summary-buffer 176 ;; startup commands here, but now we just accept any
199 vm-mutable-frames 177 ;; command and treat it as if it were VM. It's
200 vm-frame-per-summary 178 ;; probably just as well, since any command that
201 vm-raise-frame-at-startup) 179 ;; calls VM probably does want the window
202 (vm-raise-frame)) 180 ;; configuration to be setup.
203 ;; if vm-mutable-windows is nil, the startup 181 (vm-display nil nil (list this-command)
204 ;; configuration can't be applied, so do 182 (list (or this-command 'vm) 'startup))))
205 ;; something to get a VM buffer on the screen
206 (if vm-mutable-windows
207 (vm-display nil nil (list this-command)
208 (list (or this-command 'vm) 'startup))
209 (save-excursion
210 (switch-to-buffer (or vm-summary-buffer
211 vm-presentation-buffer
212 (current-buffer)))))))
213
214 (if vm-message-list
215 (vm-preview-current-message))
216 183
217 (run-hooks 'vm-visit-folder-hook) 184 (run-hooks 'vm-visit-folder-hook)
218 185
219 (if full-startup 186 (if full-startup
220 (message totals-blurb)) 187 (message totals-blurb))
230 (throw 'done t)) 197 (throw 'done t))
231 (if (and vm-auto-get-new-mail 198 (if (and vm-auto-get-new-mail
232 (not vm-block-new-mail) 199 (not vm-block-new-mail)
233 (not vm-folder-read-only)) 200 (not vm-folder-read-only))
234 (progn 201 (progn
235 (message "Checking for new mail for %s..." 202 (vm-unsaved-message "Checking for new mail for %s..."
236 (or buffer-file-name (buffer-name))) 203 (or buffer-file-name (buffer-name)))
237 (if (and (vm-get-spooled-mail t) (vm-assimilate-new-messages t)) 204 (if (and (vm-get-spooled-mail) (vm-assimilate-new-messages t))
238 (progn 205 (progn
239 (setq totals-blurb (vm-emit-totals-blurb)) 206 (setq totals-blurb (vm-emit-totals-blurb))
240 (if (vm-thoughtfully-select-message) 207 (if (vm-thoughtfully-select-message)
241 (vm-preview-current-message) 208 (vm-preview-current-message)
242 (vm-update-summary-and-mode-line)))) 209 (vm-update-summary-and-mode-line))))
243 (message totals-blurb))) 210 (message totals-blurb)))
244 211
245 ;; Display copyright and copying info unless 212 ;; Display copyright and copying info unless
246 ;; user says no. 213 ;; user says no.
247 (if (and (interactive-p) (not vm-startup-message-displayed)) 214 ;; Check this-command so we don't make the user wait if
215 ;; they call vm non-interactively from some other program.
216 (if (and (not vm-inhibit-startup-message)
217 (not vm-startup-message-displayed)
218 (or (memq this-command '(vm vm-visit-folder))
219 ;; for emacs -f vm
220 (null last-command)))
248 (progn 221 (progn
249 (vm-display-startup-message) 222 (vm-display-startup-message)
250 (if (not (input-pending-p)) 223 (if (not (input-pending-p))
251 (message totals-blurb))))))) 224 (message totals-blurb)))))))
252 225
278 (put 'vm-mode 'mode-class 'special) 251 (put 'vm-mode 'mode-class 'special)
279 252
280 (defun vm-mode (&optional read-only) 253 (defun vm-mode (&optional read-only)
281 "Major mode for reading mail. 254 "Major mode for reading mail.
282 255
283 This is VM 6.34. 256 This is VM 5.96 (beta).
284 257
285 Commands: 258 Commands:
286 h - summarize folder contents 259 h - summarize folder contents
287 C-t - toggle threads display 260 C-t - toggle threads display
288 261
318 B - resend the current message to another user. 291 B - resend the current message to another user.
319 c - continue composing the most recent message you were composing 292 c - continue composing the most recent message you were composing
320 293
321 @ - digestify and mail entire folder contents (the folder is not modified) 294 @ - digestify and mail entire folder contents (the folder is not modified)
322 * - burst a digest into individual messages, and append and assimilate these 295 * - burst a digest into individual messages, and append and assimilate these
323 messages into the current folder. 296 message into the current folder.
324 297
325 G - sort messages by various keys 298 G - sort messages by various keys
326 299
327 g - get any new mail that has arrived in the system mailbox 300 g - get any new mail that has arrived in the system mailbox
328 (new mail is appended to the disk and buffer copies of the 301 (new mail is appended to the disk and buffer copies of the
341 saved to disk if it is modified. new messages are changed 314 saved to disk if it is modified. new messages are changed
342 to be flagged as just unread. 315 to be flagged as just unread.
343 x - exit VM with no change to the folder 316 x - exit VM with no change to the folder
344 317
345 M N - use marks; the next vm command will affect only marked messages 318 M N - use marks; the next vm command will affect only marked messages
346 if it makes sense for the command to do so. These commands 319 if it makes sense for the command to do so
347 apply and remove marks to messages.
348 320
349 M M - mark the current message 321 M M - mark the current message
350 M U - unmark the current message 322 M U - unmark the current message
351 M m - mark all messages 323 M m - mark all messages
352 M u - unmark all messages 324 M u - unmark all messages
353 M C - mark messages matched by a virtual folder selector 325 M C - mark messages matches by a virtual folder selector
354 M c - unmark messages matched by a virtual folder selector 326 M c - unmark messages matches by a virtual folder selector
355 M T - mark thread tree rooted at the current message 327 M T - mark thread tree rooted at the current message
356 M t - unmark thread tree rooted at the current message 328 M t - unmark thread tree rooted at the current message
357 M S - mark messages with the same subject as the current message 329 M S - mark messages with the same subject as the current message
358 M s - unmark messages with the same subject as the current message 330 M s - unmark messages with the same subject as the current message
359 M A - mark messages with the same author as the current message 331 M A - mark messages with the same author as the current message
360 M a - unmark messages with the same author as the current message 332 M a - unmark messages with the same author as the current message
361 M R - mark messages within the point/mark region in the summary
362 M r - unmark messages within the point/mark region in the summary
363 333
364 M ? - partial help for mark commands 334 M ? - partial help for mark commands
365 335
366 W S - save the current window configuration to a name 336 W S - save the current window configuration to a name
367 W D - delete a window configuration 337 W D - delete a window configuration
377 V M - toggle whether this virtual folder's messages mirror the 347 V M - toggle whether this virtual folder's messages mirror the
378 underlying real messages' attributes. 348 underlying real messages' attributes.
379 V ? - help for virtual folder commands 349 V ? - help for virtual folder commands
380 350
381 C-_ - undo, special undo that retracts the most recent 351 C-_ - undo, special undo that retracts the most recent
382 changes in message attributes and labels. Expunges, 352 changes in message attributes and labels. Expunges
383 message edits, and saves cannot be undone. C-x u is 353 message edits, and saves cannot be undone. C-x u is
384 also bound to this command. 354 also bound to this command.
385 355
386 a - set message attributes 356 a - set message attributes
387 357
404 374
405 Variables: 375 Variables:
406 vm-arrived-message-hook 376 vm-arrived-message-hook
407 vm-arrived-messages-hook 377 vm-arrived-messages-hook
408 vm-auto-center-summary 378 vm-auto-center-summary
409 vm-auto-decode-mime-messages
410 vm-auto-displayed-mime-content-types
411 vm-auto-folder-alist 379 vm-auto-folder-alist
412 vm-auto-folder-case-fold-search 380 vm-auto-folder-case-fold-search
413 vm-auto-get-new-mail 381 vm-auto-get-new-mail
414 vm-auto-next-message 382 vm-auto-next-message
415 vm-berkeley-mail-compatibility 383 vm-berkeley-mail-compatibility
416 vm-burst-digest-messages-inherit-labels
417 vm-check-folder-types 384 vm-check-folder-types
385 vm-convert-folder-types
418 vm-circular-folders 386 vm-circular-folders
419 vm-confirm-new-folders 387 vm-confirm-new-folders
420 vm-confirm-quit 388 vm-confirm-quit
421 vm-convert-folder-types
422 vm-crash-box 389 vm-crash-box
423 vm-crash-box-suffix
424 vm-default-folder-type 390 vm-default-folder-type
425 vm-delete-after-archiving 391 vm-delete-after-archiving
426 vm-delete-after-bursting 392 vm-delete-after-bursting
427 vm-delete-after-saving 393 vm-delete-after-saving
428 vm-delete-empty-folders 394 vm-delete-empty-folders
429 vm-digest-burst-type 395 vm-digest-burst-type
430 vm-digest-center-preamble 396 vm-digest-center-preamble
431 vm-digest-preamble-format 397 vm-digest-preamble-format
432 vm-digest-send-type 398 vm-digest-send-type
433 vm-display-buffer-hook 399 vm-display-buffer-hook
434 vm-display-using-mime
435 vm-edit-message-hook 400 vm-edit-message-hook
436 vm-folder-directory 401 vm-folder-directory
437 vm-folder-read-only 402 vm-folder-read-only
438 vm-follow-summary-cursor 403 vm-follow-summary-cursor
439 vm-forward-message-hook 404 vm-forward-message-hook
440 vm-forwarded-headers 405 vm-forwarded-headers
441 vm-forwarding-digest-type 406 vm-forwarding-digest-type
442 vm-forwarding-subject-format 407 vm-forwarding-subject-format
443 vm-frame-parameter-alist 408 vm-frame-parameter-alist
444 vm-frame-per-completion
445 vm-frame-per-composition 409 vm-frame-per-composition
446 vm-frame-per-edit
447 vm-frame-per-folder 410 vm-frame-per-folder
448 vm-frame-per-help
449 vm-frame-per-summary
450 vm-highlighted-header-face 411 vm-highlighted-header-face
451 vm-highlighted-header-regexp 412 vm-highlighted-header-regexp
452 vm-honor-page-delimiters 413 vm-honor-page-delimiters
453 vm-image-directory
454 vm-in-reply-to-format 414 vm-in-reply-to-format
455 vm-included-text-attribution-format 415 vm-included-text-attribution-format
456 vm-included-text-discard-header-regexp 416 vm-included-text-discard-header-regexp
457 vm-included-text-headers 417 vm-included-text-headers
458 vm-included-text-prefix 418 vm-included-text-prefix
419 vm-inhibit-startup-message
459 vm-invisible-header-regexp 420 vm-invisible-header-regexp
460 vm-jump-to-new-messages 421 vm-jump-to-new-messages
461 vm-jump-to-unread-messages 422 vm-jump-to-unread-messages
423 vm-keep-sent-messages
462 vm-keep-crash-boxes 424 vm-keep-crash-boxes
463 vm-keep-sent-messages
464 vm-mail-check-interval
465 vm-mail-header-from 425 vm-mail-header-from
466 vm-mail-mode-hook 426 vm-mail-mode-hook
467 vm-make-crash-box-name
468 vm-make-spool-file-name
469 vm-mime-8bit-composition-charset
470 vm-mime-8bit-text-transfer-encoding
471 vm-mime-alternative-select-method
472 vm-mime-attachment-auto-type-alist
473 vm-mime-attachment-save-directory
474 vm-mime-avoid-folding-content-type
475 vm-mime-base64-decoder-program
476 vm-mime-base64-decoder-switches
477 vm-mime-base64-encoder-program
478 vm-mime-base64-encoder-switches
479 vm-mime-button-face
480 vm-mime-charset-font-alist
481 vm-mime-default-face-charsets
482 vm-mime-digest-discard-header-regexp
483 vm-mime-digest-headers
484 vm-mime-display-function
485 vm-mime-external-content-types-alist
486 vm-mime-ignore-mime-version
487 vm-mime-internal-content-types
488 vm-mime-max-message-size
489 vm-mode-hook 427 vm-mode-hook
490 vm-mosaic-program 428 vm-mosaic-program
491 vm-mosaic-program-switches
492 vm-move-after-deleting 429 vm-move-after-deleting
493 vm-move-after-killing
494 vm-move-after-undeleting 430 vm-move-after-undeleting
495 vm-move-messages-physically 431 vm-move-messages-physically
432 vm-mutable-windows
496 vm-mutable-frames 433 vm-mutable-frames
497 vm-mutable-windows
498 vm-netscape-program 434 vm-netscape-program
499 vm-netscape-program-switches 435 vm-options-file
500 vm-pop-bytes-per-session
501 vm-pop-max-message-size
502 vm-pop-md5-program 436 vm-pop-md5-program
503 vm-pop-messages-per-session
504 vm-popup-menu-on-mouse-3
505 vm-preferences-file
506 vm-preview-lines 437 vm-preview-lines
507 vm-preview-read-messages 438 vm-preview-read-messages
508 vm-primary-inbox 439 vm-primary-inbox
509 vm-quit-hook 440 vm-quit-hook
510 vm-recognize-pop-maildrops 441 vm-recognize-pop-maildrops
511 vm-reply-hook 442 vm-reply-hook
443 vm-reply-ignored-reply-tos
512 vm-reply-ignored-addresses 444 vm-reply-ignored-addresses
513 vm-reply-ignored-reply-tos
514 vm-reply-subject-prefix 445 vm-reply-subject-prefix
515 vm-resend-bounced-discard-header-regexp 446 vm-resend-bounced-discard-header-regexp
516 vm-resend-bounced-headers 447 vm-resend-bounced-headers
517 vm-resend-bounced-message-hook 448 vm-resend-bounced-message-hook
518 vm-resend-discard-header-regexp 449 vm-resend-discard-header-regexp
526 vm-search-using-regexps 457 vm-search-using-regexps
527 vm-select-message-hook 458 vm-select-message-hook
528 vm-select-new-message-hook 459 vm-select-new-message-hook
529 vm-select-unread-message-hook 460 vm-select-unread-message-hook
530 vm-send-digest-hook 461 vm-send-digest-hook
531 vm-send-using-mime
532 vm-skip-deleted-messages 462 vm-skip-deleted-messages
533 vm-skip-read-messages 463 vm-skip-read-messages
534 vm-spool-file-suffixes
535 vm-spool-files 464 vm-spool-files
536 vm-startup-with-summary 465 vm-startup-with-summary
537 vm-strip-reply-headers 466 vm-strip-reply-headers
538 vm-summary-arrow 467 vm-summary-arrow
539 vm-summary-format 468 vm-summary-format
540 vm-summary-highlight-face 469 vm-summary-highlight-face
541 vm-summary-mode-hook 470 vm-summary-mode-hook
542 vm-summary-redo-hook 471 vm-summary-redo-hook
543 vm-summary-show-threads 472 vm-summary-show-threads
473 vm-summary-subject-no-newlines
544 vm-summary-thread-indent-level 474 vm-summary-thread-indent-level
545 vm-tale-is-an-idiot
546 vm-temp-file-directory
547 vm-toolbar-pixmap-directory
548 vm-trust-From_-with-Content-Length 475 vm-trust-From_-with-Content-Length
549 vm-undisplay-buffer-hook 476 vm-undisplay-buffer-hook
550 vm-unforwarded-header-regexp 477 vm-unforwarded-header-regexp
551 vm-url-browser 478 vm-url-browser
552 vm-url-search-limit 479 vm-url-search-limit
553 vm-use-menus 480 vm-use-menus
554 vm-use-toolbar
555 vm-virtual-folder-alist 481 vm-virtual-folder-alist
556 vm-virtual-mirror 482 vm-virtual-mirror
557 vm-visible-headers 483 vm-visible-headers
558 vm-visit-folder-hook 484 vm-visit-folder-hook
559 vm-visit-when-saving 485 vm-visit-when-saving
669 595
670 vm-virtual-mode is not a normal major mode. If you run it, it 596 vm-virtual-mode is not a normal major mode. If you run it, it
671 will not do anything. The entry point to vm-virtual-mode is 597 will not do anything. The entry point to vm-virtual-mode is
672 vm-visit-virtual-folder.") 598 vm-visit-virtual-folder.")
673 599
674 (defvar scroll-in-place)
675
676 (defun vm-visit-virtual-folder (folder-name &optional read-only) 600 (defun vm-visit-virtual-folder (folder-name &optional read-only)
677 (interactive 601 (interactive
678 (let ((last-command last-command) 602 (let ((last-command last-command)
679 (this-command this-command)) 603 (this-command this-command))
680 (vm-session-initialization) 604 (vm-session-initialization)
703 buffer-read-only t 627 buffer-read-only t
704 vm-folder-read-only read-only 628 vm-folder-read-only read-only
705 vm-label-obarray (make-vector 29 0) 629 vm-label-obarray (make-vector 29 0)
706 vm-virtual-folder-definition 630 vm-virtual-folder-definition
707 (assoc folder-name vm-virtual-folder-alist)) 631 (assoc folder-name vm-virtual-folder-alist))
708 ;; scroll in place messes with scroll-up and this loses
709 (make-local-variable 'scroll-in-place)
710 (setq scroll-in-place nil)
711 (vm-build-virtual-message-list nil) 632 (vm-build-virtual-message-list nil)
712 (use-local-map vm-mode-map) 633 (use-local-map vm-mode-map)
713 (and (vm-menu-support-possible-p) 634 (and (vm-menu-support-possible-p)
714 (vm-menu-install-menus)) 635 (vm-menu-install-menus))
715 (add-hook 'kill-buffer-hook 'vm-garbage-collect-folder)
716 (add-hook 'kill-buffer-hook 'vm-garbage-collect-message)
717 ;; save this for last in case the user interrupts. 636 ;; save this for last in case the user interrupts.
718 ;; an interrupt anywhere before this point will cause 637 ;; an interrupt anywhere before this point will cause
719 ;; everything to be redone next revisit. 638 ;; everything to be redone next revisit.
720 (setq major-mode 'vm-virtual-mode) 639 (setq major-mode 'vm-virtual-mode)
721 (run-hooks 'vm-virtual-mode-hook) 640 (run-hooks 'vm-virtual-mode-hook)
722 ;; must come after the setting of major-mode 641 ;; must come after the setting of major-mode
723 (setq mode-popup-menu (and vm-use-menus vm-popup-menu-on-mouse-3 642 (setq mode-popup-menu (and vm-use-menus
724 (vm-menu-support-possible-p) 643 (vm-menu-support-possible-p)
725 (vm-menu-mode-menu))) 644 (vm-menu-mode-menu)))
726 (setq blurb (vm-emit-totals-blurb)) 645 (setq blurb (vm-emit-totals-blurb))
727 (if vm-summary-show-threads 646 (if vm-summary-show-threads
728 (vm-sort-messages "thread")) 647 (vm-sort-messages "thread"))
730 (vm-preview-current-message) 649 (vm-preview-current-message)
731 (vm-update-summary-and-mode-line)) 650 (vm-update-summary-and-mode-line))
732 (message blurb))) 651 (message blurb)))
733 ;; make a new frame if the user wants one. reuse an 652 ;; make a new frame if the user wants one. reuse an
734 ;; existing frame that is showing this folder. 653 ;; existing frame that is showing this folder.
735 (vm-goto-new-folder-frame-maybe 'folder) 654 (if (and vm-frame-per-folder (vm-multiple-frames-possible-p))
736 (if vm-raise-frame-at-startup 655 (let ((w (or (vm-get-buffer-window (current-buffer))
737 (vm-raise-frame)) 656 ;; summary == folder for the purpose
738 (vm-display nil nil (list this-command) (list this-command 'startup)) 657 ;; of frame reuse.
658 (and vm-summary-buffer
659 (vm-get-buffer-window (current-buffer))))))
660 (if (null w)
661 (vm-goto-new-frame 'folder)
662 (save-excursion
663 (select-window w)
664 (and vm-warp-mouse-to-new-frame
665 (vm-warp-mouse-to-frame-maybe (vm-window-frame w)))))
666 (vm-set-hooks-for-frame-deletion)))
667 (vm-display (current-buffer) t nil nil)
739 (and (vm-toolbar-support-possible-p) vm-use-toolbar 668 (and (vm-toolbar-support-possible-p) vm-use-toolbar
740 (vm-toolbar-install-toolbar)) 669 (vm-toolbar-install-toolbar))
741 (if first-time 670 (if first-time
742 (progn 671 (if (vm-should-generate-summary)
743 (if (vm-should-generate-summary) 672 (progn (vm-summarize t)
744 (progn (vm-summarize t nil) 673 (message blurb))))
745 (message blurb))) 674 (vm-display nil nil '(vm-visit-virtual-folder
746 ;; raise the summary frame if the user wants frames 675 vm-visit-virtual-folder-other-frame
747 ;; raised and if there is a summary frame. 676 vm-visit-virtual-folder-other-window
748 (if (and vm-summary-buffer 677 vm-create-virtual-folder
749 vm-mutable-frames 678 vm-apply-virtual-folder)
750 vm-frame-per-summary 679 (list this-command 'startup))
751 vm-raise-frame-at-startup)
752 (vm-raise-frame))
753 ;; if vm-mutable-windows is nil, the startup
754 ;; configuration can't be applied, so do
755 ;; something to get a VM buffer on the screen
756 (if vm-mutable-windows
757 (vm-display nil nil (list this-command)
758 (list (or this-command 'vm) 'startup))
759 (save-excursion
760 (switch-to-buffer (or vm-summary-buffer
761 vm-presentation-buffer
762 (current-buffer)))))))
763
764 ;; check interactive-p so as not to bog the user down if they 680 ;; check interactive-p so as not to bog the user down if they
765 ;; run this function from within another function. 681 ;; run this function from within another function.
766 (and (interactive-p) 682 (and (interactive-p) (not vm-inhibit-startup-message)
767 (not vm-startup-message-displayed) 683 (not vm-startup-message-displayed)
768 (vm-display-startup-message) 684 (vm-display-startup-message)
769 (message blurb)))) 685 (message blurb))))
770 686
771 (defun vm-visit-virtual-folder-other-frame (folder-name &optional read-only) 687 (defun vm-visit-virtual-folder-other-frame (folder-name &optional read-only)
803 (other-window 1) 719 (other-window 1)
804 (let ((vm-frame-per-folder nil) 720 (let ((vm-frame-per-folder nil)
805 (vm-search-other-frames nil)) 721 (vm-search-other-frames nil))
806 (vm-visit-virtual-folder folder-name read-only))) 722 (vm-visit-virtual-folder folder-name read-only)))
807 723
808 (defun vm-mail (&optional to) 724 (defun vm-mail ()
809 "Send a mail message from within VM, or from without. 725 "Send a mail message from within VM, or from without."
810 Optional argument TO is a string that should contain a comma separated
811 recipient list."
812 (interactive) 726 (interactive)
813 (vm-session-initialization) 727 (vm-session-initialization)
814 (vm-select-folder-buffer) 728 (vm-select-folder-buffer)
815 (vm-check-for-killed-summary) 729 (vm-check-for-killed-summary)
816 (vm-mail-internal nil to) 730 (vm-mail-internal)
817 (run-hooks 'vm-mail-hook) 731 (run-hooks 'vm-mail-hook)
818 (run-hooks 'vm-mail-mode-hook)) 732 (run-hooks 'vm-mail-mode-hook))
819 733
820 (defun vm-mail-other-frame (&optional to) 734 (defun vm-mail-other-frame ()
821 "Like vm-mail, but run in a newly created frame. 735 "Like vm-mail, but run in a newly created frame."
822 Optional argument TO is a string that should contain a comma separated
823 recipient list."
824 (interactive) 736 (interactive)
825 (vm-session-initialization) 737 (vm-session-initialization)
826 (if (vm-multiple-frames-possible-p) 738 (if (vm-multiple-frames-possible-p)
827 (vm-goto-new-frame 'composition)) 739 (vm-goto-new-frame 'composition))
828 (let ((vm-frame-per-composition nil) 740 (let ((vm-frame-per-composition nil)
829 (vm-search-other-frames nil)) 741 (vm-search-other-frames nil))
830 (vm-mail to)) 742 (vm-mail))
831 (if (vm-multiple-frames-possible-p) 743 (if (vm-multiple-frames-possible-p)
832 (vm-set-hooks-for-frame-deletion))) 744 (vm-set-hooks-for-frame-deletion)))
833 745
834 (defun vm-mail-other-window (&optional to) 746 (defun vm-mail-other-window ()
835 "Like vm-mail, but run in a different window. 747 "Like vm-mail, but run in a different window."
836 Optional argument TO is a string that should contain a comma separated
837 recipient list."
838 (interactive) 748 (interactive)
839 (vm-session-initialization) 749 (vm-session-initialization)
840 (if (one-window-p t) 750 (if (one-window-p t)
841 (split-window)) 751 (split-window))
842 (other-window 1) 752 (other-window 1)
843 (let ((vm-frame-per-composition nil) 753 (let ((vm-frame-per-composition nil)
844 (vm-search-other-frames nil)) 754 (vm-search-other-frames nil))
845 (vm-mail to))) 755 (vm-mail)))
846 756
847 (defun vm-submit-bug-report () 757 (defun vm-submit-bug-report ()
848 "Submit a bug report, with pertinent information to the VM bug list." 758 "Submit a bug report, with pertinent information to the VM bug list."
849 (interactive) 759 (interactive)
850 (require 'reporter) 760 (require 'reporter)
856 (concat "VM " vm-version) 766 (concat "VM " vm-version)
857 (list 767 (list
858 'vm-arrived-message-hook 768 'vm-arrived-message-hook
859 'vm-arrived-messages-hook 769 'vm-arrived-messages-hook
860 'vm-auto-center-summary 770 'vm-auto-center-summary
861 'vm-auto-decode-mime-messages
862 'vm-auto-displayed-mime-content-types
863 ;; don't send this by default, might be personal stuff in here. 771 ;; don't send this by default, might be personal stuff in here.
864 ;; 'vm-auto-folder-alist 772 ;; 'vm-auto-folder-alist
865 'vm-auto-folder-case-fold-search 773 'vm-auto-folder-case-fold-search
866 'vm-auto-get-new-mail 774 'vm-auto-get-new-mail
867 'vm-auto-next-message 775 'vm-auto-next-message
870 'vm-circular-folders 778 'vm-circular-folders
871 'vm-confirm-new-folders 779 'vm-confirm-new-folders
872 'vm-confirm-quit 780 'vm-confirm-quit
873 'vm-convert-folder-types 781 'vm-convert-folder-types
874 'vm-crash-box 782 'vm-crash-box
875 'vm-crash-box-suffix
876 'vm-default-folder-type 783 'vm-default-folder-type
877 'vm-delete-after-archiving 784 'vm-delete-after-archiving
878 'vm-delete-after-bursting 785 'vm-delete-after-bursting
879 'vm-delete-after-saving 786 'vm-delete-after-saving
880 'vm-delete-empty-folders 787 'vm-delete-empty-folders
882 'vm-digest-identifier-header-format 789 'vm-digest-identifier-header-format
883 'vm-digest-center-preamble 790 'vm-digest-center-preamble
884 'vm-digest-preamble-format 791 'vm-digest-preamble-format
885 'vm-digest-send-type 792 'vm-digest-send-type
886 'vm-display-buffer-hook 793 'vm-display-buffer-hook
887 'vm-display-using-mime
888 'vm-edit-message-hook 794 'vm-edit-message-hook
889 'vm-edit-message-mode 795 'vm-edit-message-mode
890 'vm-flush-interval 796 'vm-flush-interval
891 'vm-folder-directory 797 'vm-folder-directory
892 'vm-folder-read-only 798 'vm-folder-read-only
894 'vm-forward-message-hook 800 'vm-forward-message-hook
895 'vm-forwarded-headers 801 'vm-forwarded-headers
896 'vm-forwarding-digest-type 802 'vm-forwarding-digest-type
897 'vm-forwarding-subject-format 803 'vm-forwarding-subject-format
898 'vm-frame-parameter-alist 804 'vm-frame-parameter-alist
899 'vm-frame-per-completion
900 'vm-frame-per-composition 805 'vm-frame-per-composition
901 'vm-frame-per-edit
902 'vm-frame-per-folder 806 'vm-frame-per-folder
903 'vm-frame-per-help
904 'vm-frame-per-summary
905 'vm-highlight-url-face 807 'vm-highlight-url-face
906 'vm-highlighted-header-regexp 808 'vm-highlighted-header-regexp
907 'vm-honor-page-delimiters 809 'vm-honor-page-delimiters
908 'vm-image-directory
909 'vm-in-reply-to-format 810 'vm-in-reply-to-format
910 'vm-included-text-attribution-format 811 'vm-included-text-attribution-format
911 'vm-included-text-discard-header-regexp 812 'vm-included-text-discard-header-regexp
912 'vm-included-text-headers 813 'vm-included-text-headers
913 'vm-included-text-prefix 814 'vm-included-text-prefix
815 'vm-inhibit-startup-message
914 'vm-init-file 816 'vm-init-file
915 'vm-invisible-header-regexp 817 'vm-invisible-header-regexp
916 'vm-jump-to-new-messages 818 'vm-jump-to-new-messages
917 'vm-jump-to-unread-messages 819 'vm-jump-to-unread-messages
918 'vm-keep-crash-boxes 820 'vm-keep-crash-boxes
919 'vm-keep-sent-messages 821 'vm-keep-sent-messages
920 'vm-mail-header-from 822 'vm-mail-header-from
921 'vm-mail-hook 823 'vm-mail-hook
922 'vm-make-crash-box-name
923 'vm-make-spool-file-name
924 'vm-mail-check-interval
925 'vm-mail-mode-hook 824 'vm-mail-mode-hook
926 'vm-mime-8bit-composition-charset
927 'vm-mime-8bit-text-transfer-encoding
928 'vm-mime-alternative-select-method
929 'vm-mime-attachment-auto-type-alist
930 'vm-mime-attachment-save-directory
931 'vm-mime-avoid-folding-content-type
932 'vm-mime-base64-decoder-program
933 'vm-mime-base64-decoder-switches
934 'vm-mime-base64-encoder-program
935 'vm-mime-base64-encoder-switches
936 'vm-mime-button-face
937 'vm-mime-charset-font-alist
938 'vm-mime-default-face-charsets
939 'vm-mime-digest-discard-header-regexp
940 'vm-mime-digest-headers
941 'vm-mime-display-function
942 'vm-mime-external-content-types-alist
943 'vm-mime-ignore-mime-version
944 'vm-mime-internal-content-types
945 'vm-mime-max-message-size
946 'vm-mode-hook 825 'vm-mode-hook
947 'vm-mode-hooks 826 'vm-mode-hooks
948 'vm-mosaic-program 827 'vm-mosaic-program
949 'vm-mosaic-program-switches
950 'vm-move-after-deleting 828 'vm-move-after-deleting
951 'vm-move-after-undeleting 829 'vm-move-after-undeleting
952 'vm-move-messages-physically 830 'vm-move-messages-physically
953 'vm-movemail-program 831 'vm-movemail-program
954 'vm-mutable-frames 832 'vm-mutable-frames
955 'vm-mutable-windows 833 'vm-mutable-windows
956 'vm-netscape-program 834 'vm-netscape-program
957 'vm-netscape-program-switches 835 'vm-options-file
958 'vm-pop-bytes-per-session
959 'vm-pop-max-message-size
960 'vm-pop-messages-per-session
961 'vm-pop-md5-program 836 'vm-pop-md5-program
962 'vm-popup-menu-on-mouse-3
963 'vm-preferences-file
964 'vm-preview-lines 837 'vm-preview-lines
965 'vm-preview-read-messages 838 'vm-preview-read-messages
966 'vm-primary-inbox 839 'vm-primary-inbox
967 'vm-quit-hook 840 'vm-quit-hook
968 'vm-recognize-pop-maildrops 841 'vm-recognize-pop-maildrops
969 'vm-reply-hook 842 'vm-reply-hook
970 ;; don't feed the spammers or crackers 843 'vm-reply-ignored-addresses
971 ;; 'vm-reply-ignored-addresses
972 'vm-reply-ignored-reply-tos 844 'vm-reply-ignored-reply-tos
973 'vm-reply-subject-prefix 845 'vm-reply-subject-prefix
974 'vm-resend-bounced-discard-header-regexp 846 'vm-resend-bounced-discard-header-regexp
975 'vm-resend-bounced-headers 847 'vm-resend-bounced-headers
976 'vm-resend-bounced-message-hook 848 'vm-resend-bounced-message-hook
985 'vm-search-using-regexps 857 'vm-search-using-regexps
986 'vm-select-message-hook 858 'vm-select-message-hook
987 'vm-select-new-message-hook 859 'vm-select-new-message-hook
988 'vm-select-unread-message-hook 860 'vm-select-unread-message-hook
989 'vm-send-digest-hook 861 'vm-send-digest-hook
990 'vm-send-using-mime
991 'vm-skip-deleted-messages 862 'vm-skip-deleted-messages
992 'vm-skip-read-messages 863 'vm-skip-read-messages
993 ;; don't send vm-spool-files by default, might contain passwords 864 ;; don't send vm-spool-files by default, might contain passwords
994 ;; 'vm-spool-files 865 ;; 'vm-spool-files
995 'vm-spool-file-suffixes
996 'vm-startup-with-summary 866 'vm-startup-with-summary
997 'vm-strip-reply-headers 867 'vm-strip-reply-headers
998 'vm-summary-format 868 'vm-summary-format
999 'vm-summary-highlight-face 869 'vm-summary-highlight-face
1000 'vm-summary-mode-hook 870 'vm-summary-mode-hook
1001 'vm-summary-mode-hooks 871 'vm-summary-mode-hooks
1002 'vm-summary-redo-hook 872 'vm-summary-redo-hook
1003 'vm-summary-show-threads 873 'vm-summary-show-threads
874 'vm-summary-subject-no-newlines
1004 'vm-summary-thread-indent-level 875 'vm-summary-thread-indent-level
1005 'vm-summary-uninteresting-senders 876 'vm-summary-uninteresting-senders
1006 'vm-summary-uninteresting-senders-arrow 877 'vm-summary-uninteresting-senders-arrow
1007 'vm-tale-is-an-idiot 878 'vm-tale-is-an-idiot
1008 'vm-toolbar-pixmap-directory
1009 'vm-temp-file-directory
1010 'vm-trust-From_-with-Content-Length 879 'vm-trust-From_-with-Content-Length
1011 'vm-undisplay-buffer-hook 880 'vm-undisplay-buffer-hook
1012 'vm-unforwarded-header-regexp 881 'vm-unforwarded-header-regexp
1013 'vm-url-browser 882 'vm-url-browser
1014 'vm-url-search-limit 883 'vm-url-search-limit
1015 'vm-use-menus 884 'vm-use-menus
1016 'vm-use-toolbar
1017 'vm-virtual-folder-alist 885 'vm-virtual-folder-alist
1018 'vm-virtual-mirror 886 'vm-virtual-mirror
1019 'vm-visible-headers 887 'vm-visible-headers
1020 'vm-visit-folder-hook 888 'vm-visit-folder-hook
1021 'vm-visit-when-saving 889 'vm-visit-when-saving
1024 ;; see what the user had loaded 892 ;; see what the user had loaded
1025 'features 893 'features
1026 ) 894 )
1027 nil 895 nil
1028 nil 896 nil
1029 "Please change the Subject header to a concise bug description.\nRemember to cover the basics, that is, what you expected to\nhappen and what in fact did happen. Please remove these\ninstructions from your message.") 897 "Please change the Subject header to a concise bug description.\nRemember to cover the basics, that is, what you expected to\nhappen and what in fact did happen. Please remove these instructions from your message.")
1030 (save-excursion 898 (save-excursion
1031 (goto-char (point-min)) 899 (goto-char (point-min))
1032 (mail-position-on-field "Subject") 900 (mail-position-on-field "Subject")
1033 (beginning-of-line) 901 (beginning-of-line)
1034 (delete-region (point) (progn (forward-line) (point))) 902 (delete-region (point) (progn (forward-line) (point)))
1039 (if (or (not vm-init-file-loaded) interactive) 907 (if (or (not vm-init-file-loaded) interactive)
1040 (load vm-init-file (not interactive) (not interactive) t)) 908 (load vm-init-file (not interactive) (not interactive) t))
1041 (setq vm-init-file-loaded t) 909 (setq vm-init-file-loaded t)
1042 (vm-display nil nil '(vm-load-init-file) '(vm-load-init-file))) 910 (vm-display nil nil '(vm-load-init-file) '(vm-load-init-file)))
1043 911
1044 (defun vm-check-emacs-version ()
1045 (cond ((and vm-xemacs-p
1046 (or (< emacs-major-version 19)
1047 (and (= emacs-major-version 19)
1048 (< emacs-minor-version 14))))
1049 (error "VM %s must be run on XEmacs 19.14 or a later version."
1050 vm-version))
1051 ((and vm-fsfemacs-19-p
1052 (or (< emacs-major-version 19)
1053 (and (= emacs-major-version 19)
1054 (< emacs-minor-version 34))))
1055 (error "VM %s must be run on Emacs 19.34 or a later version."
1056 vm-version))))
1057
1058 (defun vm-set-debug-flags ()
1059 (or stack-trace-on-error
1060 debug-on-error
1061 (setq stack-trace-on-error
1062 '(
1063 wrong-type-argument
1064 wrong-number-of-arguments
1065 args-out-of-range
1066 void-function
1067 void-variable
1068 ))))
1069
1070 (defun vm-session-initialization () 912 (defun vm-session-initialization ()
1071 (vm-note-emacs-version)
1072 (vm-check-emacs-version)
1073 ;; (vm-set-debug-flags)
1074 ;; If this is the first time VM has been run in this Emacs session, 913 ;; If this is the first time VM has been run in this Emacs session,
1075 ;; do some necessary preparations. 914 ;; do some necessary preparations.
1076 (if (or (not (boundp 'vm-session-beginning)) 915 (if (or (not (boundp 'vm-session-beginning))
1077 vm-session-beginning) 916 vm-session-beginning)
1078 (progn 917 (progn
1081 (if (not vm-window-configuration-file) 920 (if (not vm-window-configuration-file)
1082 (setq vm-window-configurations vm-default-window-configuration) 921 (setq vm-window-configurations vm-default-window-configuration)
1083 (or (vm-load-window-configurations vm-window-configuration-file) 922 (or (vm-load-window-configurations vm-window-configuration-file)
1084 (setq vm-window-configurations vm-default-window-configuration))) 923 (setq vm-window-configurations vm-default-window-configuration)))
1085 (setq vm-buffers-needing-display-update (make-vector 29 0)) 924 (setq vm-buffers-needing-display-update (make-vector 29 0))
1086 ;; default value of vm-mime-button-face is 'gui-button-face
1087 ;; this face doesn't exist by default in FSF Emacs 19.34.
1088 ;; Create it.
1089 (and (fboundp 'make-face) (make-face 'gui-button-face))
1090 (and (vm-mouse-support-possible-p) 925 (and (vm-mouse-support-possible-p)
1091 (vm-mouse-install-mouse)) 926 (vm-mouse-install-mouse))
1092 (and (vm-menu-support-possible-p) 927 (and (vm-menu-support-possible-p)
1093 vm-use-menus 928 vm-use-menus
1094 (vm-menu-fsfemacs-menus-p) 929 (vm-menu-fsfemacs-menus-p)