Closed veripoolbot closed 6 years ago
Original Redmine Comment Author Name: Robert Swan Original Date: 2016-11-09T15:28:20Z
Well, formatting is messed up but probably you get the idea.
(unless (assq 'verilog-mode hs-special-modes-alist)
needs to be
(unless (assq 'verilog-mode-mode hs-special-modes-alist)
Original Redmine Comment Author Name: Kaushal Modi Original Date: 2016-11-09T16:37:49Z
You can use @with-eval-after-load@ (emacs 24.3+) and @add-to-list@. That way, you do not need to worry about @hs-special-modes-alist@ being available.
I have this in my config and it works fine:
(with-eval-after-load 'hideshow
(add-to-list 'hs-special-modes-alist
`(verilog-mode ,(concat "\\b\\(begin"
"\\|task"
"\\|function"
"\\|class"
"\\|module"
"\\|program"
"\\|interface"
"\\|module"
"\\|case"
"\\|fork\\)\\b")
,(concat "\\b\\(end"
"\\|endtask"
"\\|endfunction"
"\\|endclass"
"\\|endmodule"
"\\|endprogram"
"\\|endinterface"
"\\|endmodule"
"\\|endcase"
"\\|join\\|join_none\\|join_any\\)\\b")
nil verilog-forward-sexp-function)))
Original Redmine Comment Author Name: Kaushal Modi Original Date: 2016-11-09T16:39:31Z
Also, why does @verilog-mode@ need to be @verilog-mode-mode@?
Original Redmine Comment Author Name: Robert Swan Original Date: 2016-11-09T17:10:21Z
Verilog-mode.el has a bug, and you're correct, @verilog-mode-mode@ should be changed to @verilog-mode@, not the other way round.
;; hideshow support
(when (boundp 'hs-special-modes-alist)
(unless (assq 'verilog-mode hs-special-modes-alist)
(setq hs-special-modes-alist
(cons '(verilog-mode-mode "\\<begin\\>" "\\<end\\>" nil
verilog-forward-sexp-function)
hs-special-modes-alist))))
Thanks for the hs-special-modes-alist, works great.
Robert
Original Redmine Comment Author Name: Wilson Snyder (@wsnyder) Original Date: 2016-11-15T00:03:54Z
So do you think verilog-mode.el should add something similar to what you'all have as a default, or should it leave it to the user's config files? If it should add something, exactly what?
Original Redmine Comment Author Name: Wilson Snyder (@wsnyder) Original Date: 2017-11-19T13:52:28Z
Looks like this is no longer a problem with verilog-mode.el itself, if it actually is please reopen or file a new bug, thanks.
Author Name: Robert Swan Original Redmine Issue: 1106 from https://www.veripool.org
(when (boundp 'hs-special-modes-alist) (unless (assq 'verilog-mode hs-special-modes-alist) (setq hs-special-modes-alist (cons '(verilog-mode-mode "\<begin\>" "\<end\>" nil verilog-forward-sexp-function) hs-special-modes-alist))))
should be
(when (boundp 'hs-special-modes-alist) (unless (assq 'verilog-mode_mode hs-special-modes-alist) (setq hs-special-modes-alist (cons '(verilog-mode-mode "\<begin\>" "\<end\>" nil verilog-forward-sexp-function) hs-special-modes-alist))))