all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: 44331@debbugs.gnu.org
Subject: bug#44331: 28.0.50; Customize won't save a face setting, if not set first
Date: Fri, 30 Oct 2020 13:23:06 -0300	[thread overview]
Message-ID: <CABczVwcG1BzrPY1i2XigkgM8EJ5EUeOT6VTQ=d+hATEoQC=gaA@mail.gmail.com> (raw)
In-Reply-To: <CABczVwe8h2HPej9drRGVeGHW1S6xj-b-zK1LpbfK0J=o6-D3dg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 444 bytes --]

tags 44331 patch
quit

Looks like this was introduced in the fix for Bug#40866.  When only
customizing for the selected terminal, now we recreate the custom-face
widget for all kind of displays, but lose the user editions in the
process of doing that.

The attached patch fixes it, because it records the edited value in
the :shown-value property, which a custom widget prioritizes over
everything else, when finding out the value of the face.

[-- Attachment #1.2: Type: text/html, Size: 501 bytes --]

[-- Attachment #2: 0001-Fix-saving-a-face-setting-with-Customize.patch --]
[-- Type: text/x-patch, Size: 1241 bytes --]

From c3f92a5431defff64c6956bbcbee12638ae4ecef Mon Sep 17 00:00:00 2001
From: Mauro Aranda <maurooaranda@gmail.com>
Date: Fri, 30 Oct 2020 13:05:08 -0300
Subject: [PATCH] Fix saving a face setting with Customize

* lisp/cus-edit.el (custom-face-save): Make sure we back up into the
:shown-value property what the user has edited so far, if we are going
to recreate the custom-face widget.  (Bug#44331)
---
 lisp/cus-edit.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 769a69a50f..01dec6964d 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3931,6 +3931,10 @@ custom-face-save
         (custom-face-mark-to-save widget)
       ;; The user is working on only a selected terminal type;
       ;; make sure we save the entire spec to `custom-file'. (Bug #40866)
+      ;; If recreating a widget that may have been edited by the user, remember
+      ;; to always save the edited value into the :shown-value property, so
+      ;; we use that value for the recreated widget.  (Bug#44331)
+      (widget-put widget :shown-value (custom-face-widget-to-spec widget))
       (custom-face-edit-all widget)
       (custom-face-mark-to-save widget)
       (if (eq form 'selected)
-- 
2.29.0


  reply	other threads:[~2020-10-30 16:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 15:55 bug#44331: 28.0.50; Customize won't save a face setting, if not set first Mauro Aranda
2020-10-30 16:23 ` Mauro Aranda [this message]
2020-10-30 17:43   ` Mauro Aranda
2020-11-01 12:57     ` Lars Ingebrigtsen
2020-11-01 13:19       ` Mauro Aranda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABczVwcG1BzrPY1i2XigkgM8EJ5EUeOT6VTQ=d+hATEoQC=gaA@mail.gmail.com' \
    --to=maurooaranda@gmail.com \
    --cc=44331@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.