]> git.eshelyaron.com Git - emacs.git/commitdiff
Explain tty-color-mode frame parameter more.
authorRobert Pluim <rpluim@gmail.com>
Fri, 18 Oct 2024 09:22:52 +0000 (11:22 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 22 Oct 2024 18:52:10 +0000 (20:52 +0200)
* doc/emacs/cmdargs.texi (Colors X): Explain that tty color
support is dynamic.
* doc/lispref/frames.texi (Font and Color Parameters): Explain
that 'tty-color-mode' can be changed on the fly.
* doc/misc/efaq.texi (Colors on a TTY): Explain how to disable
'tty-color-mode', either at startup or dynamically.

(cherry picked from commit 2c640e63a8a6ea9f2fbbb55ff44d7a8a0ec0f4b4)

doc/emacs/cmdargs.texi
doc/lispref/frames.texi
doc/misc/efaq.texi

index ba4b45d272bc3a2fa97f2c0cf4bb32e73df37123..9b72b8836289acf1290ea9413c734f35c6771d52 100644 (file)
@@ -1027,7 +1027,11 @@ there is no mode that supports @var{num} colors, Emacs acts as if
 @var{num} were 0, i.e., it uses the terminal's default color support
 mode.
 @end table
-If @var{mode} is omitted, it defaults to @var{ansi8}.
+If @var{mode} is omitted, it defaults to @var{ansi8}.  This support is
+dynamic: the current mode is available via the @code{tty-color-mode}
+frame parameter, and it can be changed by modifying that frame parameter.
+This means you can also specify the initial value via
+@code{default-frame-alist} instead of the command-line option.
 @end table
 
   For example, to use a coral mouse cursor and a slate blue text cursor,
index 0d3b9e0c33d4e5f6b1bc4ac328043b82291b97bb..a01894897cffae2cd1b7774bb42bde8a299b9cb1 100644 (file)
@@ -2447,7 +2447,7 @@ off color support.
 
 If the parameter's value is a symbol, it specifies a number through
 the value of @code{tty-color-mode-alist}, and the associated number is
-used instead.
+used instead.  This parameter supports dynamic changes.
 
 @vindex screen-gamma@r{, a frame parameter}
 @item screen-gamma
index 3554ef80bd0983d6ecdc9113193a4276ea90a486..cf9bce79039c6ea66e3122097ae14f516b3b1b74 100644 (file)
@@ -1870,6 +1870,21 @@ think that your terminal supports colors, but Emacs won't use them,
 check the @code{termcap} entry for your display type for color-related
 capabilities.
 
+If by contrast you wish to @emph{disable} tty color support, either
+start emacs with the @samp{--color=no} command-line option, or ensure
+that the frame parameter @code{tty-color-mode} is @code{no}, e.g. by
+putting the following in your init file:
+
+@lisp
+(push '(tty-color-mode . no) default-frame-alist)
+@end lisp
+
+To disable tty color support in the @emph{current} frame you can run:
+
+@lisp
+(set-frame-parameter nil 'tty-color-mode 'no)
+@end lisp
+
 The command @kbd{M-x list-colors-display} pops up a window which
 exhibits all the colors Emacs knows about on the current display.