Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
veripoolbot opened this issue Mar 5, 2018 · 3 comments
Open

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

veripoolbot opened this issue Mar 5, 2018 · 3 comments

Comments

@veripoolbot
Copy link
Collaborator

@veripoolbot veripoolbot commented Mar 5, 2018


Author Name: Rupert Swarbrick (@rswarbrick)
Original Redmine Issue: 1283 from https://www.veripool.org


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

@veripoolbot
Copy link
Collaborator Author

@veripoolbot veripoolbot commented Mar 7, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-03-07T01:01:33Z


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.

@veripoolbot
Copy link
Collaborator Author

@veripoolbot veripoolbot commented Mar 8, 2018


Original Redmine Comment
Author Name: Rupert Swarbrick (@rswarbrick)
Original Date: 2018-03-08T07:32:04Z


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

@veripoolbot
Copy link
Collaborator Author

@veripoolbot veripoolbot commented Mar 8, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-03-08T14:25:15Z


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.