开发者

aquamacs require-final-newline

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜