changeset 5631:5e256f495401

Don't error with a non-list plist, #'copy-symbol lisp/ChangeLog addition: 2011-12-30 Aidan Kehoe <kehoea@parhasard.net> * subr.el (copy-symbol): Don't error with a non-list plist, as happens with symbols in abbrev tables.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 30 Dec 2011 13:55:07 +0000
parents f5315ccbf005
children bd80d9103fc8
files lisp/ChangeLog lisp/subr.el
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Dec 30 12:43:52 2011 +0000
+++ b/lisp/ChangeLog	Fri Dec 30 13:55:07 2011 +0000
@@ -1,3 +1,8 @@
+2011-12-30  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* subr.el (copy-symbol): Don't error with a non-list plist, as
+	happens with symbols in abbrev tables.
+
 2011-12-27  Didier Verna  <didier@xemacs.org>
 
 	* cl-macs.el (face-foreback): New defsetf.
--- a/lisp/subr.el	Fri Dec 30 12:43:52 2011 +0000
+++ b/lisp/subr.el	Fri Dec 30 13:55:07 2011 +0000
@@ -466,7 +466,7 @@
   "Return a new uninterned symbol with the same name as SYMBOL.
 If COPY-PROPERTIES is non-nil, the new symbol will have a copy of
 SYMBOL's value, function, and property lists."
-  (let ((new (make-symbol (symbol-name symbol))))
+  (let ((new (make-symbol (symbol-name symbol))) plist)
     (when copy-properties
       ;; This will not copy SYMBOL's chain of forwarding objects, but
       ;; I think that's OK.  Callers should not expect such magic to
@@ -475,7 +475,9 @@
 	   (set new (symbol-value symbol)))
       (and (fboundp symbol)
 	   (fset new (symbol-function symbol)))
-      (setplist new (copy-list (symbol-plist symbol))))
+      (setq plist (symbol-plist symbol)
+            plist (if (consp plist) (copy-list plist) plist))
+      (setplist new plist))
     new))
 
 (defun set-symbol-value-in-buffer (sym val buffer)