veripool / verilog-mode

Verilog-Mode for Emacs with Indentation, Hightlighting and AUTOs. Master repository for pushing to GNU, verilog.com and veripool.org.
http://veripool.org/verilog-mode
GNU General Public License v3.0
253 stars 90 forks source link

verilog-mode specific faces? #1323

Closed veripoolbot closed 6 years ago

veripoolbot commented 6 years ago

Author Name: David Rogoff Original Redmine Issue: 1323 from https://www.veripool.org


Hi.

I was wondering if it would be difficult to add verilog-mode specific faces so that I could have different color/theme for those buffers. I see there's a few of these for verilog only things like p1800 keywords but most, like comment face, always use the standard comment face. I looked at verilog-mode.el but the face stuff is a bit beyond my understanding. If you could give me a simple example of one, e.g. verilog-mode-comment-face, I could extend it to the other faces.

I could just use this locally or submit it for the main trunk if you like. I'd think they would all default to just inheriting the common version of the face so that they work like they do now if not customized.

Thanks,

David

veripoolbot commented 6 years ago

Original Redmine Comment Author Name: Wilson Snyder (@wsnyder) Original Date: 2018-07-12T11:10:58Z


You mean you want e.g. a different comment face inside Verilog versus comments in other non-Verilog buffers? This isn't verilog-mode specific, it can be done without any verilog-mode changes. See https://emacs.stackexchange.com/questions/7281/how-to-modify-face-for-a-specific-buffer

To determine how to get the right face settings, in a verilog buffer, use M-x customize then Faces then whatever. Change it to what you want, then at top "apply and save". This will make a global change. Now go to your ~/.emacs or rc/.emacs and find something like this

(custom-set-faces '(comment ((t (:foreground "magenta")))))

Change it to something like this

(add-hook 'verilog-mode-hook
       '(lambda ()
          (make-variable-buffer-local `face-remapping-alist)
          (face-remap-add-relative 'comment '(:foreground "magenta"))