【问题标题】:How to disable auto new line in verilog mode in emacs如何在emacs的verilog模式下禁用自动换行
【发布时间】:2015-01-21 19:27:00
【问题描述】:

每次我想发布我的问题时,它总是显示问题“您的帖子似乎包含格式不正确的代码”,为什么会发生这种情况。我只能将我的问题作为代码发布。很抱歉给您带来不便。

I am fairly new to emacs.
Whenever I type a semicolon( ; ) in my verilog code, it puts a
"new line" character automatically. How to disable this
automatic entry of new-line character?

I searched this question on google. Somebody answered 

"Hi Ravi,
        I am not sure which "mode file" you are using. If you are using the
one from Mac (Verisity) then have a llok at the file "verilog-mode.el"
You will see
;       verilog-auto-newline             t
;       verilog-auto-indent-on-newline   t
(defcustom verilog-auto-newline t
"t" means true, change it to "nil" and restart Emacs.
Another way to do through GUI is
On the menu bar you normally see a "special" pull down menu (if Verilog mode
is loaded) named "Verilog".
1.> Click on the Pull Down Menu Verilog
2.> Click on "Custmoize Verilog Mode..." (should be last but one option in
this menu)
3.> Then "open" the INDENT group
4.> Look for an option named "auto new line" and set this to nil.
5.> Save options..
Hope this helps.
Good Luck,
Srini

"

I modified my verilog-mode.el in ~/elisp, but it did not work.
Auto new line still happens. 
And I can't find a verilog mode menu bar on emacs menu bar. 
Can somebody tell me how to show the verilog mode menu bar on my emacs? Many thanks.

【问题讨论】:

    标签: emacs verilog mode


    【解决方案1】:

    尝试添加

    (setq verilog-auto-newline nil)
    

    在您的~/.emacs 文件中?

    【讨论】:

    • 我发现我应该打开一个 .v 文件然后我可以看到 verilog 模式菜单栏,我在该菜单栏中禁用了自动换行,无论如何,谢谢。
    【解决方案2】:

    我的 .emacs 有这个:

    (defun my-verilog-hook ()
       ;; the (setq verilog-auto-indent-on-newline nil) below wasn't
       ;; stopping the auto indentation, but this does:
       (define-key verilog-mode-map "\r" nil))
    (add-hook 'verilog-mode-hook 'my-verilog-hook)
    

    这似乎已经为我解决了。

    【讨论】:

    • 我发现我应该打开一个 .v 文件然后我可以看到 verilog 模式菜单栏,我在该菜单栏中禁用了自动换行,无论如何,谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多