comparison lisp/vm/vm-startup.el @ 102:a145efe76779 r20-1b3

Import from CVS: tag r20-1b3
author cvs
date Mon, 13 Aug 2007 09:15:49 +0200
parents 4be1180a9e89
children 360340f9fd5f
comparison
equal deleted inserted replaced
101:a0ec055d74dd 102:a145efe76779
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 ;; for XEmacs/Mule
66 (overriding-file-coding-system 'no-conversion)) 66 (overriding-file-coding-system 'no-conversion))
67 (vm-unsaved-message "Reading %s..." file) 67 (message "Reading %s..." file)
68 (prog1 (find-file-noselect file) 68 (prog1 (find-file-noselect file)
69 ;; update folder history 69 ;; update folder history
70 (let ((item (or folder vm-primary-inbox))) 70 (let ((item (or folder vm-primary-inbox)))
71 (if (not (equal item (car vm-folder-history))) 71 (if (not (equal item (car vm-folder-history)))
72 (setq vm-folder-history 72 (setq vm-folder-history
73 (cons item vm-folder-history)))) 73 (cons item vm-folder-history))))
74 (vm-unsaved-message "Reading %s... done" file)))))))) 74 (message "Reading %s... done" file))))))))
75 (set-buffer folder-buffer) 75 (set-buffer folder-buffer)
76 ;; for XEmacs/MULE 76 ;; for XEmacs/MULE
77 ;; 77 ;;
78 ;; If the file coding system is not a no-conversion variant, 78 ;; If the file coding system is not a no-conversion variant,
79 ;; make it so by encoding all the text, then setting 79 ;; make it so by encoding all the text, then setting
80 ;; the file coding system and decoding it. 80 ;; the file coding system and decoding it.
81 ;; This is only possible if a file is visited and vm-mode 81 ;; This is only possible if a file is visited and then vm-mode
82 ;; is run on it afterwards. 82 ;; is run on it afterwards.
83 (defvar file-coding-system) 83 (defvar file-coding-system)
84 (if (and (fboundp 'get-coding-system) 84 (if (and (vm-xemacs-mule-p)
85 (not (eq file-coding-system 85 (not (eq (get-coding-system file-coding-system)
86 (get-coding-system 'no-conversion-unix))) 86 (get-coding-system 'no-conversion-unix)))
87 (not (eq file-coding-system 87 (not (eq (get-coding-system file-coding-system)
88 (get-coding-system 'no-conversion-dos))) 88 (get-coding-system 'no-conversion-dos)))
89 (not (eq file-coding-system 89 (not (eq (get-coding-system file-coding-system)
90 (get-coding-system 'no-conversion-mac))) 90 (get-coding-system 'no-conversion-mac)))
91 (not (eq file-coding-system 91 (not (eq (get-coding-system file-coding-system)
92 (get-coding-system 'binary)))) 92 (get-coding-system 'binary))))
93 (progn 93 (let ((buffer-read-only nil)
94 (encode-coding-region (point-min) (point-max) file-coding-system) 94 (omodified (buffer-modified-p)))
95 (set-file-coding-system 'no-conversion nil) 95 (unwind-protect
96 (decode-coding-region (point-min) (point-max) file-coding-system))) 96 (progn
97 (encode-coding-region (point-min) (point-max)
98 file-coding-system)
99 (set-file-coding-system 'no-conversion nil)
100 (decode-coding-region (point-min) (point-max)
101 file-coding-system))
102 (set-buffer-modified-p omodified))))
97 (vm-check-for-killed-summary) 103 (vm-check-for-killed-summary)
98 (vm-check-for-killed-presentation) 104 (vm-check-for-killed-presentation)
99 ;; If the buffer's not modified then we know that there can be no 105 ;; If the buffer's not modified then we know that there can be no
100 ;; messages in the folder that are not on disk. 106 ;; messages in the folder that are not on disk.
101 (or (buffer-modified-p) (setq vm-messages-not-on-disk 0)) 107 (or (buffer-modified-p) (setq vm-messages-not-on-disk 0))
219 (throw 'done t)) 225 (throw 'done t))
220 (if (and vm-auto-get-new-mail 226 (if (and vm-auto-get-new-mail
221 (not vm-block-new-mail) 227 (not vm-block-new-mail)
222 (not vm-folder-read-only)) 228 (not vm-folder-read-only))
223 (progn 229 (progn
224 (vm-unsaved-message "Checking for new mail for %s..." 230 (message "Checking for new mail for %s..."
225 (or buffer-file-name (buffer-name))) 231 (or buffer-file-name (buffer-name)))
226 (if (and (vm-get-spooled-mail t) (vm-assimilate-new-messages t)) 232 (if (and (vm-get-spooled-mail t) (vm-assimilate-new-messages t))
227 (progn 233 (progn
228 (setq totals-blurb (vm-emit-totals-blurb)) 234 (setq totals-blurb (vm-emit-totals-blurb))
229 (if (vm-thoughtfully-select-message) 235 (if (vm-thoughtfully-select-message)
267 (put 'vm-mode 'mode-class 'special) 273 (put 'vm-mode 'mode-class 'special)
268 274
269 (defun vm-mode (&optional read-only) 275 (defun vm-mode (&optional read-only)
270 "Major mode for reading mail. 276 "Major mode for reading mail.
271 277
272 This is VM 6.15. 278 This is VM 6.16.
273 279
274 Commands: 280 Commands:
275 h - summarize folder contents 281 h - summarize folder contents
276 C-t - toggle threads display 282 C-t - toggle threads display
277 283