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?

1 Answer 1

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)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.