2

I've just installed realgud so that I can use trepan2 for debugging python in emacs. I immediately ran into a serious problem: some of the colors in the comint buffer are so light as to be almost invisible: light blue or even yellow on white. How do I change them?

I tried turning off fontlock-mode in the buffer, but the colors remain. I have also tried M-x customize-faces, but it is not obvious to me which of the hundreds of faces listed is being used by realgud. (There are six whose names actually begin with "Realgud", but none of them seems to be relevant.) I scrolled through the entire list, and I couldn't find any yellow or light blue ones. I also tried changing the theme to something with a darker background: that makes yellow visible, but then the dark colors vanish.

EDIT: Following lawlist's suggestion, here are the results of C-u C-x =. If I understand this right, it means yellow is hard-coded.

             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]

To be honest, I've lost interest in realgud anyway. Although the idea of an enhanced pdb sounds good, trepan2 and realgud seem to have multiple painful flaws that make them almost unusable.

Thanks.

Leon Avery
  • 856
  • 2
  • 8
  • 20
  • 1
    Place your cursor on whatever point has the color of particular interest and type `C-u C-x =` and that will tell you what face(s) is/are present at that location. Then you can `M-x customize-face`. – lawlist Dec 16 '14 at 16:38
  • 1
    Perhaps adjusting the setting for `ansi-color-names-vector` would be helpful? http://stackoverflow.com/a/13769063/2112489 To see the current setting you can type: `M-x describe-variable RET ansi-color-names-vector RET` – lawlist Dec 16 '14 at 18:34
  • Perhaps, but changing the meaning of ANSI colors, which may be used elsewhere in `emacs`, seems like as drastic step. If `realgud` were working well I might consider it, but there are other problems. – Leon Avery Dec 16 '14 at 18:39
  • I could be wrong, but I don't believe that `realgud` is responsible for the color settings -- a quick grep revealed that `realgud` uses `ansi-color-filter-apply` which probably would leave a bread crumb trail leading back to `ansi-color-names-vector`. However, I only spent a couple of minutes looking at the issue. The only colors that I saw in my brief glimpse at `realgud` were the faces: `debugger-running`; `debugger-not-running`; `realgud-overlay-arrow1`; `realgud-overlay-arrow2`; `realgud-overlay-arrow3`; `realgud-line-number`; `realgud-file-name`; `realgud-backtrace-number`. – lawlist Dec 16 '14 at 18:57
  • @LeonAvery Sorry you've lost interest. When you find a problem in any software you are running, consider opening an issue in the project. For this project, the issue trackers are https://github.com/rocky/emacs-dbgr/issues and https://github.com/rocky/python2-trepan/issues . Thanks. – rocky Apr 26 '15 at 13:45

1 Answers1

1

Color mappings come from ansi-term.

Here is what I have in my .emacs, but note I use a light (white) background. Note that although the main setting is ansi-term-color-vector, the color definitions for that have to come beforehand.

(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])
rocky
  • 7,226
  • 3
  • 33
  • 74
  • I have added the above to the wiki for that project. See https://github.com/rocky/emacs-dbgr/wiki/Customizing-Colors . – rocky Apr 26 '15 at 13:40