comparison man/xemacs/files.texi @ 5766:182d01410b8d

Add mode-require-final-newline from GNU. Thanks GNU. lisp/ChangeLog: 2013-09-15 Mats Lidell <matsl@cxemacs.org> * files.el (mode-require-final-newline): Variable synced from GNU. Thank you GNU. Allows modes to control final newlines. (require-final-newline): Add action on visiting and visiting or saving in sync with GNU. * text-mode.el (text-mode): Use mode-require-final-newline. man/ChangeLog: 2013-09-15 Mats Lidell <matsl@xemacs.org> * xemacs/files.texi (Saving): New variable mode-require-final-newline. Update info for require-final-newline. tests/ChangeLog: 2013-09-15 Mats Lidell <matsl@xemacs.org> * automated/files-tests.el: New file. Test new states in require-final-newline and new variable mode-require-final-newline.
author Mats Lidell <mats.lidell@cag.se>
date Mon, 16 Sep 2013 00:00:12 +0200
parents 1d4da9ee6381
children
comparison
equal deleted inserted replaced
5765:e88d026f3917 5766:182d01410b8d
398 notifies you of this fact, because it probably indicates a problem caused 398 notifies you of this fact, because it probably indicates a problem caused
399 by simultaneous editing and requires your immediate attention. 399 by simultaneous editing and requires your immediate attention.
400 @xref{Interlocking,, Simultaneous Editing}. 400 @xref{Interlocking,, Simultaneous Editing}.
401 401
402 @vindex require-final-newline 402 @vindex require-final-newline
403 If the variable @code{require-final-newline} is non-@code{nil}, Emacs 403 If the value of the variable @code{require-final-newline} is
404 puts a newline at the end of any file that doesn't already end in one, 404 @code{t}, saving or writing a file silently puts a newline at the end
405 every time a file is saved or written. 405 if there isn't already one there. If the value is @code{visit}, Emacs
406 adds a newline at the end of any file that doesn't have one, just
407 after it visits the file. (This marks the buffer as modified, and you
408 can undo it.) If the value is @code{visit-save}, Emacs adds such
409 newlines both on visiting and on saving. If the value is @code{nil},
410 Emacs leaves the end of the file unchanged; any other non-@code{nil}
411 value means to asks you whether to add a newline. The default is
412 @code{nil}.
413
414 @vindex mode-require-final-newline
415 Some major modes are designed for specific kinds of files that are
416 always supposed to end in newlines. Such major modes set the variable
417 @code{require-final-newline} to the value of
418 @code{mode-require-final-newline}, which defaults to @code{t}. By
419 setting the latter variable, you can control how these modes handle
420 final newlines.
406 421
407 @vindex write-file-hooks 422 @vindex write-file-hooks
408 @vindex after-save-hook 423 @vindex after-save-hook
409 Use the hook variable @code{write-file-hooks} to implement other ways 424 Use the hook variable @code{write-file-hooks} to implement other ways
410 to write files, and specify things to be done before files are written. The 425 to write files, and specify things to be done before files are written. The