291 |
:group 'editing-basics) |
:group 'editing-basics) |
292 |
|
|
293 |
(defcustom mode-require-final-newline t |
(defcustom mode-require-final-newline t |
294 |
"*Whether to add a newline at the end of the file, in certain major modes. |
"*Whether to add a newline at end of file, in certain major modes. |
295 |
Those modes set `require-final-newline' to this value when you enable them. |
Those modes set `require-final-newline' to this value when you enable them. |
296 |
They do so because they are used for files that are supposed |
They do so because they are used for files that are supposed |
297 |
to end in newlines, and the question is how to arrange that. |
to end in newlines, and the question is how to arrange that. |
299 |
A value of t means do this only when the file is about to be saved. |
A value of t means do this only when the file is about to be saved. |
300 |
A value of `visit' means do this right after the file is visited. |
A value of `visit' means do this right after the file is visited. |
301 |
A value of `visit-save' means do it at both of those times. |
A value of `visit-save' means do it at both of those times. |
302 |
Any other non-nil value means ask user whether to add a newline, when saving." |
Any other non-nil value means ask user whether to add a newline, when saving. |
303 |
|
nil means don't add newlines. |
304 |
|
|
305 |
|
You will have to be careful if you set this to nil: you will have |
306 |
|
to remember to manually add a final newline whenever you finish a |
307 |
|
file that really needs one." |
308 |
:type '(choice (const :tag "When visiting" visit) |
:type '(choice (const :tag "When visiting" visit) |
309 |
(const :tag "When saving" t) |
(const :tag "When saving" t) |
310 |
(const :tag "When visiting or saving" visit-save) |
(const :tag "When visiting or saving" visit-save) |
311 |
|
(const :tag "Never" nil) |
312 |
(other :tag "Ask" ask)) |
(other :tag "Ask" ask)) |
313 |
:group 'editing-basics |
:group 'editing-basics |
314 |
:version "22.1") |
:version "22.1") |