emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog emacs-lisp/byte-run.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp ChangeLog emacs-lisp/byte-run.el
Date: Fri, 16 Oct 2009 06:48:29 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/10/16 06:48:29

Modified files:
        lisp           : ChangeLog 
        lisp/emacs-lisp: byte-run.el 

Log message:
        (define-obsolete-variable-alias): Doc fix.
        Maybe copy some custom properties from old to new name.  (Bug#4706)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16435&r2=1.16436
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/emacs-lisp/byte-run.el?cvsroot=emacs&r1=1.40&r2=1.41

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16435
retrieving revision 1.16436
diff -u -b -r1.16435 -r1.16436
--- ChangeLog   16 Oct 2009 05:03:56 -0000      1.16435
+++ ChangeLog   16 Oct 2009 06:48:24 -0000      1.16436
@@ -1,3 +1,8 @@
+2009-10-16  Glenn Morris  <address@hidden>
+
+       * emacs-lisp/byte-run.el (define-obsolete-variable-alias): Doc fix.
+       Maybe copy some custom properties from old to new name.  (Bug#4706)
+
 2009-10-16  Juanma Barranquero  <address@hidden>
 
        * subr.el (error, sit-for, start-process-shell-command)

Index: emacs-lisp/byte-run.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/byte-run.el,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- emacs-lisp/byte-run.el      6 Oct 2009 03:43:27 -0000       1.40
+++ emacs-lisp/byte-run.el      16 Oct 2009 06:48:28 -0000      1.41
@@ -175,28 +175,32 @@
 (defmacro define-obsolete-variable-alias (obsolete-name current-name
                                                 &optional when docstring)
   "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
-
-\(define-obsolete-variable-alias 'old-var 'new-var \"22.1\" \"old-var's doc.\")
-
-is equivalent to the following two lines of code:
-
-\(defvaralias 'old-var 'new-var \"old-var's doc.\")
-\(make-obsolete-variable 'old-var 'new-var \"22.1\")
+This uses `defvaralias' and `make-obsolete-variable' (which see).
+See the Info node `(elisp)Variable Aliases' for more details.
 
 If CURRENT-NAME is a defcustom (more generally, any variable
 where OBSOLETE-NAME may be set, e.g. in a .emacs file, before the
 alias is defined), then the define-obsolete-variable-alias
-statement should be placed before the defcustom.  This is so that
-any user customizations are applied before the defcustom tries to
-initialize the variable (this is due to the way `defvaralias' works).
-Exceptions to this rule occur for define-obsolete-variable-alias
-statements that are autoloaded, or in files dumped with Emacs.
-
-See the docstrings of `defvaralias' and `make-obsolete-variable' or
-Info node `(elisp)Variable Aliases' for more details."
+statement should be evaluated before the defcustom, if user
+customizations are to be respected.  The simplest way to achieve
+this is to place the alias statement before the defcustom (this
+is not necessary for aliases that are autoloaded, or in files
+dumped with Emacs).  This is so that any user customizations are
+applied before the defcustom tries to initialize the
+variable (this is due to the way `defvaralias' works).
+
+For the benefit of `custom-set-variables', if OBSOLETE-NAME has
+any of the following properties, they are copied to
+CURRENT-NAME, if it does not already have them:
+'saved-value, 'saved-variable-comment."
   (declare (doc-string 4))
   `(progn
      (defvaralias ,obsolete-name ,current-name ,docstring)
+     ;; See Bug#4706.
+     (mapc (lambda (prop) (or (get ,current-name prop)
+                              (put ,current-name prop
+                                   (get ,obsolete-name prop))))
+           '(saved-value saved-variable-comment))
      (make-obsolete-variable ,obsolete-name ,current-name ,when)))
 (set-advertised-calling-convention
  ;; New code should always provide the `when' argument.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]