2014-11-24 118 views
0

每當我想發佈我的問題時,它總是顯示問題「您的帖子看起來包含格式不正確的代碼」,爲什麼會發生這種情況。我只能將我的問題作爲代碼發佈。抱歉給你帶來不便。如何在emacs中以verilog模式禁用自動換行

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.

回答

1

嘗試添加

(setq verilog-auto-newline nil) 

~/.emacs文件?

+0

我發現我應該打開一個.v文件,然後我可以看到verilog模式菜單欄,我禁用了該菜單欄中的自動換行,無論如何,謝謝。 – 2014-11-28 20:58:30

+0

這對我有用。 – 2016-03-25 18:14:03

0

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

這似乎已經解決了對我來說。

+0

我發現我應該打開一個.v文件,然後我可以看到verilog模式菜單欄,我禁用了該菜單欄中的自動換行,無論如何,謝謝。 – 2014-11-28 20:58:47