Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

Issue #1283

Feature request: Allow user to break movement on '_' symbols

Added by Rupert Swarbrick almost 2 years ago. Updated almost 2 years ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
-
% Done:

0%

Estimated time:
0.50 h

Description

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).

Many thanks,

Rupert

History

#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.

#2 Updated by Rupert Swarbrick almost 2 years ago

Ok, I can do that. Do I need FSF papers on file? (I have from my past employer, but have actually moved jobs since then).

#3 Updated by Wilson Snyder almost 2 years ago

As long as the edits are small and I commit them you are fine. If you start making major contributions (which would be great!) you should update the GNU forms. Thanks.

Also available in: Atom