diff 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
line wrap: on
line diff
--- a/man/xemacs/files.texi	Sun Sep 15 23:50:20 2013 +0900
+++ b/man/xemacs/files.texi	Mon Sep 16 00:00:12 2013 +0200
@@ -400,9 +400,24 @@
 @xref{Interlocking,, Simultaneous Editing}.
 
 @vindex require-final-newline
-  If the variable @code{require-final-newline} is non-@code{nil}, Emacs
-puts a newline at the end of any file that doesn't already end in one,
-every time a file is saved or written.
+  If the value of the variable @code{require-final-newline} is
+@code{t}, saving or writing a file silently puts a newline at the end
+if there isn't already one there.  If the value is @code{visit}, Emacs
+adds a newline at the end of any file that doesn't have one, just
+after it visits the file.  (This marks the buffer as modified, and you
+can undo it.)  If the value is @code{visit-save}, Emacs adds such
+newlines both on visiting and on saving.  If the value is @code{nil},
+Emacs leaves the end of the file unchanged; any other non-@code{nil}
+value means to asks you whether to add a newline.  The default is
+@code{nil}.
+
+@vindex mode-require-final-newline
+  Some major modes are designed for specific kinds of files that are
+always supposed to end in newlines.  Such major modes set the variable
+@code{require-final-newline} to the value of
+@code{mode-require-final-newline}, which defaults to @code{t}.  By
+setting the latter variable, you can control how these modes handle
+final newlines.
 
 @vindex write-file-hooks
 @vindex after-save-hook