Mercurial > hgrepos > hgweb.cgi > yatex
changeset 234:b75390dd4260 dev
C-j can skip further parameter input for table/figure environment.
author | yuuji@gentei.org |
---|---|
date | Sat, 28 Jan 2012 11:16:11 +0900 |
parents | 699f3c6c8b2c |
children | f70aae80489e |
files | yatexadd.el yatexenv.el yatexlib.el |
diffstat | 3 files changed, 27 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/yatexadd.el Sat Jan 28 10:22:08 2012 +0900 +++ b/yatexadd.el Sat Jan 28 11:16:11 2012 +0900 @@ -2,7 +2,7 @@ ;;; YaTeX add-in functions. ;;; yatexadd.el rev.20 ;;; (c)1991-2012 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sat Jan 28 09:55:19 2012 on firestorm +;;; Last modified Sat Jan 28 11:03:05 2012 on firestorm ;;; $Id$ ;;; @@ -109,12 +109,15 @@ (let*((caption "") (label "") (opts "") (top (if type firstp YaTeX:figure-caption-first)) (tl (or type "Figure")) - (heremsg (format "%% %s here" tl))) - (setq label (read-string (concat tl " Label: "))) + (heremsg (format "%% %s here" tl)) + (pos (YaTeX:read-position "htbp"))) + (setq label (or (YaTeX-skip-next-reader-p) + (read-string (concat tl " Label: ")))) (if (string= "" label) (setq YaTeX-section-name "label") (setq opts (format "\n\\label{%s}" label))) - (setq caption (read-string (concat tl " Caption: "))) + (setq caption (or (YaTeX-skip-next-reader-p) + (read-string (concat tl " Caption: ")))) (if (string= "" caption) (setq YaTeX-section-name "caption") (setq caption (format "\\caption{%s}" caption) @@ -123,7 +126,7 @@ (if top caption heremsg) (if top heremsg caption))) (format "\\caption{%s}" caption)) - opts)) + (concat pos opts))) (fset 'YaTeX:figure* 'YaTeX:figure)
--- a/yatexenv.el Sat Jan 28 10:22:08 2012 +0900 +++ b/yatexenv.el Sat Jan 28 11:16:11 2012 +0900 @@ -2,7 +2,7 @@ ;;; YaTeX environment-specific functions. ;;; yatexenv.el ;;; (c) 1994-2006 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sat Jan 28 10:21:07 2012 on firestorm +;;; Last modified Sat Jan 28 10:26:54 2012 on firestorm ;;; $Id$ ;;; @@ -252,6 +252,10 @@ (YaTeX-make-section nil nil nil "bibitem") (YaTeX-indent-line)) + +;;; +;; Functions for math mode environments +;;; (defun YaTeX-intelligent-newline-equation () "Warn equation can't have multiple lines." (undo) @@ -259,6 +263,13 @@ (fset 'YaTeX-intelligent-newline-equation* 'YaTeX-intelligent-newline-equation) ;;; +;; For document environment +;;; +(defun YaTeX-intelligent-newline-document () + "New paragraph." + (newline)) ;Do you prefer `\par'? + +;;; ;; Intelligent newline ;;; ;;;###autoload
--- a/yatexlib.el Sat Jan 28 10:22:08 2012 +0900 +++ b/yatexlib.el Sat Jan 28 11:16:11 2012 +0900 @@ -2,7 +2,7 @@ ;;; YaTeX and yahtml common libraries, general functions and definitions ;;; yatexlib.el ;;; (c)1994-2012 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Mon Jan 23 00:10:51 2012 on firestorm +;;; Last modified Sat Jan 28 11:02:48 2012 on firestorm ;;; $Id$ ;; General variables @@ -752,6 +752,12 @@ (read-with-history-in hsym prompt init)) (t (read-string prompt init)))) +(defvar YaTeX-skip-next-reader-char ?\C-j) +(defun YaTeX-skip-next-reader-p () + "Check if the next string-reader should be skip." + (if (equal last-input-char YaTeX-skip-next-reader-char) + "" nil)) + ;;;###autoload (fset 'YaTeX-rassoc (if (and nil (fboundp 'rassoc) (subrp (symbol-function 'rassoc)))