yatex

changeset 406:acfa7d11b5c3 dev

Sticky on-the-fly preview can be canceled by [prefix] k on vacant position.
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 18 Jan 2015 23:24:41 +0900
parents 6b0d090840c1
children b423cf9b35ee
files yatex.new yatexprc.el
diffstat 2 files changed, 22 insertions(+), 9 deletions(-) [+]
line diff
     1.1 --- a/yatex.new	Sun Jan 18 22:24:41 2015 +0900
     1.2 +++ b/yatex.new	Sun Jan 18 23:24:41 2015 +0900
     1.3 @@ -5,6 +5,8 @@
     1.4  	ポイント位置がずれるEmacsの問題への対策を入れた。
     1.5  	=== yatex ===
     1.6  	数式環境など特定環境内の [prefix] t e で On-the-fly preview 発動。
     1.7 +	環境に対する On-the-fly preview は編集中持続する。
     1.8 +	持続中の On-the-fly preview の無効化は何もない場所で [prefix] k。
     1.9  	YaTeX-help-file のデフォルト位置を site-lisp/yatex/help/ に変更。
    1.10  	領域活性時に呼び出す補完は領域括りになるようにした。
    1.11  	=== yahtml ===
     2.1 --- a/yatexprc.el	Sun Jan 18 22:24:41 2015 +0900
     2.2 +++ b/yatexprc.el	Sun Jan 18 23:24:41 2015 +0900
     2.3 @@ -1,7 +1,7 @@
     2.4  ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*-
     2.5  ;;; 
     2.6  ;;; (c)1993-2015 by HIROSE Yuuji.[yuuji@yatex.org]
     2.7 -;;; Last modified Sun Jan 18 22:22:44 2015 on firestorm
     2.8 +;;; Last modified Sun Jan 18 23:17:57 2015 on firestorm
     2.9  ;;; $Id$
    2.10  
    2.11  ;;; Code:
    2.12 @@ -609,7 +609,7 @@
    2.13  
    2.14  (defun YaTeX-typeset-environment-1 ()
    2.15    (let*((math (YaTeX-in-math-mode-p))
    2.16 -	(dpi (or (YaTeX-get-builtin "PREVIEWDPI") (if math "300" "200")))
    2.17 +	(dpi (or (YaTeX-get-builtin "IMAGEDPI") (if math "300" "200")))
    2.18  	(opoint (point))
    2.19  	usetimer)
    2.20      (cond
    2.21 @@ -693,7 +693,13 @@
    2.22  	      (goto-char (match-beginning 0))))
    2.23  	(YaTeX-typeset-environment))))
    2.24  
    2.25 -(defun YaTeX-typeset-environment-cancel-auto ()
    2.26 +(defun YaTeX-on-the-fly-cancel ()
    2.27 +  "Reset on-the-fly stickiness"
    2.28 +  (interactive)
    2.29 +  (YaTeX-typeset-environment-cancel-auto 'stripoff)
    2.30 +  t)					;t for kill-*
    2.31 +  
    2.32 +(defun YaTeX-typeset-environment-cancel-auto (&optional stripoff)
    2.33    "Cancel typeset-environment timer."
    2.34    (interactive)
    2.35    (if YaTeX-typeset-environment-timer
    2.36 @@ -703,12 +709,17 @@
    2.37  	 (string-to-number "0.1")
    2.38  	 t
    2.39  	 'YaTeX-typeset-environment-activate-onthefly))
    2.40 -  (put-text-property (overlay-start YaTeX-on-the-fly-overlay)
    2.41 -		     (1- (overlay-end YaTeX-on-the-fly-overlay))
    2.42 -		     'onthefly
    2.43 -		     t)
    2.44 -  (delete-overlay YaTeX-on-the-fly-overlay)
    2.45 -  (message "On-the-fly preview canceled"))
    2.46 +  (let ((ov YaTeX-on-the-fly-overlay))
    2.47 +    (if stripoff
    2.48 +	(remove-text-properties (overlay-start ov)
    2.49 +				(1- (overlay-end ov))
    2.50 +				'(onthefly))
    2.51 +      (put-text-property (overlay-start YaTeX-on-the-fly-overlay)
    2.52 +			 (1- (overlay-end YaTeX-on-the-fly-overlay))
    2.53 +			 'onthefly
    2.54 +			 t))
    2.55 +    (delete-overlay ov)
    2.56 +    (message "On-the-fly preview deactivated")))
    2.57  
    2.58  (defun YaTeX-typeset-buffer (&optional pp)
    2.59    "Typeset whole buffer.