diff options
| author | Helmut Eller | 2023-07-20 16:27:34 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-08-03 10:45:41 +0300 |
| commit | 5129ea4b0540a0df35be59cdaf2fe63260670e9f (patch) | |
| tree | 7fb899a7c9a06e48f7925bf2ecf3806fe2533828 /doc/lispref | |
| parent | d727e8ee7c0b6f3457080c8a94ad54d6cffda911 (diff) | |
| download | emacs-5129ea4b0540a0df35be59cdaf2fe63260670e9f.tar.gz emacs-5129ea4b0540a0df35be59cdaf2fe63260670e9f.zip | |
Improve interactive prompting for face colors
When displaying the completion candidates, show how the face would
look with the new foreground/background.
* lisp/faces.el (faces--string-with-color): New helper,
factored out from 'defined-colors-with-face-attributes'.
(defined-colors-with-face-attributes): Use it.
(read-color): Add optional argument FACE and pass
it to 'faces--string-with-color.'
(read-face-attribute): Call 'read-color' with more appropriate
foreground and face arguments.
* doc/lispref/minibuf.texi (High-Level Completion): Describe
the intention behind the arguments FOREGROUND and FACE of
'read-color'. (Bug#64725)
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/minibuf.texi | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 31b020db57c..4ed36edb8c1 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -1537,7 +1537,8 @@ that it uses the predicate @code{custom-variable-p} instead of | |||
| 1537 | @code{commandp}. | 1537 | @code{commandp}. |
| 1538 | @end defun | 1538 | @end defun |
| 1539 | 1539 | ||
| 1540 | @deffn Command read-color &optional prompt convert allow-empty display | 1540 | @deffn Command read-color &optional prompt convert allow-empty @ |
| 1541 | display foreground face | ||
| 1541 | This function reads a string that is a color specification, either the | 1542 | This function reads a string that is a color specification, either the |
| 1542 | color's name or an RGB hex value such as @code{#RRRGGGBBB}. It | 1543 | color's name or an RGB hex value such as @code{#RRRGGGBBB}. It |
| 1543 | prompts with @var{prompt} (default: @code{"Color (name or #RGB triplet):"}) | 1544 | prompts with @var{prompt} (default: @code{"Color (name or #RGB triplet):"}) |
| @@ -1557,6 +1558,11 @@ non-@code{nil} and the user enters null input. | |||
| 1557 | 1558 | ||
| 1558 | Interactively, or when @var{display} is non-@code{nil}, the return | 1559 | Interactively, or when @var{display} is non-@code{nil}, the return |
| 1559 | value is also displayed in the echo area. | 1560 | value is also displayed in the echo area. |
| 1561 | |||
| 1562 | The optional arguments FOREGROUND and FACE control the appearence of | ||
| 1563 | the completion candidates. The candidates are displayed like FACE but | ||
| 1564 | with different colors. If FOREGROUND is non-@code{nil} the foreground | ||
| 1565 | varies, otherwise the background. | ||
| 1560 | @end deffn | 1566 | @end deffn |
| 1561 | 1567 | ||
| 1562 | See also the functions @code{read-coding-system} and | 1568 | See also the functions @code{read-coding-system} and |