首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在emacs中禁用verilog模式下的自动换行

如何在emacs中禁用verilog模式下的自动换行
EN

Stack Overflow用户
提问于 2014-11-24 14:10:31
回答 2查看 2.6K关注 0票数 2

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

代码语言:javascript
复制
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.

EN

回答 2

Stack Overflow用户

发布于 2014-11-24 22:08:54

尝试添加

代码语言:javascript
复制
(setq verilog-auto-newline nil)

在你的~/.emacs文件里?

票数 4
EN

Stack Overflow用户

发布于 2014-11-25 01:46:39

我的.emacs是这样的:

代码语言:javascript
复制
(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)

这似乎为我解决了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27098826

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档