From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?q?Rami=20Ylim=C3=A4ki?= Newsgroups: gmane.emacs.devel Subject: [PATCH v3 4/4] Update documentation regarding 24-bit TTY colors. Date: Tue, 14 Feb 2017 17:58:22 +0200 Message-ID: <1487087902-6661-5-git-send-email-rami.ylimaki@vincit.fi> References: <1487087902-6661-1-git-send-email-rami.ylimaki@vincit.fi> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1487087949 31436 195.159.176.226 (14 Feb 2017 15:59:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2017 15:59:09 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 14 16:59:04 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdfVQ-0007q9-7I for ged-emacs-devel@m.gmane.org; Tue, 14 Feb 2017 16:59:04 +0100 Original-Received: from localhost ([::1]:35619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdfVV-0000V3-O1 for ged-emacs-devel@m.gmane.org; Tue, 14 Feb 2017 10:59:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdfVG-0000Sa-Oa for emacs-devel@gnu.org; Tue, 14 Feb 2017 10:58:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdfVB-0000nu-SM for emacs-devel@gnu.org; Tue, 14 Feb 2017 10:58:54 -0500 Original-Received: from mx1.kapsi.fi ([2001:1bc8:1004::1:25]:48796 helo=mail.kapsi.fi) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdfVB-0000mz-L2 for emacs-devel@gnu.org; Tue, 14 Feb 2017 10:58:49 -0500 Original-Received: from 91-158-222-159.elisa-laajakaista.fi ([91.158.222.159] helo=nopsakone.home) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1cdfV8-0005Tc-7Z for emacs-devel@gnu.org; Tue, 14 Feb 2017 17:58:46 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487087902-6661-1-git-send-email-rami.ylimaki@vincit.fi> X-SA-Exim-Connect-IP: 91.158.222.159 X-SA-Exim-Mail-From: rami.ylimaki@vincit.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:1bc8:1004::1:25 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212374 Archived-At: From: Rami Ylimäki * doc/misc/efaq.texi: Add instructions on how to enable direct color TTY mode. * etc/NEWS: Mention direct color TTY mode and point to FAQ. --- doc/misc/efaq.texi | 33 +++++++++++++++++++++++++++++++++ etc/NEWS | 5 +++++ 2 files changed, 38 insertions(+) diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index f7a47f8..e9cfe7a 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -1491,6 +1491,39 @@ exhibits all the colors Emacs knows about on the current display. Syntax highlighting is on by default since version 22.1. +Emacs 26.1 and later support direct color mode in terminals. If Emacs +finds Terminfo capabilities @samp{setb24} and @samp{setf24}, 24-bit +direct color mode is used. The capability strings are expected to +take one 24-bit pixel value as argument and transform the pixel to a +string that can be used to send 24-bit colors to the terminal. + +There aren't yet any standard terminal type definitions that would +support the capabilities, but Emacs can be invoked with a custom +definition as shown below. + +@example +$ cat terminfo-24bit.src + +# Use colon separators. +xterm-24bit|xterm with 24-bit direct color mode, + use=xterm-256color, + setb24=\E[48:2:%p1%@{65536@}%/%d:%p1%@{256@}%/%@{255@}%&%d:%p1%@{255@}%&%dm, + setf24=\E[38:2:%p1%@{65536@}%/%d:%p1%@{256@}%/%@{255@}%&%d:%p1%@{255@}%&%dm, +# Use semicolon separators. +xterm-24bits|xterm with 24-bit direct color mode, + use=xterm-256color, + setb24=\E[48;2;%p1%@{65536@}%/%d;%p1%@{256@}%/%@{255@}%&%d;%p1%@{255@}%&%dm, + setf24=\E[38;2;%p1%@{65536@}%/%d;%p1%@{256@}%/%@{255@}%&%d;%p1%@{255@}%&%dm, + +$ tic -x -o ~/.terminfo terminfo-24bit.src + +$ TERM=xterm-24bit emacs -nw +@end example + +Currently there's no standard way to determine whether a terminal +supports direct color mode. If such standard arises later on, support +for @samp{setb24} and @samp{setf24} may be removed. + @node Debugging a customization file @section How do I debug a @file{.emacs} file? @cindex Debugging @file{.emacs} file diff --git a/etc/NEWS b/etc/NEWS index 31b05dd..5cb4d02 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -77,6 +77,11 @@ modern init systems such as systemd, which manage many of the traditional aspects of daemon behavior themselves. '--old-daemon' is now an alias for '--daemon'. ++++ +** Terminal is initialized to use 24-bit colors if required +capabilities are found from terminfo. See the FAQ node 'Colors on a +TTY' for more information. + * Changes in Emacs 26.1 -- 2.7.4