【发布时间】:2014-06-11 13:51:16
【问题描述】:
我已经尝试回答这个问题Emacs, How to change some colors in M-x shell?,但出现错误(当我调用 ansi-term 时)
Debugger entered--Lisp error: (error "Invalid face" unspecified)
internal-get-lisp-face-attribute(unspecified :foreground nil)
face-attribute(unspecified :foreground nil default)
face-foreground(unspecified nil default)
term-handle-colors-array(1)
term-handle-ansi-escape(#<process *ansi-term*> 109)
term-emulate-terminal(#<process *ansi-term*> "
\n[01;32mkuba@jcubic[00m:[01;34m~[00m$ ")
read-event(nil nil 2)
sit-for(2)
execute-extended-command(nil "bash")
call-interactively(execute-extended-command nil nil)
(我有使用 /bin/bash 调用 ansi-term 的 bash 函数。
作者的回答并没有改变任何东西。
(defun foo ()
(interactive)
(setq ansi-color-names-vector
["black" "tomato" "PaleGreen2" "gold1"
"DeepSkyBlue1" "MediumOrchid1" "cyan" "white"])
(setq ansi-color-map (ansi-color-make-color-map)))
(add-hook 'term-exec-hook 'foo)
这不会改变任何东西:
(setf (aref ansi-color-map 34) '(foreground-color . "red"))
我想要什么所以将目录颜色蓝色更改为更浅的颜色(该解决方案也可以显示如何更改所有颜色,以便其他人找到这个问题)
这是它在 xterm 中的样子:
以及它在 Emacs 中的外观(很难阅读目录)
【问题讨论】: