Mercurial > hgrepos > hgweb.cgi > yatex
comparison yatexenv.el @ 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 | ceca2d094d6f |
children | 5921f28ef77c |
comparison
equal
deleted
inserted
replaced
256:b1e70dc23208 | 257:2b85ef062ccf |
---|---|
1 ;;; -*- Emacs-Lisp -*- | 1 ;;; -*- Emacs-Lisp -*- |
2 ;;; YaTeX environment-specific functions. | 2 ;;; YaTeX environment-specific functions. |
3 ;;; yatexenv.el | 3 ;;; yatexenv.el |
4 ;;; (c) 1994-2012 by HIROSE Yuuji.[yuuji@yatex.org] | 4 ;;; (c) 1994-2012 by HIROSE Yuuji.[yuuji@yatex.org] |
5 ;;; Last modified Sat Feb 11 12:15:22 2012 on firestorm | 5 ;;; Last modified Sun Feb 12 11:15:33 2012 on firestorm |
6 ;;; $Id$ | 6 ;;; $Id$ |
7 | 7 |
8 ;;; | 8 ;;; |
9 ;; Functions for tabular environment | 9 ;; Functions for tabular environment |
10 ;;; | 10 ;;; |
257 ;;; | 257 ;;; |
258 ;; For document environment | 258 ;; For document environment |
259 ;;; | 259 ;;; |
260 (defun YaTeX-intelligent-newline-document () | 260 (defun YaTeX-intelligent-newline-document () |
261 "New paragraph by null line or `\\par'." | 261 "New paragraph by null line or `\\par'." |
262 (if (save-excursion (re-search-backward "\\\\par\\>" nil t)) | 262 (if (< (count-lines |
263 (progn | 263 (or (get 'YaTeX-inner-environment 'point) |
264 (YaTeX-indent-line) | 264 (max 1 (- (point) 17))) ;"\begin{document}\n" == 17 |
265 (insert "\\par"))) | 265 (point)) |
266 (newline) | 266 2) |
267 nil | |
268 (if (save-excursion (re-search-backward "\\\\par\\>" nil t)) | |
269 (progn | |
270 (YaTeX-indent-line) | |
271 (insert "\\par"))) | |
272 (newline)) | |
267 (YaTeX-indent-line)) | 273 (YaTeX-indent-line)) |
268 | 274 |
269 ;;; | 275 ;;; |
270 ;; Intelligent newline | 276 ;; Intelligent newline |
271 ;;; | 277 ;;; |