2009-07-15 156 views
0

我已经设置了两个版本:如何正确设置Emacs颜色?

My computer  apt-get emacs 23.0.91 
Remote server yum  emacs 21.4 

我已经下载彩色主题6.6.0,把文件在/ usr /共享/ emacs的/ -version- /口齿不清/,和我有这在我的.emacs:在终端

(require 'color-theme) 
(color-theme-initialize) 
(color-theme-midnight) 

运行emacs的,所有的颜色正确显示在我的电脑上,但在服务器上,我只得到两种颜色???背景是一种颜色,文字是另一种颜色,不管我选择什么主题。当我启动emacs时没有错误出现。

有什么建议吗?

回答

6

Unix and Color Highlighting转述:

为了能够使用语法高亮在Unix/Linux机器,你需要或者支持颜色的终端。某些系统(AIX for AIX)需要一个由tic在xterm-color.tic文件中生成的TERMINFO文件。这里有一个剪断:

setenv TERMINFO /home/cfl/lib/terminfo 
tic xterm-color 
setenv TERM xterm-color 

再次,读Unix and Color Highlighting文章的所有细节。


在另一方面,这是我的的.emacs文件包含用于设置颜色(深色背景上)。

;; Maximum colors 
(setq font-lock-maximum-decoration t) 

(setq frame-background-mode 'dark) 

(setq auto-mode-alist '(("\\.ad[bs]\\'" . ada-mode) 
         ("\\.awk\\'"  . awk-mode) 
         ("\\.lex\\'"  . c-mode) 
         ("\\.[cy]\\'"  . c++-mode) 
         ("\\.h\\'"  . c++-mode) 
         ("\\.hxx\\'"  . c++-mode) 
         ("\\.[CH]\\'"  . c++-mode) 
         ("\\.java\\'"  . java-mode) 
         ("\\.cc\\'"  . c++-mode) 
         ("\\.hh\\'"  . c++-mode) 
         ("\\.cxx\\'"  . c++-mode) 
         ("\\.cpp\\'"  . c++-mode) 
         ("\\.rc\\'"  . c++-mode) ;; resource files 
         ("\\.rcv\\'"  . c++-mode) 
         ("\\.m\\'"  . matlab-mode) 
         ("\\.p[lm]\\'" . perl-mode) 
         ("\\.cgi\\'"  . perl-mode) 
         ("\\.f\\'"  . fortran-mode) 
         ("\\.F\\'"  . fortran-mode) 
         ("\\.f90\\'"  . f90-mode) 
         ("\\.F90\\'"  . f90-mode) 
         ("\\.el\\'"  . emacs-lisp-mode) 
         ("\\.emacs\\'" . emacs-lisp-mode) 
         ("\\.tex\\'"  . LaTeX-mode) 
         ("\\.bib\\'"  . bibtex-mode) 
         ("[Mm]akefile\\'" . makefile-mode) 
         ("\\.mak\\'"  . makefile-mode) 
         ("\\[Mm]akefile.\\'" . makefile-mode) 
         ("\\.bat\\'"  . shell-script-mode) 
         ("\\.tar\\'"  . tar-mode) 
         ("\\.php\\'"  . php-mode) 
         ("\\.html\\'"  . html-mode) 
         ("\\.jnlp\\'"  . html-mode) 
         ("\\.xml\\'"  . html-mode) 
         ("\\.pddl\\'"  . lisp-mode) 
         ("\\.css\\'"  . css-mode) 
         ("\\.py\\'"  . python-mode) 
         ("\\.yml\\'"  . yaml-mode) 
         ("\\.lisp\\'"  . lisp-mode))) 
2

您需要设置环境变量TERM像这样(假设的bash shell):

出口TERM = “xterm方式256color”

如果从内运行的emacs屏幕,您将不得不同样将以下内容添加到.screenrc。

长期屏幕256color

如果这不起作用,可能是因为你的系统没有安装相应的termcap。在一个deb/ubuntu系统,例如,你必须:

的apt-get安装ncurses的长期

我不是一个基于RPM的系统上某些但要确保的ncurses和的termcap安装。

相关问题