【问题标题】:How to customize colors in realgud?如何在 realgud 中自定义颜色?
【发布时间】:2015-02-14 21:30:14
【问题描述】:

我刚刚安装了realgud,这样我就可以使用trepan2 在emacs 中调试python。我立即遇到了一个严重的问题:comint 缓冲区中的一些颜色太浅了,几乎看不见:浅蓝色甚至是白色上的黄色。我该如何改变它们?

我尝试关闭缓冲区中的fontlock-mode,但颜色仍然存在。我也试过 M-x customize-faces,但我不清楚列出的数百张面孔中的哪一张被 realgud 使用。 (实际上有六个名字以“Realgud”开头,但似乎没有一个是相关的。)我翻阅了整个列表,但找不到任何黄色或浅蓝色的。我还尝试将主题更改为具有较暗背景的主题:这使黄色可见,但随后深色消失了。

编辑:按照法律列表的建议,这里是C-u C-x = 的结果。如果我理解正确,这意味着黄色是硬编码的。

             position: 8445 of 9070 (93%), column: 39
            character: 0 (displayed as 0) (codepoint 48, #o60, #x30)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x30
               syntax: w    which means: word
             category: .:Base, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
          buffer code: #x30
            file code: #x30 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    x:-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1 (#x30)

Character code properties: customize what to show
  name: DIGIT ZERO
  general-category: Nd (Number, Decimal Digit)
  decomposition: (48) ('0')

There is an overlay here:
 From 8437 to 8450
  face                 (foreground-color . "yellow")
  modification-hooks   (ansi-color-freeze-overlay)


There are text properties here:
  field                output
  fontified            t
  front-sticky         (field inhibit-line-move-field-capture)
  inhibit-line-move-field-capture t
  rear-nonsticky       t

[back]

说实话,我已经对realgud 失去了兴趣。尽管增强pdb 的想法听起来不错,但trepan2realgud 似乎有多个痛苦的缺陷,使它们几乎无法使用。

谢谢。

【问题讨论】:

  • 将光标放在具有特别感兴趣的颜色的任何点上并输入C-u C-x =,这将告诉您该位置存在/存在哪些面孔。然后你可以M-x customize-face
  • 也许调整ansi-color-names-vector 的设置会有所帮助? stackoverflow.com/a/13769063/2112489 要查看当前设置,您可以键入:M-x describe-variable RET ansi-color-names-vector RET
  • 也许,但是改变 ANSI 颜色的含义,这可能在 emacs 的其他地方使用,似乎是一个激进的步骤。如果realgud 运行良好,我可能会考虑,但还有其他问题。
  • 我可能是错的,但我不相信 realgud 负责颜色设置 - 快速 grep 显示 realgud 使用 ansi-color-filter-apply 可能会留下面包屑通往ansi-color-names-vector 的小径。但是,我只花了几分钟的时间来研究这个问题。我在realgud 的短暂一瞥中看到的唯一颜色是面孔:debugger-runningdebugger-not-running; realgud-overlay-arrow1; realgud-overlay-arrow2; realgud-overlay-arrow3; realgud-line-number; realgud-file-name; realgud-backtrace-number.
  • @LeonAvery 抱歉,您失去了兴趣。当您在运行的任何软件中发现问题时,请考虑在项目中打开问题。对于这个项目,问题跟踪器是 github.com/rocky/emacs-dbgr/issuesgithub.com/rocky/python2-trepan/issues 。谢谢。

标签: python emacs emacs-faces


【解决方案1】:

颜色映射来自ansi-term

这是我的 .emacs 中的内容,但请注意我使用浅色(白色)背景。请注意,虽然主要设置是 ansi-term-color-vector,但必须事先进行颜色定义。

(defface term-color-darkgreen
  '((t :foreground "DarkGreen" :background "DarkGreen"))
  "Face used to render dark green color code."
  :group 'term)


(defface term-color-cadetblue
  '((t :foreground "CadetBlue" :background "CadetBAlue"))
  "Face used to render dark cadet blue color code."
  :group 'term)

(defface term-color-purple
  '((t :foreground "Purple" :background "Purple"))
  "Face used to render dark Purple color code."
  :group 'term)

(defface term-color-darkgoldenrod
  '((t :foreground "Darkgoldenrod" :background "Darkgoldenrod"))
  "Face used to render dark Darkgoldenrod color code."
  :group 'term)

(defface term-color-ivory4
  '((t :foreground "Ivory4" :background "Ivory4"))
  "Face used to render dark Ivory4 color code."
  :group 'term)


(setq ansi-term-color-vector
      [term
       term-color-black
       term-color-red
       term-color-darkgreen
       term-color-cadetblue
       term-color-blue
       term-color-purple
       term-color-darkgoldenrod
       term-color-ivory4])

【讨论】:

猜你喜欢
  • 2021-05-20
  • 2017-08-29
  • 2015-07-14
  • 2014-02-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多