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

Modify verilog-pretty-declarations line up the comments #898

Closed
veripoolbot opened this issue Mar 17, 2015 · 4 comments · Fixed by #1775
Closed

Modify verilog-pretty-declarations line up the comments #898

veripoolbot opened this issue Mar 17, 2015 · 4 comments · Fixed by #1775

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Kaushal Modi
Original Redmine Issue: 898 from https://www.veripool.org


This edit is very useful in lining up the comments in module port declaration list.

Relevant edit inside the verilog-pretty-declarations function:

,-------- #6774 -- verilog-mode.el ---
|                    (if (verilog-re-search-forward "[[#`]" p 'move)
|                        (progn
|                          (forward-char -1)
|                          (just-one-space)
|                          (goto-char (marker-position m1))
|                          (just-one-space)
|                          (indent-to ind))
|                      (progn
|                        (just-one-space)
|                        (indent-to ind)))
|                    (comment-indent) ; <-- added line
|                    ))
`-------- #6785 -- 2015/03/17 

Here is a dummy to test the comment indentation in the port list.
The comments will get indented to the column defined in comment-column variable.

module my_module 
 ( input a, // sig a
    input bc, // sig bc
    input d // sig d
 );
//
endmodule

Tested fine on latest build of GNU emacs from git.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-03-17T23:26:52Z


Let us experiment with this a bit to see how it feels, and/or if it should be optional-on or optional-off.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Kaushal Modi
Original Date: 2015-06-23T16:14:26Z


I didn't like this mod to be on by default; because then it is appending empty @\@ comments to the lines that do not have any comment to begin with.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-11-19T13:20:00Z


Still present, perhaps someone would like to cotribute a patch?

@paulbvtn
Copy link

paulbvtn commented May 6, 2020

I see this is still open, and I had a similar desire.
My hack for this was to add this line to the end of verilog-pretty-declarations:

(align-regexp startpos endpos ",\\(\\s-*\\)//")
Not a complete solution as it only works for the comma separated list of my port declarations, and for line comments. But works for me.

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

Successfully merging a pull request may close this issue.

2 participants