# HG changeset patch # User HIROSE Yuuji # Date 1421591081 -32400 # Node ID acfa7d11b5c3739b42f429f90f93a275fb2b9d19 # Parent 6b0d090840c108a8fa858eb60118764dfc7e3042 Sticky on-the-fly preview can be canceled by [prefix] k on vacant position. diff -r 6b0d090840c1 -r acfa7d11b5c3 yatex.new --- a/yatex.new Sun Jan 18 22:24:41 2015 +0900 +++ b/yatex.new Sun Jan 18 23:24:41 2015 +0900 @@ -5,6 +5,8 @@ ポイント位置がずれるEmacsの問題への対策を入れた。 === yatex === 数式環境など特定環境内の [prefix] t e で On-the-fly preview 発動。 + 環境に対する On-the-fly preview は編集中持続する。 + 持続中の On-the-fly preview の無効化は何もない場所で [prefix] k。 YaTeX-help-file のデフォルト位置を site-lisp/yatex/help/ に変更。 領域活性時に呼び出す補完は領域括りになるようにした。 === yahtml === diff -r 6b0d090840c1 -r acfa7d11b5c3 yatexprc.el --- a/yatexprc.el Sun Jan 18 22:24:41 2015 +0900 +++ b/yatexprc.el Sun Jan 18 23:24:41 2015 +0900 @@ -1,7 +1,7 @@ ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*- ;;; ;;; (c)1993-2015 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Jan 18 22:22:44 2015 on firestorm +;;; Last modified Sun Jan 18 23:17:57 2015 on firestorm ;;; $Id$ ;;; Code: @@ -609,7 +609,7 @@ (defun YaTeX-typeset-environment-1 () (let*((math (YaTeX-in-math-mode-p)) - (dpi (or (YaTeX-get-builtin "PREVIEWDPI") (if math "300" "200"))) + (dpi (or (YaTeX-get-builtin "IMAGEDPI") (if math "300" "200"))) (opoint (point)) usetimer) (cond @@ -693,7 +693,13 @@ (goto-char (match-beginning 0)))) (YaTeX-typeset-environment)))) -(defun YaTeX-typeset-environment-cancel-auto () +(defun YaTeX-on-the-fly-cancel () + "Reset on-the-fly stickiness" + (interactive) + (YaTeX-typeset-environment-cancel-auto 'stripoff) + t) ;t for kill-* + +(defun YaTeX-typeset-environment-cancel-auto (&optional stripoff) "Cancel typeset-environment timer." (interactive) (if YaTeX-typeset-environment-timer @@ -703,12 +709,17 @@ (string-to-number "0.1") t 'YaTeX-typeset-environment-activate-onthefly)) - (put-text-property (overlay-start YaTeX-on-the-fly-overlay) - (1- (overlay-end YaTeX-on-the-fly-overlay)) - 'onthefly - t) - (delete-overlay YaTeX-on-the-fly-overlay) - (message "On-the-fly preview canceled")) + (let ((ov YaTeX-on-the-fly-overlay)) + (if stripoff + (remove-text-properties (overlay-start ov) + (1- (overlay-end ov)) + '(onthefly)) + (put-text-property (overlay-start YaTeX-on-the-fly-overlay) + (1- (overlay-end YaTeX-on-the-fly-overlay)) + 'onthefly + t)) + (delete-overlay ov) + (message "On-the-fly preview deactivated"))) (defun YaTeX-typeset-buffer (&optional pp) "Typeset whole buffer.