0

I'm currently trying to conditionally change the face attributes of two faces related to dap-mode while running Emacs in server-mode inside a terminal (using -nw):

    (defun my-dap-terminal-hook ()
      (unless (display-graphic-p)
        (set-face-attribute 'dap-ui-pending-breakpoint-face nil
                            :slant 'italic
                            :background "#ffe4e1")
        (set-face-attribute 'dap-ui-verified-breakpoint-face nil
                            :weight 'bold
                            :slant 'italic
                            :background "#ffebcd")))
    (add-hook 'dap-mode-hook #'my-dap-terminal-hook)

Adding this to my init.el file 'works', but I need to restart the frame for the face changes to take effect, which is quite annoying. Is there some way to trigger some kind of redraw or update of all faces?

2 Answers 2

0

And 5 minutes after writing up the question I found the answer to my specific problem: I used the wrong hook. The faces are not properly created until dap-ui.el has been loaded, so they are not set properly. The correct way would be to add the function to the dap-ui-mode-hook instead:

(add-hook 'dap-ui-mode-hook #'my-dap-terminal-hook)
0

You can customize faces differently for different terminals in the customize-face interface.

For the "State" button, select "For all kinds of displays" and you'll then get a "Display" button for which you can select "Specific display", and then choose the attributes for that display.

You can then INSert as many new entries as needed, each with their own "Specific display" settings.

Note that you need to enable each option by ticking the preceding checkbox -- which means ticking the checkbox before the "Type" label in order to make the "Type" checkboxes accessible. "TTY" is a traditional terminal, and "X" is any of the X Window toolkits.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.