From: Christopher Genovese Date: Mon, 5 Dec 2011 22:22:15 +0000 (-0500) Subject: * lisp/emacs-lisp/assoc.el (aput): Fix return value X-Git-Tag: emacs-pretest-24.0.93~221 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e65adfac3bc8c7dcc78464707c66d6aea958f684;p=emacs.git * lisp/emacs-lisp/assoc.el (aput): Fix return value Fixes: debbugs:10146 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8cb089d523e..2bc6b658823 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-12-05 Christopher Genovese (tiny change) + + * emacs-lisp/assoc.el (aput): Fix return value (bug#10146) + 2011-12-05 Eli Zaretskii * descr-text.el (describe-char): Fix display of strong diff --git a/lisp/emacs-lisp/assoc.el b/lisp/emacs-lisp/assoc.el index 31be851f2dd..e650995d3fe 100644 --- a/lisp/emacs-lisp/assoc.el +++ b/lisp/emacs-lisp/assoc.el @@ -61,10 +61,9 @@ pair is not at the head of alist. ALIST is not altered." (defun aput (alist-symbol key &optional value) - "Inserts a key-value pair into an alist. + "Insert a key-value pair into an alist. The alist is referenced by ALIST-SYMBOL. The key-value pair is made -from KEY and optionally, VALUE. Returns the altered alist or nil if -ALIST is nil. +from KEY and optionally, VALUE. Returns the altered alist. If the key-value pair referenced by KEY can be found in the alist, and VALUE is supplied non-nil, then the value of KEY will be set to VALUE. @@ -78,7 +77,7 @@ of the alist (with value nil if VALUE is nil or not supplied)." (setq alist (symbol-value alist-symbol)) (cond ((null alist) (set alist-symbol elem)) ((anot-head-p alist key) (set alist-symbol (nconc elem alist))) - (value (setcar alist (car elem))) + (value (setcar alist (car elem)) alist) (t alist))))