# HG changeset patch # User Aidan Kehoe # Date 1325253307 0 # Node ID 5e256f495401fa242ea0e8d330807ecaae2b709f # Parent f5315ccbf00577d58d6613eb030e6f8f11cf7ad5 Don't error with a non-list plist, #'copy-symbol lisp/ChangeLog addition: 2011-12-30 Aidan Kehoe * subr.el (copy-symbol): Don't error with a non-list plist, as happens with symbols in abbrev tables. diff -r f5315ccbf005 -r 5e256f495401 lisp/ChangeLog --- 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 + + * subr.el (copy-symbol): Don't error with a non-list plist, as + happens with symbols in abbrev tables. + 2011-12-27 Didier Verna * cl-macs.el (face-foreback): New defsetf. diff -r f5315ccbf005 -r 5e256f495401 lisp/subr.el --- 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)