[英]How to delete trailing whitespace in Verilog Mode Emacs
I'm trying to delete trailing whitespaces in Verilog Mode. 我正在尝试在Verilog模式下删除尾随空格。 I have customized Verilog mode with the menu : "Verilog --> Customize Verilog Mode...".
我已经使用菜单“ Verilog-> Customize Verilog Mode ...”自定义了Verilog模式。
Trailing whitespaces are not removing when editing or saving a Verilog file. 编辑或保存Verilog文件时,尾随空格不会删除。 I've tried somme commands 'add hook' but still no success.
我已经尝试过somme命令“添加挂钩”,但仍然没有成功。 What am I missing ?
我想念什么?
That's my .emacs (Emacs 24.3.1) : 那是我的.emacs(Emacs 24.3.1):
`(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(cua-mode t nil (cua-base))
'(global-whitespace-mode t)
'(indent-tabs-mode nil)
'(show-paren-mode t)
'(verilog-align-ifelse t)
'(verilog-auto-delete-trailing-whitespace t)
'(verilog-auto-endcomments nil)
'(verilog-auto-hook (quote (delete-trailing-whitespace)))
'(verilog-auto-indent-on-newline t)
'(verilog-auto-lineup (quote declarations))
'(verilog-auto-newline nil)
'(verilog-indent-level 2)
'(verilog-indent-level-behavioral 2)
'(verilog-indent-level-declaration 2)
'(verilog-indent-level-directive 2)
'(verilog-indent-level-module 2)
'(verilog-indent-lists nil)
'(verilog-tab-always-indent t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)`
In general, not just for Verilog, I use the below clean up before save: 通常,不仅限于Verilog,我还会在保存之前使用以下清理方法:
;; Before save
;; (add-hook 'before-save-hook 'delete-trailing-whitespace)
(add-hook 'before-save-hook 'whitespace-cleanup)
You can try enabling 'delete-trailing-whitespace
only, if the 'whitespace-cleanup
does too much. 如果
'whitespace-cleanup
做得太多,您可以尝试仅启用'delete-trailing-whitespace
'whitespace-cleanup
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.