From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Aleksey Midenkov Newsgroups: gmane.emacs.help Subject: Re: Colors on TTY (v26) Date: Sun, 31 Mar 2019 21:09:56 +0300 Message-ID: References: <83v9zzgjmn.fsf@gnu.org> <83pnq7gcw9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="145205"; mail-complaints-to="usenet@blaine.gmane.org" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 31 20:11:57 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hAew1-000bff-6n for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Mar 2019 20:11:57 +0200 Original-Received: from localhost ([127.0.0.1]:40146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAew0-00041x-4U for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Mar 2019 14:11:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAevf-0003zJ-4W for help-gnu-emacs@gnu.org; Sun, 31 Mar 2019 14:11:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAeve-0004y5-2q for help-gnu-emacs@gnu.org; Sun, 31 Mar 2019 14:11:35 -0400 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:47013) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAevc-0004vG-0C; Sun, 31 Mar 2019 14:11:32 -0400 Original-Received: by mail-lf1-x135.google.com with SMTP id r25so4607561lfn.13; Sun, 31 Mar 2019 11:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Gv28hPhVUU94f91+hBGMK3gg/GWXt2x7yCARpGtgEVA=; b=rCqSjxvxaY8ryK6HMm/oKffOsfUGQnHw1A2oDnvp8Bv5/OMsk/POYi/YKNZrWezwKn a2zWifRMOfoHu5Iql/RFOBfN6VGXwQxc47H8gcyXzQuraJfBT67v5QiNkhdWMG+Mq4Dk 12T63KBoHdZeRoiQTfBZ3QEQ9sJt8XVkvq+xI5zDCpF8AsWfslegT2p1HVaS4o/lHVH2 SqQCCMt/ZRg+6DnLz5fwzTHnXhT+B9ya1nuwLG7cC92HXFVUf8+SGDxideJW6Z3KcCuB FbsSMLBYPjQeng376AfKki2UhMLhUcWnTkREPwKWfAXd5Zzas598voEa6yE5I4LX00D6 qZcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Gv28hPhVUU94f91+hBGMK3gg/GWXt2x7yCARpGtgEVA=; b=eiNNnyy6JVPv6+KDlj0mA9hE9W5/f8wPsoEXd9pE2W8pz7QTb4N8HT+7IYbbIGsdKh G6VR1rCVlMUAwfOGcM/Ze0FXL/cmm6VXuUvjNr2qwbq8f+9j6af7XdSNoFfmdZVWSWzl jsqqFK3weI2NHnGzDJV4lT/Hb0CA5BiV8Zy+Rwn1s6/oe3xMBrrtU85rzMpbI5KaKhtw iOumOiDT8fGBJii40EuQEPMS/+4NT8iuPwH67CBFjWaPR6cyD3j77Q+raMrAh/eNIQHm 02OuIDRQNPSoBeNpkduB5j/Me940gZ4forp7T8Vifp9dfWAyKFZIHXo06gM4rDoV8he3 2DZg== X-Gm-Message-State: APjAAAXENghUzdS/IXk+S9xvTNuaCI/7piJp9DDuEcDfjOPMxqnZp+iN y9Pa9Idc/cIycralOlBKvhM70FRPCpZtVZSb5fx++Rvl X-Google-Smtp-Source: APXvYqyLvt1B2z4rxRUzZXHvgY/kTRMWUhXDWIlUbeQo8meTedUM+zRpe0ANdE1Hnvr5yt3XjugGU5jlRc5ShBUmSdA= X-Received: by 2002:ac2:4563:: with SMTP id k3mr29712841lfm.101.1554055890126; Sun, 31 Mar 2019 11:11:30 -0700 (PDT) In-Reply-To: <83pnq7gcw9.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::135 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119800 Archived-At: On Sun, Mar 31, 2019 at 8:41 PM Eli Zaretskii wrote: > > From: Aleksey Midenkov > > Date: Sun, 31 Mar 2019 20:20:56 +0300 > > Cc: help-gnu-emacs@gnu.org > > > > Emacs doesn't hard-code terminal names, but it has Lisp libraries > > under lisp/term/ which are loaded by the terminal name. If you have a > > terminal that behaves like one of the ones known to Emacs, you need > > only copy the relevant Lisp library under lisp/term/ to the name of > > your terminal (with the .el extension), and things should work from > > there. > > > > I tried different terminal names. It seems, that it understands "xterm-" > prefix. The remaining part can be > > arbitrary: I literally tried "xterm-something" and it worked. I guess, > there is no such file "xterm-something" in the > > library. In any case, it's much better to rename terminal to "xterm-*", > than deal with distributed files. > > Just do "ls lisp/term/*.el" and see what you've got there. > And? > > > The full color list is indeed set during startup, so if you invoke > > list-colors-display too early during startup, you will not see that. > > This is not a bug, as Emacs can not know the color capabilities of the > > terminal until it probes them. > > > > This is indeed a bug: different result returned by same routine. Either > list-colors-display should not exist at an > > early stage or color capability probe should be done earlier. > > What do you mean "should not exists"? The code is there, it uses > whatever knowledge it has when you call it. Where you did call it, it > didn't yet query the terminal to see how many colors it supports, and > didn't set up their names. IOW, you are shooting yourself in the foot > by calling the function too early. There are various hooks provided > by startup.el which allow you to call this function when colors are > set up; do that, and Bob's your uncle. > > You may call it anything you like, but this misleading behavior causes trouble. -- All the best, Aleksey Midenkov @midenok