yatex

changeset 257:2b85ef062ccf dev

Do not put new paragraph at the beginning of document environment.
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 12 Feb 2012 11:17:04 +0900
parents b1e70dc23208
children 3995f7fc6678
files yatexenv.el
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/yatexenv.el	Sun Feb 12 11:01:27 2012 +0900
     1.2 +++ b/yatexenv.el	Sun Feb 12 11:17:04 2012 +0900
     1.3 @@ -2,7 +2,7 @@
     1.4  ;;; YaTeX environment-specific functions.
     1.5  ;;; yatexenv.el
     1.6  ;;; (c) 1994-2012 by HIROSE Yuuji.[yuuji@yatex.org]
     1.7 -;;; Last modified Sat Feb 11 12:15:22 2012 on firestorm
     1.8 +;;; Last modified Sun Feb 12 11:15:33 2012 on firestorm
     1.9  ;;; $Id$
    1.10  
    1.11  ;;;
    1.12 @@ -259,11 +259,17 @@
    1.13  ;;;
    1.14  (defun YaTeX-intelligent-newline-document ()
    1.15    "New paragraph by null line or `\\par'."
    1.16 -  (if (save-excursion (re-search-backward "\\\\par\\>" nil t))
    1.17 -      (progn
    1.18 -	(YaTeX-indent-line)
    1.19 -	(insert "\\par")))
    1.20 -  (newline)
    1.21 +  (if (< (count-lines
    1.22 +	  (or (get 'YaTeX-inner-environment 'point)
    1.23 +	      (max 1 (- (point) 17)))	;"\begin{document}\n" == 17
    1.24 +	  (point))
    1.25 +	 2)
    1.26 +      nil
    1.27 +    (if (save-excursion (re-search-backward "\\\\par\\>" nil t))
    1.28 +	(progn
    1.29 +	  (YaTeX-indent-line)
    1.30 +	  (insert "\\par")))
    1.31 +    (newline))
    1.32    (YaTeX-indent-line))
    1.33  
    1.34  ;;;