From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: zwz Newsgroups: gmane.emacs.devel Subject: Re: Is it possible to have 256 colors in Emacs on framebuffer-enabled tty Date: Thu, 01 Sep 2011 22:28:18 +0800 Message-ID: <874o0wibgd.fsf@gmail.com> References: <877h5xtxl8.fsf@gmail.com> <83hb51ftt4.fsf@gnu.org> <87aaas69bp.fsf@gmail.com> <8762lg60zo.fsf@gmail.com> <4E5C0C35.7050300@harpegolden.net> <87ei03805d.fsf@gmail.com> <83zkiqeq7i.fsf@gnu.org> <858vq9zh1c.fsf@iznogoud.viz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1314887027 28500 80.91.229.12 (1 Sep 2011 14:23:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 1 Sep 2011 14:23:47 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 01 16:23:43 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qz8BA-0003RK-CI for ged-emacs-devel@m.gmane.org; Thu, 01 Sep 2011 16:23:40 +0200 Original-Received: from localhost ([::1]:49556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz8B9-0000gd-BY for ged-emacs-devel@m.gmane.org; Thu, 01 Sep 2011 10:23:39 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz8B7-0000gY-0m for emacs-devel@gnu.org; Thu, 01 Sep 2011 10:23:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qz8B5-0006G6-9t for emacs-devel@gnu.org; Thu, 01 Sep 2011 10:23:36 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:43921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz8B5-0006E9-4G for emacs-devel@gnu.org; Thu, 01 Sep 2011 10:23:35 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qz8Az-0003MK-Dk for emacs-devel@gnu.org; Thu, 01 Sep 2011 16:23:29 +0200 Original-Received: from 60.191.28.58 ([60.191.28.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Sep 2011 16:23:29 +0200 Original-Received: from zhangweize by 60.191.28.58 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Sep 2011 16:23:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 60.191.28.58 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:Mlz3+brqAj9x7A5xUxC6VdocAwA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:143689 Archived-At: Wolfgang Jenkner writes: > Eli Zaretskii writes: > >>> From: zwz >>> Date: Tue, 30 Aug 2011 22:05:50 +0800 >>> >>> Do you mean if there is a lisp/term/fbterm.el that deals with the >>> escapes, then it is possible to have 256 colors in Emacs on fbterm? >> >> No, such an fbterm.el does not exist. But given enough information >> about this terminal, it could be written in a way that's similar to >> xterm.el. > > I think the 256 colors support in term/xterm.el is general enough to > support fbterm as well. At least the following quick'n'dirty adaption > from term/linux.el seems to work for that (provided the terminfo stuff > is correctly installed, TERM is set to fbterm and the code below is > saved to term/fbterm.el somewhere in load-path). > > #+BEGIN_SRC emacs-lisp > ;; -*- no-byte-compile: t -*- > > (load "term/xterm") > > (defun terminal-init-fbterm () > "Terminal initialization function for linux fbterm." > (unless (terminal-coding-system) > (set-terminal-coding-system 'utf-8-unix)) > > ;; It can't really display underlines. > (tty-no-underline) > > (ignore-errors (when gpm-mouse-mode (require 't-mouse) > (gpm-mouse-enable))) > > (xterm-register-default-colors)) > > ;;; fbterm.el ends here > #+END_SRC Great, the code works! Is it a good idea to make it the default code to run when Emacs can not find the right term/*.el if term/xterm.el is really general enough?