yatex
changeset 362:b1e6c8c03253 dev
Preparing for 1.78
Add comment which requests for comment.
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Fri, 26 Dec 2014 00:07:01 +0900 |
parents | 41a05a44826a |
children | f7ae3e4be0bb |
files | yatex.el yatex.new yatexprc.el |
diffstat | 3 files changed, 87 insertions(+), 39 deletions(-) [+] |
line diff
1.1 --- a/yatex.el Tue Dec 23 15:34:31 2014 +0900 1.2 +++ b/yatex.el Fri Dec 26 00:07:01 2014 +0900 1.3 @@ -1,6 +1,6 @@ 1.4 ;;; yatex.el --- Yet Another tex-mode for emacs //野鳥// -*- coding: sjis -*- 1.5 ;;; (c)1991-2014 by HIROSE Yuuji.[yuuji@yatex.org] 1.6 -;;; Last modified Tue Dec 23 12:07:26 2014 on firestorm 1.7 +;;; Last modified Fri Dec 26 00:04:43 2014 on firestorm 1.8 ;;; $Id$ 1.9 ;;; The latest version of this software is always available at; 1.10 ;;; http://www.yatex.org/ 1.11 @@ -8,7 +8,7 @@ 1.12 ;;; Code: 1.13 (require 'comment) 1.14 (require 'yatexlib) 1.15 -(defconst YaTeX-revision-number "1.77.7" 1.16 +(defconst YaTeX-revision-number "1.78" 1.17 "Revision number of running yatex.el") 1.18 1.19 ;---------- Local variables ---------- 1.20 @@ -61,6 +61,7 @@ 1.21 (defvar YaTeX-cmd-dia "dia") 1.22 (defvar YaTeX-cmd-ooo "soffice") 1.23 (defvar YaTeX-cmd-gs "gs") 1.24 +(defvar YaTeX-cmd-dvips "dvips") ;Set "pdvips" for Vine Linux 1.25 (defvar YaTeX-cmd-displayline 1.26 "/Applications/Skim.app/Contents/SharedSupport/displayline") 1.27 (defvar YaTeX-cmd-edit-ps YaTeX-cmd-gimp) 1.28 @@ -68,6 +69,7 @@ 1.29 (defvar YaTeX-cmd-edit-ai YaTeX-cmd-inkscape) 1.30 (defvar YaTeX-cmd-edit-svg YaTeX-cmd-inkscape) 1.31 (defvar YaTeX-cmd-edit-images YaTeX-cmd-gimp) 1.32 +(defvar YaTeX-cmd-view-images "display -geometry +0+0") 1.33 1.34 (defvar tex-pdfview-command ;previewer command for your site 1.35 (cond 1.36 @@ -3025,8 +3027,10 @@ 1.37 (> ep (point)) 1.38 (looking-at "\\&\\|\\\\") 1.39 (= wc (car (YaTeX-array-what-column-internal)))) 1.40 - (skip-chars-forward "&\\\\" ep) 1.41 - (skip-chars-forward "\n\t " ep)))))) 1.42 + (skip-chars-forward "&" ep) 1.43 + (while (looking-at "[\n\t ]+\\|\\\\\\\\\\|\\\\.line\\>") 1.44 + (goto-char (match-end 0)) 1.45 + )))))) 1.46 1.47 (defun YaTeX-backward-field (arg) 1.48 "Move backward to the ARGth next column field of table."
2.1 --- a/yatex.new Tue Dec 23 15:34:31 2014 +0900 2.2 +++ b/yatex.new Fri Dec 26 00:07:01 2014 +0900 2.3 @@ -9,6 +9,8 @@ 2.4 「%#!コマンド -オプション」のときは親ファイル指定なしと判定。 2.5 地の段落での [prefix] t g でヴューアの forward-search を試みる。 2.6 [prefix] t e の環境タイプセットの結果を可能なら画像に。 2.7 + [prefix] t e を環境外で呼んだ場合はパラグラフをタイプセット。 2.8 + [prefix] t e を領域活性状態で呼んだらその領域をタイプセット。 2.9 === yahtml === 2.10 table, ul, ol, dl 内で2連続以上Tabで、1カラム進む機能を追加。 2.11
3.1 --- a/yatexprc.el Tue Dec 23 15:34:31 2014 +0900 3.2 +++ b/yatexprc.el Fri Dec 26 00:07:01 2014 +0900 3.3 @@ -1,7 +1,7 @@ 3.4 ;;; yatexprc.el --- YaTeX process handler 3.5 ;;; 3.6 ;;; (c)1993-2013 by HIROSE Yuuji.[yuuji@yatex.org] 3.7 -;;; Last modified Tue Dec 23 11:53:48 2014 on firestorm 3.8 +;;; Last modified Thu Dec 25 22:12:33 2014 on firestorm 3.9 ;;; $Id$ 3.10 3.11 ;;; Code: 3.12 @@ -397,6 +397,8 @@ 3.13 (put 'dvi2-command 'file buffer) 3.14 (put 'dvi2-command 'offset lineinfo)))) 3.15 3.16 +(defvar YaTeX-use-image-preview t 3.17 + "*Use or else view graphic preview image via [prefix] t e.") 3.18 (defvar YaTeX-preview-image-mode-map nil 3.19 "Keymap used in YaTeX-preview-image-mode") 3.20 (defun YaTeX-preview-image-mode () 3.21 @@ -422,14 +424,24 @@ 3.22 ;(conv (format "convert -density %d - %s" (if math 250 100) target)) 3.23 ;(chain (list (format "dvips -E -o - texput|%s" conv))) 3.24 (conv (format "convert -alpha off - %s" target)) 3.25 - (chain (list (format "dvips -x 2000 -E -o - texput|%s" conv))) 3.26 + (chain (list (format "%s -x %d -E -o - texput|%s" 3.27 + ;; This function is the first evaluation code. 3.28 + ;; If you find these command line does not work 3.29 + ;; on your system, please tell the author 3.30 + ;; which commands should be taken to achieve 3.31 + ;; one-shot png previewing on your system 3.32 + ;; before publishing patch on the Web. 3.33 + ;; Please please please please please. 3.34 + YaTeX-cmd-dvips 3.35 + (if math 3000 2000) 3.36 + conv))) 3.37 (curproc (member prevname chain)) 3.38 (w (get 'YaTeX-typeset-conv2image-chain 'win)) 3.39 (pwd default-directory) 3.40 img) 3.41 (if (not (= (process-exit-status proc) 0)) 3.42 (progn 3.43 - (YaTeX-showup-buffer ;nevers comes here(?) 3.44 + (YaTeX-showup-buffer ;never comes here(?) 3.45 (current-buffer) 'YaTeX-showup-buffer-bottom-most) 3.46 (message "Region typesetting FAILED")) 3.47 (setq command 3.48 @@ -449,32 +461,48 @@ 3.49 'YaTeX-typeset-conv2image-chain) 3.50 (get 'YaTeX-typeset-process 'ppcmd)))) 3.51 ;; After all chain executed, display image in current window 3.52 - (select-window w) 3.53 - (setq foo (selected-window)) 3.54 - (YaTeX-showup-buffer 3.55 - (get-buffer-create " *YaTeX-region-image*") 3.56 - 'YaTeX-showup-buffer-bottom-most t) 3.57 - (remove-images (point-min) (point-max)) 3.58 - (erase-buffer) 3.59 - (cd pwd) ;when reuse from other source 3.60 + (cond 3.61 + ((and nil (featurep 'image) window-system) 3.62 + ;; If direct image displaying available in running Emacs, 3.63 + ;; display target image into the next window in Emacs. 3.64 + (select-window w) 3.65 + (setq foo (selected-window)) 3.66 + (YaTeX-showup-buffer 3.67 + (get-buffer-create " *YaTeX-region-image*") 3.68 + 'YaTeX-showup-buffer-bottom-most t) 3.69 + (remove-images (point-min) (point-max)) 3.70 + (erase-buffer) 3.71 + (cd pwd) ;when reuse from other source 3.72 ;(put-image (create-image (expand-file-name target)) (point)) 3.73 - (insert-image-file target) 3.74 - (setq img (plist-get (text-properties-at (point)) 'intangible)) 3.75 - (YaTeX-preview-image-mode) 3.76 - (if img 3.77 - (let ((height (cdr (image-size img)))) 3.78 - (enlarge-window 3.79 - (- (ceiling (min height (/ (frame-height) 2))) 3.80 - (window-height))))))))) 3.81 + (insert-image-file target) 3.82 + (setq img (plist-get (text-properties-at (point)) 'intangible)) 3.83 + (YaTeX-preview-image-mode) 3.84 + (if img 3.85 + (let ((height (cdr (image-size img)))) 3.86 + (enlarge-window 3.87 + (- (ceiling (min height (/ (frame-height) 2))) 3.88 + (window-height)))))) 3.89 + (t 3.90 + ;; Without direct image, display image with image viewer 3.91 + (YaTeX-system 3.92 + (format "%s %s" YaTeX-cmd-view-images target) 3.93 + "YaTeX-region-image" 3.94 + 'noask) 3.95 + ) 3.96 + ))))) 3.97 3.98 (defun YaTeX-typeset-environment () 3.99 "Typeset current math environment" 3.100 (interactive) 3.101 (save-excursion 3.102 (let ((math (YaTeX-in-math-mode-p))) 3.103 - (or (equal (YaTeX-inner-environment t) "document") 3.104 - (YaTeX-mark-environment)) 3.105 - (if (and (featurep 'image) window-system) 3.106 + (cond 3.107 + ((and (fboundp 'region-active-p) (region-active-p)) 3.108 + nil) ;if region is active, use it 3.109 + ((equal (or (YaTeX-inner-environment t) "document") "document") 3.110 + (mark-paragraph)) 3.111 + (t (YaTeX-mark-environment))) 3.112 + (if YaTeX-use-image-preview 3.113 (let ((YaTeX-typeset-buffer (concat "*bg:" YaTeX-typeset-buffer))) 3.114 (put 'YaTeX-typeset-conv2image-chain 'math math) 3.115 (put 'YaTeX-typeset-conv2image-chain 'win (selected-window)) 3.116 @@ -595,14 +623,21 @@ 3.117 (format "%s %s" default mainroot)) 3.118 'YaTeX-call-command-history)) 3.119 (if (or update (null b-in)) 3.120 - (if (y-or-n-p "Use this command line in the future? ") 3.121 + (if (y-or-n-p "Memorize this command line in this file? ") 3.122 (YaTeX-getset-builtin builtin-type command) ;keep in a file 3.123 (setq YaTeX-call-builtin-on-file ;keep in memory 3.124 (cons (cons builtin-type command) 3.125 - (delete (assoc builtin-type alist) alist))))))) 3.126 + (delete (assoc builtin-type alist) alist))) 3.127 + (message "`%s' kept in memory. Type `%s %s' to override." 3.128 + command 3.129 + (key-description 3.130 + (car (where-is-internal 'universal-argument))) 3.131 + (key-description (this-command-keys))) 3.132 + (sit-for 2))))) 3.133 (YaTeX-typeset 3.134 command 3.135 - (format " *YaTeX-%s*" (downcase builtin-type))))) 3.136 + (format " *YaTeX-%s*" (downcase builtin-type)) 3.137 + builtin-type builtin-type))) 3.138 3.139 (defun YaTeX-kill-typeset-process (proc) 3.140 "Kill process PROC after sending signal to PROC. 3.141 @@ -638,7 +673,8 @@ 3.142 (set-buffer buffer) 3.143 (setq default-directory (cd (or basedir df))) 3.144 (erase-buffer) 3.145 - (insert (format "Calling `%s'..." command)) 3.146 + (insert (format "Calling `%s'...\n" command) 3.147 + "==Kill this buffer to STOP process==") 3.148 (YaTeX-showup-buffer buffer 'YaTeX-showup-buffer-bottom-most) 3.149 (if (not (fboundp 'start-process)) 3.150 (call-process 3.151 @@ -822,18 +858,24 @@ 3.152 ((string-match "Skim" previewer) 3.153 (format "%s %d '%s.pdf' '%s'" 3.154 YaTeX-cmd-displayline line bnr cf)) 3.155 - ((string-match "sumatra" previewer) ;;?? 3.156 - (format "%s \"%s.pdf\" -forward-search \"%s\" %d %s" 3.157 - previewer bnr cf line)) 3.158 ((string-match "evince" previewer) 3.159 (format "%s '%s.pdf' %d '%s'" 3.160 "fwdevince" bnr line cf)) 3.161 - ((string-match "qpdfview" previewer) ;;?? 3.162 - (format "%s '%s.pdf' '#src:%s:%d:0'" 3.163 - previewer bnr cf line)) 3.164 - ((string-match "okular" previewer) ;;?? 3.165 - (format "%s '%s.pdf' '#src:%d' '%s'" 3.166 - previewer bnr line cf))))) 3.167 + ;; 3.168 + ;; These lines below for other PDF viewer is not confirmed 3.169 + ;; yet. If you find correct command line, PLEASE TELL 3.170 + ;; IT TO THE AUTHOR before publishing patch on the web. 3.171 + ;; ..PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE.. 3.172 + ;; ((string-match "sumatra" previewer) ;;?? 3.173 + ;; (format "%s \"%s.pdf\" -forward-search \"%s\" %d" 3.174 + ;; previewer bnr cf line)) 3.175 + ;; ((string-match "qpdfview" previewer) ;;?? 3.176 + ;; (format "%s '%s.pdf#src:%s:%d:0'" ;if NG, tell 3.177 + ;; previewer bnr cf line)) 3.178 + ;; ((string-match "okular" previewer) ;;?? 3.179 + ;; (format "%s '%s.pdf#src:%d' '%s'" 3.180 + ;; previewer bnr line cf)) 3.181 + ))) 3.182 (YaTeX-system cmd "jump-line" 'noask pdir))))) 3.183 3.184 (defun YaTeX-goto-corresponding-viewer ()