# HG changeset patch # User HIROSE Yuuji # Date 1329013024 -32400 # Node ID 2b85ef062ccf8d861da2656f09ce1a6d9d900555 # Parent b1e70dc23208bc890b6b65e02d69805f733a134e Do not put new paragraph at the beginning of document environment. diff -r b1e70dc23208 -r 2b85ef062ccf yatexenv.el --- a/yatexenv.el Sun Feb 12 11:01:27 2012 +0900 +++ b/yatexenv.el Sun Feb 12 11:17:04 2012 +0900 @@ -2,7 +2,7 @@ ;;; YaTeX environment-specific functions. ;;; yatexenv.el ;;; (c) 1994-2012 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sat Feb 11 12:15:22 2012 on firestorm +;;; Last modified Sun Feb 12 11:15:33 2012 on firestorm ;;; $Id$ ;;; @@ -259,11 +259,17 @@ ;;; (defun YaTeX-intelligent-newline-document () "New paragraph by null line or `\\par'." - (if (save-excursion (re-search-backward "\\\\par\\>" nil t)) - (progn - (YaTeX-indent-line) - (insert "\\par"))) - (newline) + (if (< (count-lines + (or (get 'YaTeX-inner-environment 'point) + (max 1 (- (point) 17))) ;"\begin{document}\n" == 17 + (point)) + 2) + nil + (if (save-excursion (re-search-backward "\\\\par\\>" nil t)) + (progn + (YaTeX-indent-line) + (insert "\\par"))) + (newline)) (YaTeX-indent-line)) ;;;