diff lisp/text-mode.el @ 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 308d34e9f07d
children
line wrap: on
line diff
--- a/lisp/text-mode.el	Sun Sep 15 23:50:20 2013 +0900
+++ b/lisp/text-mode.el	Mon Sep 16 00:00:12 2013 +0200
@@ -1,6 +1,6 @@
 ;;; text-mode.el --- text mode, and its idiosyncratic commands.
 
-;; Copyright (C) 1985, 1992, 1994, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1992, 1994, 1997, 2013 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: wp, dumped
@@ -83,6 +83,8 @@
   (setq paragraph-start (concat page-delimiter "\\|[ \t]*$"))
   (make-local-variable 'paragraph-separate)
   (setq paragraph-separate paragraph-start)
+  (set (make-local-variable 'require-final-newline)
+       mode-require-final-newline)
   (setq mode-name "Text")
   (setq major-mode 'text-mode)
   (run-hooks 'text-mode-hook))