From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sean Peters" Newsgroups: gmane.emacs.bugs Subject: bug#16755: 24.3; customize-save-variable saves the wrong value Date: Fri, 14 Feb 2014 15:23:52 +0000 Message-ID: <21246.13576.276212.697702@eddie.wibble.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1392396194 11510 80.91.229.3 (14 Feb 2014 16:43:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2014 16:43:14 +0000 (UTC) To: 16755@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 14 17:43:22 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WELrF-0005UI-3Q for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Feb 2014 17:43:21 +0100 Original-Received: from localhost ([::1]:52689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WELrE-0005Wt-Nm for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Feb 2014 11:43:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WELr6-0005VU-LM for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 11:43:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WELqx-0005RD-Ps for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 11:43:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WELqx-0005R9-M5 for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 11:43:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WELqx-0000R9-DC for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 11:43:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Sean Peters" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Feb 2014 16:43:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16755 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13923961731586 (code B ref -1); Fri, 14 Feb 2014 16:43:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Feb 2014 16:42:53 +0000 Original-Received: from localhost ([127.0.0.1]:52546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WELql-0000PU-Rt for submit@debbugs.gnu.org; Fri, 14 Feb 2014 11:42:52 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36985) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WEKch-0005PM-4j for submit@debbugs.gnu.org; Fri, 14 Feb 2014 10:24:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEKcX-0005QQ-Ps for submit@debbugs.gnu.org; Fri, 14 Feb 2014 10:24:09 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:53876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEKcX-0005QM-MH for submit@debbugs.gnu.org; Fri, 14 Feb 2014 10:24:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEKcT-0006M5-Eq for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 10:24:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEKcP-0005PR-6F for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 10:24:01 -0500 Original-Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:54609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEKcO-0005PN-VB for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 10:23:57 -0500 Original-Received: by mail-wi0-f174.google.com with SMTP id f8so577941wiw.7 for ; Fri, 14 Feb 2014 07:23:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:content-type:content-transfer-encoding:message-id:date :to:subject:from; bh=Mvf5CoEgUZXBJ28fHP2SON/ap/PECJKRd0gCSc+7D6U=; b=XxzRiUDyx0T2sF0Sl1GM9kVe9jogVHD6RUFKGgQcNIhl4fcQFnx1g6IHhc8mxXdPLN GXlO37R1jveuTOZiLB7aeFqAaWwyJK4KRKkUZikLPy56fmO+PNEXFRjKh3Y9JF5NY78b bOCWRcCt328ijnhznNNQJi1Hw4MHX8ED85qPMc/FUftQ5HUNDMIs9L9mO8pIRTxSpzl4 ptbl1P07IQjwnuGLHFQF5D1znXa/BacEHTDDGfLm+BA1Amu3dyIXaE0b2dDqlIvbi6aU q5MdGNAOSneVpyY7c+6suEW6Ud45MnGXhG/kUn6i4nQemnbfMvyWgRkDKrzDGmjfwQlK iszg== X-Received: by 10.194.87.104 with SMTP id w8mr71109wjz.90.1392391435959; Fri, 14 Feb 2014 07:23:55 -0800 (PST) Original-Received: from eddie (static-195-248-120-63.adsl.hotchilli.net. [195.248.120.63]) by mx.google.com with ESMTPSA id ux5sm13444508wjc.6.2014.02.14.07.23.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 14 Feb 2014 07:23:55 -0800 (PST) X-Mailer: VM 8.1.2 under 24.3.1 (i486-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Fri, 14 Feb 2014 11:42:49 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:85579 Archived-At: Bug: customize-save-variable saves the wrong value if custom-set changes the value. Example: (defcustom emacspeak-feeds '( ("Wired News" "http://www.wired.com/news_drop/netcenter/netcenter.rdf" rss) ("BBC Podcast Directory" "http://www.bbc.co.uk/podcasts.opml" opml) ("BBC News" "http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/front_page/rss091.xml" rss) ("CNet Tech News" "http://feeds.feedburner.com/cnet/tcoc" rss) ) "Table of RSS feeds." :type '(repeat (list :tag "Feed" (string :tag "Title") (string :tag "URI") (choice :tag "Type" (const :tag "RSS" rss) (const :tag "opml" opml) (const :tag "Atom" atom)))) :initialize 'custom-initialize-reset :set #'(lambda (sym val) (set-default sym (sort val #'(lambda (a b) (string-lessp (first a) (first b)))))) :group 'emacspeak-feeds) (customize-save-variable 'emacspeak-feeds (push '("z" "z" 'rss) emacspeak-feeds)) The value that gets saved is just '("z" "z" (quote rss)) instead of the existing list with this on the end. Cause: These two lines from customize-save-variable show the problem: (funcall (or (get variable 'custom-set) 'set-default) variable value) (put variable 'saved-value (list (custom-quote value))) During the call of custom-set, value gets destructively sorted. So when value is used for setting saved-value it is missing the part of the sorted list of settings before the newly added feed. Fix: I think customize-save-variable should use (default-value variable) instead of value in all the places it currently uses value after the call to custom-set. Also, customize-set-variable may have a similar problem. Sean --