diff --git a/yatex.new b/yatex.new index efc45b4..1423464 100644 --- a/yatex.new +++ b/yatex.new @@ -1,6 +1,10 @@ What's new in YaTeX/yahtml �쒹/yahtml - �e�o�[�W�����̕ύX�_�ɂ‚��� +1.79 === yatex === + �����‹��ȂǓ���‹����� [prefix] t e �� On-the-fly preview �����B + + 1.78 Drag&Drop�T�|�[�g��lj��B tabular�‹�����2�A���ȏ�Tab�ŁA1�J�����i�ދ@�\��lj��B === yatex === diff --git a/yatex19.el b/yatex19.el index d415107..a5a0aff 100644 --- a/yatex19.el +++ b/yatex19.el @@ -1,6 +1,6 @@ ;;; yatex19.el -- YaTeX facilities for Emacs 19 or later ;;; (c)1994-2013 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Dec 21 14:03:48 2014 on firestorm +;;; Last modified Sat Jan 3 23:45:25 2015 on firestorm ;;; $Id$ ;;; Code: @@ -484,6 +484,14 @@ (defun YaTeX-19-create-face (sym fgcolor &optional bgcolor) "Create face named SYM with face of FGCOLOR/BGCOLOR." + (if (consp fgcolor) + (setq fgcolor (if (eq YaTeX-background-mode 'light) + (car fgcolor) + (cdr fgcolor)))) + (if (consp bgcolor) + (setq bgcolor (if (eq YaTeX-background-mode 'light) + (car bgcolor) + (cdr bgcolor)))) (cond ((and YaTeX-use-font-lock (fboundp 'defface)) (custom-declare-face @@ -632,7 +640,8 @@ (if single (list single 0 'macro)))))))))) ;;2006/6/23 new face, `delimiter' introduced -(YaTeX-19-create-face 'delimiter "saddlebrown" "ivory") +(YaTeX-19-create-face + 'delimiter '("saddlebrown" . "lightyellow") '("ivory". "navy")) ;;(YaTeX-19-collect-macros) ;causes an error (defun YaTeX-hilit-setup-alist () diff --git a/yatex23.el b/yatex23.el index e2526ea..ee73842 100644 --- a/yatex23.el +++ b/yatex23.el @@ -1,6 +1,6 @@ ;;; yatex23.el --- YaTeX facilities for Emacs 23 or later -*- coding: sjis -*- ;;; (c)2014 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Tue Dec 23 12:44:35 2014 on firestorm +;;; Last modified Sat Jan 3 23:34:41 2015 on firestorm ;;; $Id$ ;;; Code: @@ -89,6 +89,20 @@ (insert "\\input{" path "}")))) (t (message "%s" action))))) +(defvar YaTeX-on-the-fly-bg-face '("#f0f0c0" . "#404020") + "Background color of on-the-fly preview image activated environment.") +(defvar YaTeX-on-the-fly-overlay nil + "Overlay of on-the-fly preview image") +(defface YaTeX-on-the-fly-activated-face + (list + (list (list '(class color)) + (list ':background + (if (eq YaTeX-background-mode 'light) + (car YaTeX-on-the-fly-bg-face) + (cdr YaTeX-on-the-fly-bg-face)))) + (list t (list ':bold t))) + "Face of on-the-fly preview image mode") + (provide 'yatex23) ; Local variables: diff --git a/yatexlib.el b/yatexlib.el index a42d2dd..378a6f7 100644 --- a/yatexlib.el +++ b/yatexlib.el @@ -1,7 +1,7 @@ ;;; yatexlib.el --- YaTeX and yahtml common libraries ;;; ;;; (c)1994-2013 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Mon Dec 29 13:54:17 2014 on sdr +;;; Last modified Sun Jan 4 00:16:04 2015 on firestorm ;;; $Id$ ;;; Code: @@ -1428,7 +1428,7 @@ '((((class static-color)) (:bold t)) (((type tty)) (:bold t)) (((class color) (background dark)) (:foreground "khaki" :bold t)) - (((class color) (background light)) (:foreground "Goldenrod")) + (((class color) (background light)) (:foreground "DarkGoldenrod4")) (t (:bold t :underline t))) "Font Lock mode face used to highlight formula." :group 'font-lock-faces) @@ -1438,7 +1438,7 @@ '((((class static-color)) (:bold t)) (((type tty)) (:bold t)) (((class color) (background dark)) - (:foreground "saddlebrown" :background "ivory" :bold t)) + (:foreground "lightyellow3" :background "navy" :bold t)) (((class color) (background light)) (:foreground "red")) (t (:bold t :underline t))) "Font Lock mode face used to highlight delimiters." @@ -1451,7 +1451,7 @@ (((class color) (background dark)) (:foreground "khaki" :bold t :underline t)) (((class color) (background light)) - (:foreground "Goldenrod" :underline t)) + (:foreground "DarkGoldenrod4" :underline t)) (t (:bold t :underline t))) "Font Lock mode face used to highlight subscripts in formula." :group 'font-lock-faces) @@ -1463,7 +1463,7 @@ (((class color) (background dark)) (:bold nil :foreground "ivory" :background "lightyellow4")) (((class color) (background light)) - (:underline t :foreground "gold")) + (:underline t :foreground "DarkGoldenrod3")) (t (:bold t :underline t))) "Font Lock mode face used to highlight superscripts in formula." :group 'font-lock-faces) diff --git a/yatexprc.el b/yatexprc.el index 2a2cbd9..ed5a70c 100644 --- a/yatexprc.el +++ b/yatexprc.el @@ -1,7 +1,7 @@ ;;; yatexprc.el --- YaTeX process handler ;;; ;;; (c)1993-2014 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Wed Dec 31 22:42:56 2014 on sdr +;;; Last modified Sat Jan 3 23:37:49 2015 on firestorm ;;; $Id$ ;;; Code: @@ -404,8 +404,10 @@ (put 'dvi2-command 'file buffer) (put 'dvi2-command 'offset lineinfo)))) -(defvar YaTeX-use-image-preview t - "*Use or else view graphic preview image via [prefix] t e.") +(defvar YaTeX-use-image-preview "jpg" + "*Nil means not using image preview by [prefix] t e. +Acceptable value is one of \"jpg\" or \"png\", which specifies +format of preview image.") (defvar YaTeX-preview-image-mode-map nil "Keymap used in YaTeX-preview-image-mode") (defun YaTeX-preview-image-mode () @@ -436,7 +438,8 @@ (defvar YaTeX-typeset-dvi2image-chain (cond - ((YaTeX-executable-find "dvipng") + ((and (equal YaTeX-use-image-preview "png") + (YaTeX-executable-find "dvipng")) (list "dvipng %b.dvi")) ((YaTeX-executable-find YaTeX-cmd-dvips) (list @@ -460,7 +463,8 @@ (defun YaTeX-typeset-conv2image-chain () (let*((proc (or YaTeX-typeset-process YaTeX-typeset-conv2image-process)) (prevname (process-name proc)) - (texput "texput") (format "jpg") + (texput "texput") + (format YaTeX-use-image-preview) (target (concat texput "." format)) (math (get 'YaTeX-typeset-conv2image-chain 'math)) (srctype (or (get 'YaTeX-typeset-conv2image-chain 'srctype) @@ -571,7 +575,7 @@ ;; If condition changed from last call, do it ((and (/= p (preceding-char)) (/= q (char-after (- (point) 1))) - (not (string= st (YaTeX-buffer-substring s e)))) + (not (string= st (YaTeX-buffer-substring s (min e (point-max)))))) (YaTeX-typeset-environment))))) (defun YaTeX-typeset-environment () @@ -600,7 +604,15 @@ (YaTeX-buffer-substring b e) (current-time))) (YaTeX-typeset-region 'YaTeX-typeset-conv2image-chain) - (if usetimer (YaTeX-typeset-environment-auto))) + (if usetimer + (progn + (if YaTeX-on-the-fly-overlay + (move-overlay YaTeX-on-the-fly-overlay b e) + (overlay-put + (setq YaTeX-on-the-fly-overlay (make-overlay b e)) + 'face 'YaTeX-on-the-fly-activated-face)) + (YaTeX-typeset-environment-auto) + ))) (YaTeX-typeset-region))))) (defvar YaTeX-on-the-fly-preview-image (string-to-number "0.1") @@ -628,6 +640,7 @@ (interactive) (cancel-timer YaTeX-typeset-environment-timer) (setq YaTeX-typeset-environment-timer nil) + (delete-overlay YaTeX-on-the-fly-overlay) (message "Auto-preview canceled"))