changeset 105838:5a494d9d4e4f

(define-obsolete-variable-alias): Use dolist, and only put a prop if it is non-nil.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 03 Nov 2009 15:28:13 +0000
parents a6f26c27084c
children e0a471c09d45
files lisp/ChangeLog lisp/emacs-lisp/byte-run.el
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Nov 03 07:28:59 2009 +0000
+++ b/lisp/ChangeLog	Tue Nov 03 15:28:13 2009 +0000
@@ -1,3 +1,8 @@
+2009-11-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/byte-run.el (define-obsolete-variable-alias): Use dolist,
+	and only put a prop if it is non-nil.
+
 2009-11-03  Juri Linkov  <juri@jurta.org>
 
 	* menu-bar.el (menu-bar-make-mm-toggle, menu-bar-make-toggle)
--- a/lisp/emacs-lisp/byte-run.el	Tue Nov 03 07:28:59 2009 +0000
+++ b/lisp/emacs-lisp/byte-run.el	Tue Nov 03 15:28:13 2009 +0000
@@ -202,10 +202,10 @@
   `(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))
+     (dolist (prop '(saved-value saved-variable-comment))
+       (and (get ,obsolete-name prop)
+            (null (get ,current-name prop))
+            (put ,current-name prop (get ,obsolete-name prop))))
      (make-obsolete-variable ,obsolete-name ,current-name ,when)))
 (set-advertised-calling-convention
  ;; New code should always provide the `when' argument.