From xemacs-m  Fri Aug  8 07:11:02 1997
Received: from frege.math.ethz.ch (root@frege-d-math-north-g-west.math.ethz.ch [129.132.145.3])
	by xemacs.org (8.8.5/8.8.5) with SMTP id HAA07705
	for <xemacs-beta@xemacs.org>; Fri, 8 Aug 1997 07:10:58 -0500 (CDT)
Received: from midget.math.ethz.ch (vroonhof@midget [129.132.145.4]) by frege.math.ethz.ch (8.6.12/Main-STAT-mailer) with ESMTP id OAA18033 for <xemacs-beta@xemacs.org>; Fri, 8 Aug 1997 14:10:57 +0200
Received: (vroonhof@localhost) by midget.math.ethz.ch (8.6.12/D-MATH-client) id OAA01683; Fri, 8 Aug 1997 14:10:44 +0200
To: xemacs-beta@xemacs.org
Subject: Obsolete variables in non loaded packages...
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: multipart/mixed;
 boundary="Multipart_Fri_Aug__8_14:10:44_1997-1"
Content-Transfer-Encoding: 7bit
From: Jan Vroonhof <vroonhof@math.ethz.ch>
Date: 08 Aug 1997 14:10:44 +0200
Message-ID: <bypvroswmz.fsf@midget.math.ethz.ch>
Lines: 70
X-Mailer: Gnus v5.4.55/XEmacs 19.15

--Multipart_Fri_Aug__8_14:10:44_1997-1
Content-Type: text/plain; charset=US-ASCII


This patch against b14, makes obsolete variables actally work. It
fixes a sitation where the user has a setq in the initfile for the
obsolete variable. This value was never used if the package was
demand loaded afterwards. Note the requirement at the end of the doc
string. (The declarations in gnus-picon and hm--html* violate this).

Jan


--Multipart_Fri_Aug__8_14:10:44_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="obsolete.pat"
Content-Transfer-Encoding: 7bit

Index: lisp/ChangeLog
===================================================================
RCS file: /home/cvs/root/xemacs/lisp/ChangeLog,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ChangeLog	1997/08/07 19:01:26	1.1.1.1
+++ ChangeLog	1997/08/07 22:39:33	1.2
@@ -1,3 +1,9 @@
+1997-08-08  Jan Vroonhof  <vroonhof@math.ethz.ch>
+
+	* prim/obsolete.el (define-obsolete-variable-alias): If the
+	obsolete variable was setq'ed before the code was loaded we want
+	that value.
+
 1997-07-19  Steven L Baur  <steve@altair.xemacs.org>
 
 	* prim/about.el: Sundry changes.
Index: lisp/prim/obsolete.el
===================================================================
RCS file: /home/cvs/root/xemacs/lisp/prim/obsolete.el,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- obsolete.el	1997/08/07 19:01:58	1.1.1.1
+++ obsolete.el	1997/08/07 22:40:39	1.2
@@ -48,9 +48,15 @@
 (defsubst define-obsolete-variable-alias (oldvar newvar)
   "Define OLDVAR as an obsolete alias for variable NEWVAR.
 This makes referencing or setting OLDVAR equivalent to referencing or
-setting NEWVAR and marks OLDVAR as obsolete."
-  (defvaralias oldvar newvar)
-  (make-obsolete-variable oldvar newvar))
+setting NEWVAR and marks OLDVAR as obsolete. 
+If OLDVAR was bound and NEWVAR was not, Set NEWVAR to OLDVAR.
+
+Note: Use this before any other references (defvar/defcustom) to NEWVAR"
+  (let ((needs-setting (and (boundp oldvar) (not (boundp newvar))))
+        (value (and (boundp oldvar) (symbol-value oldvar))))
+     (defvaralias oldvar newvar)
+     (make-obsolete-variable oldvar newvar)
+     (and needs-setting (set newvar value))))
 
 (defsubst define-compatible-variable-alias (oldvar newvar)
   "Define OLDVAR as a compatible alias for variable NEWVAR.

--Multipart_Fri_Aug__8_14:10:44_1997-1
Content-Type: text/plain; charset=US-ASCII



--Multipart_Fri_Aug__8_14:10:44_1997-1--

