I am using org-mode to generate my PDF report. Each time the tex is generated, emacs asks me
Buffer hw1.tex<2> does not end in newline. Add one? (y or n) y
How can I get rid of this message and just add a new line automatically?
I tried setting mode-require-final-newline and require-final-newline to t, But this didn't change anything.
EDIT: I also tried setting mode-require-final-newline and require-final-newline to nil, and even though I can check that their value changed (via C-h v), the problem still persists.
Following the advice of the comments, I added a hook to change the value of those variables:
(add-hook 'org-mode-hook (lambda () (setq require-final-newline nil) (setq mode-require-final-newline nil)))
But again the problem persists.
EDIT:
Also, I think I found the command responsible for this:
(el-get 'sync my-packages)
, so I suspect some package I installed is missing with my configuration.
Here is the list of the packages I installed using el-get:
auctex
auto-complete
autopair
color-theme-solarized
cdlatex-mode
ecb
ein
elpy
expand-region
flycheck
folding
gnuplot-mode
helm
helm-descbinds
jedi
js2-mode
jump-char
key-chord
latex-preview-pane
lua-mode
magit
markdown-mode
matlab-mode
multiple-cursors
;nxhtml
nyan-mode
org-mode
outshine
popup
popwin
pyenv
pydoc-info
scss-mode
yaml-mode
yasnippet
Thanks!
(setq require-final-newline nil)-- should eliminate the prompt. To see what is happening and why, typeM-x find-function RET basic-save-buffer RETSee alsoM-x describe-variable RET require-final-newline RETHow did I find this? I grepped the Emacs source-code for "does not end in newline". If a particular mode sets the value ofrequire-final-newline, then you will likely need to reset the value tonilwith a major-mode hook -- it happens so quickly, you won't notice the resetting. - lawlist(set (make-local-variable 'require-final-newline) mode-require-final-newline)derived byorg-modefromoutline-modefromtext-mode(see answer below) takes a global variablerequire-final-newlineand makes it buffer-local inorg-mode. So when you set it inorg-mode, your only setting it buffer-locally. Although beyond the scope of your question (yet related), you may someday be interested in usingsetq-defaultandsetq-localto control the global and buffer-local values of a particular variable. - lawlist