aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorHelmut Eller2023-07-20 16:27:34 +0200
committerEli Zaretskii2023-08-03 10:45:41 +0300
commit5129ea4b0540a0df35be59cdaf2fe63260670e9f (patch)
tree7fb899a7c9a06e48f7925bf2ecf3806fe2533828 /doc/lispref
parentd727e8ee7c0b6f3457080c8a94ad54d6cffda911 (diff)
downloademacs-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.texi8
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
1541This function reads a string that is a color specification, either the 1542This function reads a string that is a color specification, either the
1542color's name or an RGB hex value such as @code{#RRRGGGBBB}. It 1543color's name or an RGB hex value such as @code{#RRRGGGBBB}. It
1543prompts with @var{prompt} (default: @code{"Color (name or #RGB triplet):"}) 1544prompts 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
1558Interactively, or when @var{display} is non-@code{nil}, the return 1559Interactively, or when @var{display} is non-@code{nil}, the return
1559value is also displayed in the echo area. 1560value is also displayed in the echo area.
1561
1562The optional arguments FOREGROUND and FACE control the appearence of
1563the completion candidates. The candidates are displayed like FACE but
1564with different colors. If FOREGROUND is non-@code{nil} the foreground
1565varies, 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