diff options
| author | Richard M. Stallman | 1997-07-30 16:12:30 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-07-30 16:12:30 +0000 |
| commit | 84b7ccbdc64caf9baa80784a920fcf554209dd0c (patch) | |
| tree | bc1621226948dd22e8c342ff46ea991653260d8b | |
| parent | f985c5f748d1a2b814811e164866820f00f13592 (diff) | |
| download | emacs-84b7ccbdc64caf9baa80784a920fcf554209dd0c.tar.gz emacs-84b7ccbdc64caf9baa80784a920fcf554209dd0c.zip | |
(mspools-using-vm): Better handling of VM initialization.
(mspools-size-folder): Allow symbolic links to spool files.
| -rw-r--r-- | lisp/mail/mspools.el | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/lisp/mail/mspools.el b/lisp/mail/mspools.el index bf2474c3f50..3853766e624 100644 --- a/lisp/mail/mspools.el +++ b/lisp/mail/mspools.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; mspools.el --- Show mail spools waiting to be read | 1 | ;;; mspools.el --- Show mail spools waiting to be read |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1997 Stephen Eglen | 3 | ;; Copyright (C) 1997 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Stephen Eglen <stephen@cns.ed.ac.uk> | 5 | ;; Author: Stephen Eglen <stephen@cns.ed.ac.uk> |
| 6 | ;; Maintainer: Stephen Eglen <stephen@cns.ed.ac.uk> | 6 | ;; Maintainer: Stephen Eglen <stephen@cns.ed.ac.uk> |
| @@ -33,7 +33,7 @@ | |||
| 33 | ;; arrives whilst you are reading the folder in emacs, hence the use | 33 | ;; arrives whilst you are reading the folder in emacs, hence the use |
| 34 | ;; of a spool file.) For example, the following procmail recipe puts | 34 | ;; of a spool file.) For example, the following procmail recipe puts |
| 35 | ;; any mail with `emacs' in the subject line into the spool file | 35 | ;; any mail with `emacs' in the subject line into the spool file |
| 36 | ;; `apple.spool', ready to go into the folder `emacs'. | 36 | ;; `emacs.spool', ready to go into the folder `emacs'. |
| 37 | ;:0: | 37 | ;:0: |
| 38 | ;* ^Subject.*emacs | 38 | ;* ^Subject.*emacs |
| 39 | ;emacs.spool | 39 | ;emacs.spool |
| @@ -62,6 +62,9 @@ | |||
| 62 | ;(autoload 'mspools-show "mspools" "Show outstanding mail spools." t) | 62 | ;(autoload 'mspools-show "mspools" "Show outstanding mail spools." t) |
| 63 | ; Point to directory where spool files and folders are: | 63 | ; Point to directory where spool files and folders are: |
| 64 | ; (setq mspools-folder-directory "~/MAIL/") | 64 | ; (setq mspools-folder-directory "~/MAIL/") |
| 65 | ; | ||
| 66 | ; If you use VM, mspools-folder-directory will default to vm-folder-directory | ||
| 67 | ; unless you have already given it a value. | ||
| 65 | 68 | ||
| 66 | ;; Extras | 69 | ;; Extras |
| 67 | ; possibly bind it to a key: | 70 | ; possibly bind it to a key: |
| @@ -144,7 +147,7 @@ Only used by VM." ) | |||
| 144 | (defvar mspools-mode-map nil | 147 | (defvar mspools-mode-map nil |
| 145 | "Keymap for the *spools* buffer.") | 148 | "Keymap for the *spools* buffer.") |
| 146 | 149 | ||
| 147 | (defvar mspools-folder-directory | 150 | (defvar mspools-folder-directory |
| 148 | (if (boundp 'vm-folder-directory) | 151 | (if (boundp 'vm-folder-directory) |
| 149 | vm-folder-directory | 152 | vm-folder-directory |
| 150 | nil) | 153 | nil) |
| @@ -162,7 +165,14 @@ at the end. ") | |||
| 162 | 165 | ||
| 163 | ;;; VM Specific code | 166 | ;;; VM Specific code |
| 164 | (if mspools-using-vm | 167 | (if mspools-using-vm |
| 165 | (require 'vm-vars)) | 168 | ;; set up vm if not already loaded. |
| 169 | (progn | ||
| 170 | (require 'vm-vars) | ||
| 171 | (if (not vm-init-file-loaded) | ||
| 172 | (load-file vm-init-file)) | ||
| 173 | (if (not mspools-folder-directory) | ||
| 174 | (setq mspools-folder-directory vm-folder-directory)) | ||
| 175 | )) | ||
| 166 | 176 | ||
| 167 | (defun mspools-set-vm-spool-files () | 177 | (defun mspools-set-vm-spool-files () |
| 168 | "Set value of `vm-spool-files'. Only needed for VM." | 178 | "Set value of `vm-spool-files'. Only needed for VM." |
| @@ -177,6 +187,7 @@ at the end. ") | |||
| 177 | )) | 187 | )) |
| 178 | 188 | ||
| 179 | ;; Mailing list inboxes | 189 | ;; Mailing list inboxes |
| 190 | ;; must have VM already loaded to get vm-folder-directory. | ||
| 180 | (mapcar '(lambda (s) | 191 | (mapcar '(lambda (s) |
| 181 | "make the appropriate entry for vm-spool-files" | 192 | "make the appropriate entry for vm-spool-files" |
| 182 | (list | 193 | (list |
| @@ -336,7 +347,7 @@ nil." | |||
| 336 | "Major mode for output from mspools-show. | 347 | "Major mode for output from mspools-show. |
| 337 | \\<mspools-mode-map>Move point to one of the items in this buffer, then use | 348 | \\<mspools-mode-map>Move point to one of the items in this buffer, then use |
| 338 | \\[mspools-visit-spool] to go to the spool that the current line refers to. | 349 | \\[mspools-visit-spool] to go to the spool that the current line refers to. |
| 339 | \\[mspools-show-again] to regenerate the list of spools. | 350 | \\[revert-buffer] to regenerate the list of spools. |
| 340 | \\{mspools-mode-map}" | 351 | \\{mspools-mode-map}" |
| 341 | (kill-all-local-variables) | 352 | (kill-all-local-variables) |
| 342 | (make-local-variable 'revert-buffer-function) | 353 | (make-local-variable 'revert-buffer-function) |
| @@ -381,13 +392,15 @@ nil." | |||
| 381 | (defun mspools-size-folder (spool) | 392 | (defun mspools-size-folder (spool) |
| 382 | "Return (SPOOL . SIZE ) iff SIZE of spool file is non-zero." | 393 | "Return (SPOOL . SIZE ) iff SIZE of spool file is non-zero." |
| 383 | ;; 7th file attribute is the size of the file in bytes. | 394 | ;; 7th file attribute is the size of the file in bytes. |
| 384 | (let ((size (nth 7 | 395 | (let ((file (concat mspools-folder-directory spool)) |
| 385 | (file-attributes (concat mspools-folder-directory spool))))) | 396 | size) |
| 386 | ;; todo (if (and (not (null size)) (> size 0)) | 397 | (setq file (or (file-symlink-p file) file)) |
| 398 | (setq size (nth 7 (file-attributes file))) | ||
| 387 | (if (> size 0) | 399 | (if (> size 0) |
| 388 | (cons spool size) | 400 | (cons spool size) |
| 389 | ;; else SPOOL is empty | 401 | ;; else SPOOL is empty |
| 390 | nil))) | 402 | nil))) |
| 391 | 403 | ||
| 392 | (provide 'mspools) | 404 | (provide 'mspools) |
| 393 | ;;; MSPOOLS.EL ends here | 405 | ;;; mspools.el ends here |
| 406 | |||