all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Helmut Eller <eller.helmut@gmail.com>
To: 64725@debbugs.gnu.org
Subject: bug#64725: 30.0.50; set-face-foreground shows background colors
Date: Wed, 19 Jul 2023 09:09:11 +0200	[thread overview]
Message-ID: <m2o7k8ml7s.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]


When I try to set the foreground color of a face, e.g. with:

  M-x set-face-foreground RET font-lock-string-face RET

and then press TAB to see the available colors, then Emacs displays the
list of colors as background with text in the default foreground.

It would be more useful to see the text with the candidate color as
foreground on the default background.

Maybe you could consider this patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: faces.patch --]
[-- Type: text/x-diff, Size: 975 bytes --]

diff --git a/lisp/faces.el b/lisp/faces.el
index 44d64c743ba..6233afb0d4d 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1340,10 +1340,11 @@ read-face-attribute
 		       (format "%s" old-value))))
 	     (setq new-value
                    (if (memq attribute '(:foreground :background))
-                       (let ((color
-                              (read-color
-                               (format-prompt "%s for face `%s'"
-                                              default attribute-name face))))
+                       (let* ((prompt (format-prompt
+                                       "%s for face `%s'"
+                                       default attribute-name face))
+                              (fg (eq attribute ':foreground))
+                              (color (read-color prompt nil nil nil fg)))
                          (if (equal (string-trim color) "")
                              default
                            color))

[-- Attachment #3: Type: text/plain, Size: 792 bytes --]




In GNU Emacs 30.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.16.0) of 2023-07-19 built on caladan
Repository revision: 8b1c92da79f967172afc3214bc9ee58bd08ddc17
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --with-xpm=ifavailable --with-jpeg=ifavailable
 --with-gif=ifavailable --with-tiff=ifavailable'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSELINUX
LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 GTK3
ZLIB

Important settings:
  value of $LANG: C.UTF-8
  locale-coding-system: utf-8-unix

             reply	other threads:[~2023-07-19  7:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19  7:09 Helmut Eller [this message]
2023-07-19 12:44 ` bug#64725: 30.0.50; set-face-foreground shows background colors Eli Zaretskii
2023-07-19 15:45   ` Helmut Eller
2023-07-19 16:26     ` Eli Zaretskii
2023-07-20 14:34       ` Helmut Eller
2023-08-03  7:58         ` Eli Zaretskii

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=m2o7k8ml7s.fsf@gmail.com \
    --to=eller.helmut@gmail.com \
    --cc=64725@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.