changeset 11533:2d1e996c4359

(rmail-resend): Fix abbrev expansion. (rmail-get-new-mail): Simply the reversion check; don't call rmail-forget-messages. (rmail-revert): Call rmail-mode after reverting to make sure rmail-message-vector is buffer-local.
author Richard M. Stallman <rms@gnu.org>
date Mon, 24 Apr 1995 17:43:15 +0000
parents a98672909b35
children 9cd01f363d4b
files lisp/mail/rmail.el
diffstat 1 files changed, 18 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Mon Apr 24 17:39:46 1995 +0000
+++ b/lisp/mail/rmail.el	Mon Apr 24 17:43:15 1995 +0000
@@ -751,7 +751,8 @@
       ;; Don't sort here.
       (let ((files (directory-files start t
 				    rmail-secondary-file-regexp t))
-	    (ret nil))
+	    (ret nil)
+	    file)
 	(while files
 	  (setq file (car files))
 	  (setq files (cdr files))
@@ -840,12 +841,10 @@
   (interactive
    (list (if current-prefix-arg
 	     (read-file-name "Get new mail from file: "))))
+  ;; If the disk file has been changed from under us,
+  ;; revert to it before we get new mail.
   (or (verify-visited-file-modtime (current-buffer))
-      (progn
-	(find-file (buffer-file-name))
-	(setq buffer-read-only t)
-	(if (verify-visited-file-modtime (current-buffer))
-	    (rmail-forget-messages))))
+      (find-file (buffer-file-name)))
   (rmail-maybe-set-message-counters)
   (widen)
   ;; Get rid of all undo records for this buffer.
@@ -2280,9 +2279,19 @@
 	    ;; Expand abbrevs in the recipients.
 	    (save-excursion
 	      (if (featurep 'mailabbrev)
-		  (progn
-		    (mail-abbrevs-setup)
-		    (expand-region-abbrevs before (point) t))
+		  (let ((end (point-marker))
+			(local-abbrev-table mail-abbrevs)
+			(old-syntax-table (syntax-table)))
+		    (if (and (not (vectorp mail-abbrevs))
+			     (file-exists-p mail-personal-alias-file))
+			(build-mail-abbrevs))
+		    (set-syntax-table mail-abbrev-syntax-table)
+		    (goto-char before)
+		    (while (and (< (point) end)
+				(progn (forward-word 1)
+				       (<= (point) end)))
+		      (expand-abbrev))
+		    (set-syntax-table old-syntax-table))
 		(expand-mail-aliases before (point)))))
 	  ;;>> Set up comment, if any.
 	  (if (and (sequencep comment) (not (zerop (length comment))))