开发者

aquamacs require-final-newline

开发者 https://www.devze.com 2023-03-27 01:40 出处:网络
I\'m using aquatics开发者_StackOverflow中文版 for rails development and thanks to some inline-block issues I have a situation where I need to render partials without a newline at the end.

I'm using aquatics开发者_StackOverflow中文版 for rails development and thanks to some inline-block issues I have a situation where I need to render partials without a newline at the end.

The problem is when I save aquamacs always adds a newline to the end of the file.

I have tried adding (setq require-final-newline) in my .emacs file but it doesn't solve the issue.


Try setting the value in the ruby-mode-hook in your emacs init file. For example, for Ruby mode:

(add-hook 'ruby-mode-hook '(lambda ()
                             (setq require-final-newline nil)
                             (setq mode-require-final-newline nil)))

EDIT: Ruby mode explicitly sets on "require-final-newline" as a file local variable (which is why your .emacs setting isn't working) so you have to set both variables in the hook. I don't program in Ruby so I'm not sure why the author of ruby-mode sets "require-final-newline" on so there may be some negative side-effects to turning it off. However, the above code should do what you asked for.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号