From xemacs-m  Fri Mar 14 20:36:20 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id UAA14647
	for <xemacs-beta@xemacs.org>; Fri, 14 Mar 1997 20:36:17 -0600 (CST)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.5/8.8.5) id SAA04509;
	Fri, 14 Mar 1997 18:48:14 -0800
Mail-Copies-To: never
To: xemacs-beta@xemacs.org
Subject: Re: Query for user-mail-address (was: Re: [comp.xemacs.xemacs]: forwarded message from Michael Uelschen)
References: <QQcgvv19473.199703141549@crystal.WonderWorks.COM> 	<199703141642.LAA29628@black-ice.cc.vt.edu> 	<QQcgwa20642.199703141708@crystal.WonderWorks.COM> 	<rvbu8mmjeq.fsf@sdnp5.ucsd.edu> 	<QQcgwf21845.199703141829@crystal.WonderWorks.COM> 	<rj3etyb83j.fsf_-_@zuse.dina.kvl.dk> 	<rviv2uccfu.fsf@sdnp5.ucsd.edu> <QQcgwy26129.199703142311@crystal.WonderWorks.COM>
X-Url: http://www.miranova.com/%7Esteve/
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
In-Reply-To: Kyle Jones's message of Fri, 14 Mar 1997 18:11:41 -0500 (EST)
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: text/plain; charset=US-ASCII
Date: 14 Mar 1997 18:48:13 -0800
Message-ID: <m267yteuqa.fsf@altair.xemacs.org>
Lines: 67
X-Mailer: Gnus v5.4.26/XEmacs 20.1(beta7)

Index: lisp/modes/sendmail.el
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/lisp/modes/sendmail.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 sendmail.el
--- sendmail.el	1996/12/18 22:42:45	1.1.1.1
+++ sendmail.el	1997/03/15 02:41:38
@@ -286,6 +286,30 @@
 ;	(setq mail-alias-modtime modtime
 ;	      mail-aliases t))))
 
+;; Courtesy of Per Abrahamsen <abraham@dina.kvl.dk> in an attempt to make
+;; Emacs and XEmacs less stupid about default mail addresses.
+
+;; We trust the administrator if he has set `mail-host-address'.
+(defcustom query-user-mail-address (not mail-host-address)
+  "If non-nil, prompt the user for his mail address."
+  :group 'message
+  :type 'boolean)
+
+(defun user-mail-address ()
+  "Query the user for his mail address, unless it is already known."
+  (interactive)
+  (when query-user-mail-address
+    (setq user-mail-address
+	  (read-string "Your mail address? " (cons user-mail-address 0)))
+    (setq query-user-mail-address nil)
+    ;; TODO: Run sanity check from Gnus here.
+    (when (y-or-n-p "Save address for future sessions? ")
+      (put 'user-mail-address 'saved-value
+	   (list user-mail-address))
+      (put 'query-user-mail-address 'saved-value '(nil))
+      (custom-save-all)))
+  user-mail-address)
+
 (defun mail-setup (to subject in-reply-to cc replybuffer actions)
   (or mail-default-reply-to
       (setq mail-default-reply-to (getenv "REPLYTO")))
@@ -823,6 +847,9 @@
 	    (setq mail-do-fcc-cached-timezone
 		  (buffer-substring (point-min) (1- (point-max)))))))))
 
+(eval-when-compile
+  (require 'vm-misc))
+
 (defun mail-do-fcc-rmail-internal (buffer)
   (or (eq major-mode 'rmail-mode) (error "this only works in rmail-mode"))
   (let ((b (point-min))
@@ -841,14 +868,6 @@
 	  (insert "\n\C-_"))
       (narrow-to-region b e)
       (rmail-maybe-set-message-counters))))
-
-;;; Load VM into the compilation environment but not the load environment.
-(eval-when-compile
- (or (and (boundp 'loading-vm-kludge) loading-vm-kludge)
-     ;; nastiness to avoid circular provide/require dependency nonsense
-     (fboundp 'vm-spool-files)
-     (let ((loading-vm-kludge t))
-       (require 'vm))))
 
 (defun mail-do-fcc-vm-internal (buffer)
   (or (eq major-mode 'vm-mode) (error "this only works in vm-mode"))

-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.

