Michael Sperber <sperber(a)deinprogramm.de> writes:
Jeff Sparkes <jsparkes(a)gmail.com> writes:
> I ran into this while updating org-mode. The diff is also attached.
Excellent! Any chance of documentation for WHEN and DOCSTRING? (In
particular, shouldn't it *do* something with WHEN?)
The FSF version doesn't document them either. :-)
diff --git a/lisp/obsolete.el b/lisp/obsolete.el
--- a/lisp/obsolete.el
+++ b/lisp/obsolete.el
@@ -36,12 +36,14 @@
;;; Code:
-(defsubst define-obsolete-function-alias (oldfun newfun)
+(defsubst define-obsolete-function-alias (oldfun newfun &optional when
+ docstring)
"Define OLDFUN as an obsolete alias for function NEWFUN.
This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN
-as obsolete."
+as obsolete. WHEN is a string indicating the version where the function was
+first made obsolete. DOCSTRING is unused; it is included for compatibility."
(define-function oldfun newfun)
- (make-obsolete oldfun newfun))
+ (make-obsolete oldfun newfun when))
(defsubst define-compatible-function-alias (oldfun newfun)
"Define OLDFUN as a compatible alias for function NEWFUN.
@@ -50,16 +52,20 @@
(define-function oldfun newfun)
(make-compatible oldfun newfun))
-(defsubst define-obsolete-variable-alias (oldvar newvar)
+(defsubst define-obsolete-variable-alias (oldvar newvar &optional when
+ docstring)
"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.
+setting NEWVAR and marks OLDVAR as obsolete. WHEN is a string indicating
+the version where the variable was first made obsolete. DOCSTRING is the
+documentation for the obsolete variable.
+
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)
+ (defvaralias oldvar newvar docstring)
(make-obsolete-variable oldvar newvar)
(and needs-setting (set newvar value))))
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches