Feature request: Allow user to break movement on '_' symbols
The default behaviour of verilog-mode is that '_' is a word constituent (syntax class 'w'). This means that M-f and M-b jump over entire symbols, so hitting M-f when point is at the start of "my_long_symbol_name" jumps to the end.
It would be nice to make this configurable. I thought that I could do this without any hacking on the internals of verilog-mode with this snippet in my .emacs:
(defun rjs/verilog-mode-hook () (set-syntax-table (let ((table (make-syntax-table verilog-mode-syntax-table))) (modify-syntax-entry ?_ "_" table) table))) (add-hook 'verilog-mode-hook #'rjs/verilog-mode-hook)
This kind of works, but now the font locking gets a little weird if you have a variable like "get_a_from_b" because "from" gets highlighted as a keyword.
To fix this, please could you change the regexps for defining verilog-font-lock-keywords to use \\_< and \\_> instead of \\< and \\>? This is lines starting at verilog-mode.el:3246 in the checkout I have. I think this will have no effect if the user has "_" as a word constituent, but it fixes font locking if "_" is given the syntax of a symbol (which is more compatible with how other emacs major modes work).
#1 Updated by Wilson Snyder almost 2 years ago
- Status changed from New to Confirmed
I agree this doesn't work, however it's more pervasive, for example many places the AUTOs assume _ has it's present syntax. Unfortunately I don't presently have time to work on this, if you want to contribute a patch that audits all occurrences, makes all the relevant changes and passes the current test, it would be welcome.
Also available in: Atom