From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Philip K." Newsgroups: gmane.emacs.bugs Subject: bug#41473: Not saving all user options Date: Fri, 26 Jun 2020 21:59:51 +0200 Message-ID: <87ftahtx6w.fsf@warpmail.net> References: <87sgfrxekc.fsf@warpmail.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="124429"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41473@debbugs.gnu.org To: npostavs@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 26 22:01:20 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jouXI-000WLH-6P for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Jun 2020 22:01:20 +0200 Original-Received: from localhost ([::1]:39352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jouXH-0002aS-7J for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Jun 2020 16:01:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jouX0-0002Z8-JX for bug-gnu-emacs@gnu.org; Fri, 26 Jun 2020 16:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jouX0-0000d3-9H for bug-gnu-emacs@gnu.org; Fri, 26 Jun 2020 16:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jouX0-00051S-8i for bug-gnu-emacs@gnu.org; Fri, 26 Jun 2020 16:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Philip K." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Jun 2020 20:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41473 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, 41473@debbugs.gnu.org Original-Received: via spool by 41473-submit@debbugs.gnu.org id=B41473.159320160219152 (code B ref 41473); Fri, 26 Jun 2020 20:01:02 +0000 Original-Received: (at 41473) by debbugs.gnu.org; 26 Jun 2020 20:00:02 +0000 Original-Received: from localhost ([127.0.0.1]:43124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jouW1-0004yX-SQ for submit@debbugs.gnu.org; Fri, 26 Jun 2020 16:00:02 -0400 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:51877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jouW0-0004xk-A4 for 41473@debbugs.gnu.org; Fri, 26 Jun 2020 16:00:00 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 657116F0; Fri, 26 Jun 2020 15:59:54 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 26 Jun 2020 15:59:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=warpmail.net; h= from:to:cc:subject:in-reply-to:date:message-id:mime-version :content-type; s=fm3; bh=xCDbtIG1zJUK+vUcO75mIVlbaVlj8TjPVBmxUpd MlpU=; b=SxKxQLi2F6bWNaRpjINBrWzUMCsSh4WT8ZnF7576pC3bfqTkFO/1oed jbv2mMlZyKGaxVKPIMu/v0IUDQkuKstsyUwru3l5xWJo05fxI0WoLrNb2xOTub1j 7GmHhJ3hsQLzz5M/igars4Mts8tK2EX9hVzgUVsqzd4DBRpcjXdF0j7Y6Slh7seW rlvT7R5Dt/MtCczks8KGcDe4KjChT7ZzoWDbITLRdgRYsVJqIRc34kvNE1OSjTYT rxKzKQRhXBBEfXmu/WO5JgInVpf/l3IqInp1cDGZgVWOs74p/fOnuhOMtwLlAqv1 P3Mi3hZnpvWBIhKKkKzWOWYHe1u6Mlg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=xCDbtIG1zJUK+vUcO 75mIVlbaVlj8TjPVBmxUpdMlpU=; b=G0bnv3z6j56jOktdDDPENYyKazAzeExnk VbHImHAaWeOSIshsjK7XKqpFoa1acLUxm/AA3gJxBuZYt0n9am5nREu+eXwkx4Pr o2xPQaU6b4dwBvtEOX9MabssK9JOv1ij4dBW/IKnfoGrEtuAAcwRH0pyHR7etyhm gcl9xy44sosRa3aNnVt+dT/y9+HYVUb6w4+ewdQuwrg0CDjhHkgEjKnGwtQATayw omGU8rTUK9zKl1GmdF7TjjPC4E0pYeZBlKCGjiPNeAjGfCK0wNjcE918ROn4d8mt iqz+C2z4J25jxuTm002qM0h9Sy7dZL/1zg5SZv10xdFjmcrvHb9rQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeluddgudegjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufgjfffkgggtsehmtderre dttddtnecuhfhrohhmpedfrfhhihhlihhpucfmrddfuceophhhihhlihhpseifrghrphhm rghilhdrnhgvtheqnecuggftrfgrthhtvghrnhepjeeiuedvleelffefgfeuteekleekge evffeifeffhffgueeuhedvledvueevhfegnecukfhppeekjedrudeghedrudehrdeluden ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilh hiphesfigrrhhpmhgrihhlrdhnvght X-ME-Proxy: Original-Received: from localhost (p57910f5b.dip0.t-ipconnect.de [87.145.15.91]) by mail.messagingengine.com (Postfix) with ESMTPA id 96BBE3280065; Fri, 26 Jun 2020 15:59:53 -0400 (EDT) In-Reply-To: 85367iu983.fsf@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:182421 Archived-At: --=-=-= Content-Type: text/plain > I don't see any. Regarding your suggestions in particular, I think > the plist method would be the cleanest. Four spaces strikes me as > overly cryptic. The patch below should implement that behaviour. The property "custom-inhibit-save" doesn't seem to be used anywhere else, so that should be OK. -- Philip K. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Allow-inhibiting-a-user-option-from-being-saved.patch >From 07097f7bb79e5014ceafcb02563c173938e079bc Mon Sep 17 00:00:00 2001 From: Philip K Date: Fri, 26 Jun 2020 21:54:36 +0200 Subject: [PATCH] Allow inhibiting a user option from being saved --- lisp/cus-edit.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 1ec2708550..6bd11908ce 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4594,17 +4594,19 @@ custom-save-variables (save-excursion (custom-save-delete 'custom-set-variables) (let ((standard-output (current-buffer)) - (saved-list (make-list 1 0)) - sort-fold-case) + saved-list sort-fold-case) ;; First create a sorted list of saved variables. (mapatoms (lambda (symbol) - (if (and (get symbol 'saved-value) - ;; ignore theme values - (or (null (get symbol 'theme-value)) - (eq 'user (caar (get symbol 'theme-value))))) - (nconc saved-list (list symbol))))) - (setq saved-list (sort (cdr saved-list) 'string<)) + (when (and (get symbol 'saved-value) + ;; ignore theme values + (or (null (get symbol 'theme-value)) + (eq 'user (caar (get symbol 'theme-value)))) + ;; don't save comments if the symbol as a non-nil + ;; value for it's `custom-inhibit-save' property + (not (get symbol 'custom-inhibit-save))) + (push symbol saved-list)))) + (setq saved-list (sort saved-list 'string<)) (unless (bolp) (princ "\n")) (princ "(custom-set-variables -- 2.20.1 --=-=-=--