1

I'm using aquatics 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.

Joel Jackson
  • 1,060
  • 1
  • 10
  • 24

1 Answers1

6

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.

zev
  • 3,480
  • 18
  • 13