diff options
| author | Richard M. Stallman | 1996-10-12 16:08:08 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-10-12 16:08:08 +0000 |
| commit | 6af28e9facc179c262d58b1bf20796ea573d14df (patch) | |
| tree | b9e66ac02de65f079ca2aba448c02fcccd640967 | |
| parent | 549b29ac9a24a47817146dcdb5f9dac20782d725 (diff) | |
| download | emacs-6af28e9facc179c262d58b1bf20796ea573d14df.tar.gz emacs-6af28e9facc179c262d58b1bf20796ea573d14df.zip | |
(rmail): Run rmail-mail-hook last.
(rmail-mode-2): Don't run rmail-mode-hook here.
(rmail-mode, rmail): Run it here.
| -rw-r--r-- | lisp/mail/rmail.el | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 920eebfbc11..5cafb8b1c56 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | ; These variables now declared in paths.el. | 46 | ; These variables now declared in paths.el. |
| 47 | ;(defvar rmail-spool-directory "/usr/spool/mail/" | 47 | ;(defvar rmail-spool-directory "/usr/spool/mail/" |
| 48 | ; "This is the name of the directory used by the system mailer for\n\ | 48 | ; "This is the name of the directory used by the system mailer for\n\ |
| 49 | ;delivering new mail. It's name should end with a slash.") | 49 | ;delivering new mail. Its name should end with a slash.") |
| 50 | ;(defvar rmail-file-name | 50 | ;(defvar rmail-file-name |
| 51 | ; (expand-file-name "~/RMAIL") | 51 | ; (expand-file-name "~/RMAIL") |
| 52 | ; "") | 52 | ; "") |
| @@ -306,7 +306,8 @@ If `rmail-display-summary' is non-nil, make a summary for this RMAIL file." | |||
| 306 | (interactive (if current-prefix-arg | 306 | (interactive (if current-prefix-arg |
| 307 | (list (read-file-name "Run rmail on RMAIL file: ")))) | 307 | (list (read-file-name "Run rmail on RMAIL file: ")))) |
| 308 | (let* ((file-name (expand-file-name (or file-name-arg rmail-file-name))) | 308 | (let* ((file-name (expand-file-name (or file-name-arg rmail-file-name))) |
| 309 | (existed (get-file-buffer file-name))) | 309 | (existed (get-file-buffer file-name)) |
| 310 | run-mail-hook) | ||
| 310 | ;; Like find-file, but in the case where a buffer existed | 311 | ;; Like find-file, but in the case where a buffer existed |
| 311 | ;; and the file was reverted, recompute the message-data. | 312 | ;; and the file was reverted, recompute the message-data. |
| 312 | (if (and existed (not (verify-visited-file-modtime existed))) | 313 | (if (and existed (not (verify-visited-file-modtime existed))) |
| @@ -326,7 +327,9 @@ If `rmail-display-summary' is non-nil, make a summary for this RMAIL file." | |||
| 326 | (if (and existed (> (buffer-size) 0)) | 327 | (if (and existed (> (buffer-size) 0)) |
| 327 | ;; Buffer not new and not empty; ensure in proper mode, but that's all. | 328 | ;; Buffer not new and not empty; ensure in proper mode, but that's all. |
| 328 | (or (eq major-mode 'rmail-mode) | 329 | (or (eq major-mode 'rmail-mode) |
| 329 | (rmail-mode-2)) | 330 | (progn (rmail-mode-2) |
| 331 | (setq run-mail-hook t))) | ||
| 332 | (setq run-mail-hook t) | ||
| 330 | (rmail-mode-2) | 333 | (rmail-mode-2) |
| 331 | ;; Convert all or part to Babyl file if possible. | 334 | ;; Convert all or part to Babyl file if possible. |
| 332 | (rmail-convert-file) | 335 | (rmail-convert-file) |
| @@ -339,7 +342,9 @@ If `rmail-display-summary' is non-nil, make a summary for this RMAIL file." | |||
| 339 | (rmail-get-new-mail)) | 342 | (rmail-get-new-mail)) |
| 340 | (rmail-show-message (rmail-first-unseen-message))) | 343 | (rmail-show-message (rmail-first-unseen-message))) |
| 341 | (if rmail-display-summary (rmail-summary)) | 344 | (if rmail-display-summary (rmail-summary)) |
| 342 | (rmail-construct-io-menu))) | 345 | (rmail-construct-io-menu) |
| 346 | (if run-mail-hook | ||
| 347 | (run-hooks 'rmail-mode-hook)))) | ||
| 343 | 348 | ||
| 344 | ;; Given the value of MAILPATH, return a list of inbox file names. | 349 | ;; Given the value of MAILPATH, return a list of inbox file names. |
| 345 | ;; This is turned off because it is not clear that the user wants | 350 | ;; This is turned off because it is not clear that the user wants |
| @@ -639,13 +644,13 @@ Instead, these commands are available: | |||
| 639 | (interactive) | 644 | (interactive) |
| 640 | (rmail-mode-2) | 645 | (rmail-mode-2) |
| 641 | (rmail-set-message-counters) | 646 | (rmail-set-message-counters) |
| 642 | (rmail-show-message rmail-total-messages)) | 647 | (rmail-show-message rmail-total-messages) |
| 648 | (run-hooks 'rmail-mode-hook)) | ||
| 643 | 649 | ||
| 644 | (defun rmail-mode-2 () | 650 | (defun rmail-mode-2 () |
| 645 | (kill-all-local-variables) | 651 | (kill-all-local-variables) |
| 646 | (rmail-mode-1) | 652 | (rmail-mode-1) |
| 647 | (rmail-variables) | 653 | (rmail-variables)) |
| 648 | (run-hooks 'rmail-mode-hook)) | ||
| 649 | 654 | ||
| 650 | (defun rmail-mode-1 () | 655 | (defun rmail-mode-1 () |
| 651 | (setq major-mode 'rmail-mode) | 656 | (setq major-mode 'rmail-mode) |