changeset 25146:1fa062857a8d

(mh-find-path-run): New variable. (mh-find-path): Test and set that. Set mail-user-agent only the first time this function is run. (mail-user-agent): Defvar deleted.
author Richard M. Stallman <rms@gnu.org>
date Sun, 01 Aug 1999 12:55:28 +0000
parents 784d7bc2a991
children 820b95325cb5
files lisp/mail/mh-utils.el
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/mh-utils.el	Sun Aug 01 12:17:46 1999 +0000
+++ b/lisp/mail/mh-utils.el	Sun Aug 01 12:55:28 1999 +0000
@@ -541,7 +541,10 @@
 	     (end-of-line)
 	     (buffer-substring start (point)))))))
 
-(defvar mail-user-agent 'mh-e-user-agent) ;from reporter.el 3.2
+(defvar mail-user-agent)
+
+(defvar mh-find-path-run nil
+  "Non-nil if `mh-find-path' has been run already.")
 
 (defun mh-find-path ()
   ;; Set mh-progs, mh-lib, and mh-libs-progs
@@ -549,6 +552,9 @@
   ;; From profile file, set mh-user-path, mh-draft-folder,
   ;; mh-unseen-seq, mh-previous-seq, mh-inbox.
   (mh-find-progs)
+  (unless mh-find-path-run
+    (setq mh-find-path-run t)
+    (setq mail-user-agent 'mh-e-user-agent))
   (save-excursion
     ;; Be sure profile is fully expanded before switching buffers
     (let ((profile (expand-file-name (or (getenv "MH") "~/.mh_profile"))))
@@ -585,7 +591,6 @@
       (setq mh-previous-seq (mh-get-profile-field "Previous-Sequence:"))
       (if mh-previous-seq
 	  (setq mh-previous-seq (intern mh-previous-seq)))
-      (setq mail-user-agent 'mh-e-user-agent)
       (run-hooks 'mh-find-path-hook)))
   (and mh-auto-folder-collect
        (let ((mh-no-install t))		;only get folders if MH installed