yatex

diff yatexprc.el @ 406:acfa7d11b5c3

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 2857cac50a67
line diff
     1.1 --- a/yatexprc.el	Sun Jan 18 22:24:41 2015 +0900
     1.2 +++ b/yatexprc.el	Sun Jan 18 23:24:41 2015 +0900
     1.3 @@ -1,7 +1,7 @@
     1.4  ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*-
     1.5  ;;; 
     1.6  ;;; (c)1993-2015 by HIROSE Yuuji.[yuuji@yatex.org]
     1.7 -;;; Last modified Sun Jan 18 22:22:44 2015 on firestorm
     1.8 +;;; Last modified Sun Jan 18 23:17:57 2015 on firestorm
     1.9  ;;; $Id$
    1.10  
    1.11  ;;; Code:
    1.12 @@ -609,7 +609,7 @@
    1.13  
    1.14  (defun YaTeX-typeset-environment-1 ()
    1.15    (let*((math (YaTeX-in-math-mode-p))
    1.16 -	(dpi (or (YaTeX-get-builtin "PREVIEWDPI") (if math "300" "200")))
    1.17 +	(dpi (or (YaTeX-get-builtin "IMAGEDPI") (if math "300" "200")))
    1.18  	(opoint (point))
    1.19  	usetimer)
    1.20      (cond
    1.21 @@ -693,7 +693,13 @@
    1.22  	      (goto-char (match-beginning 0))))
    1.23  	(YaTeX-typeset-environment))))
    1.24  
    1.25 -(defun YaTeX-typeset-environment-cancel-auto ()
    1.26 +(defun YaTeX-on-the-fly-cancel ()
    1.27 +  "Reset on-the-fly stickiness"
    1.28 +  (interactive)
    1.29 +  (YaTeX-typeset-environment-cancel-auto 'stripoff)
    1.30 +  t)					;t for kill-*
    1.31 +  
    1.32 +(defun YaTeX-typeset-environment-cancel-auto (&optional stripoff)
    1.33    "Cancel typeset-environment timer."
    1.34    (interactive)
    1.35    (if YaTeX-typeset-environment-timer
    1.36 @@ -703,12 +709,17 @@
    1.37  	 (string-to-number "0.1")
    1.38  	 t
    1.39  	 'YaTeX-typeset-environment-activate-onthefly))
    1.40 -  (put-text-property (overlay-start YaTeX-on-the-fly-overlay)
    1.41 -		     (1- (overlay-end YaTeX-on-the-fly-overlay))
    1.42 -		     'onthefly
    1.43 -		     t)
    1.44 -  (delete-overlay YaTeX-on-the-fly-overlay)
    1.45 -  (message "On-the-fly preview canceled"))
    1.46 +  (let ((ov YaTeX-on-the-fly-overlay))
    1.47 +    (if stripoff
    1.48 +	(remove-text-properties (overlay-start ov)
    1.49 +				(1- (overlay-end ov))
    1.50 +				'(onthefly))
    1.51 +      (put-text-property (overlay-start YaTeX-on-the-fly-overlay)
    1.52 +			 (1- (overlay-end YaTeX-on-the-fly-overlay))
    1.53 +			 'onthefly
    1.54 +			 t))
    1.55 +    (delete-overlay ov)
    1.56 +    (message "On-the-fly preview deactivated")))
    1.57  
    1.58  (defun YaTeX-typeset-buffer (&optional pp)
    1.59    "Typeset whole buffer.