comparison lisp/mail/mh-utils.el @ 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 869c9511ad3c
children 03d8424273d3
comparison
equal deleted inserted replaced
25145:784d7bc2a991 25146:1fa062857a8d
539 (re-search-forward "[\t ]*\\([^\t \n].*\\)$" nil t) 539 (re-search-forward "[\t ]*\\([^\t \n].*\\)$" nil t)
540 (let ((start (match-beginning 1))) 540 (let ((start (match-beginning 1)))
541 (end-of-line) 541 (end-of-line)
542 (buffer-substring start (point))))))) 542 (buffer-substring start (point)))))))
543 543
544 (defvar mail-user-agent 'mh-e-user-agent) ;from reporter.el 3.2 544 (defvar mail-user-agent)
545
546 (defvar mh-find-path-run nil
547 "Non-nil if `mh-find-path' has been run already.")
545 548
546 (defun mh-find-path () 549 (defun mh-find-path ()
547 ;; Set mh-progs, mh-lib, and mh-libs-progs 550 ;; Set mh-progs, mh-lib, and mh-libs-progs
548 ;; (This step is necessary if MH was installed after this Emacs was dumped.) 551 ;; (This step is necessary if MH was installed after this Emacs was dumped.)
549 ;; From profile file, set mh-user-path, mh-draft-folder, 552 ;; From profile file, set mh-user-path, mh-draft-folder,
550 ;; mh-unseen-seq, mh-previous-seq, mh-inbox. 553 ;; mh-unseen-seq, mh-previous-seq, mh-inbox.
551 (mh-find-progs) 554 (mh-find-progs)
555 (unless mh-find-path-run
556 (setq mh-find-path-run t)
557 (setq mail-user-agent 'mh-e-user-agent))
552 (save-excursion 558 (save-excursion
553 ;; Be sure profile is fully expanded before switching buffers 559 ;; Be sure profile is fully expanded before switching buffers
554 (let ((profile (expand-file-name (or (getenv "MH") "~/.mh_profile")))) 560 (let ((profile (expand-file-name (or (getenv "MH") "~/.mh_profile"))))
555 (set-buffer (get-buffer-create mh-temp-buffer)) 561 (set-buffer (get-buffer-create mh-temp-buffer))
556 (setq buffer-offer-save nil) ;for people who set default to t 562 (setq buffer-offer-save nil) ;for people who set default to t
583 (setq mh-unseen-seq (intern mh-unseen-seq)) 589 (setq mh-unseen-seq (intern mh-unseen-seq))
584 (setq mh-unseen-seq 'unseen)) ;old MH default? 590 (setq mh-unseen-seq 'unseen)) ;old MH default?
585 (setq mh-previous-seq (mh-get-profile-field "Previous-Sequence:")) 591 (setq mh-previous-seq (mh-get-profile-field "Previous-Sequence:"))
586 (if mh-previous-seq 592 (if mh-previous-seq
587 (setq mh-previous-seq (intern mh-previous-seq))) 593 (setq mh-previous-seq (intern mh-previous-seq)))
588 (setq mail-user-agent 'mh-e-user-agent)
589 (run-hooks 'mh-find-path-hook))) 594 (run-hooks 'mh-find-path-hook)))
590 (and mh-auto-folder-collect 595 (and mh-auto-folder-collect
591 (let ((mh-no-install t)) ;only get folders if MH installed 596 (let ((mh-no-install t)) ;only get folders if MH installed
592 (condition-case err 597 (condition-case err
593 (mh-make-folder-list-background) 598 (mh-make-folder-list-background)