yatex

diff yatexflt.el @ 582:f4c2dca86202

Add "mcfamily" and "gtfamily"
author HIROSE Yuuji <yuuji@gentei.org>
date Sat, 08 Feb 2020 18:31:52 +0900
parents ea6956f10ce7
children
line diff
     1.1 --- a/yatexflt.el	Sat Jun 02 15:57:55 2018 +0900
     1.2 +++ b/yatexflt.el	Sat Feb 08 18:31:52 2020 +0900
     1.3 @@ -1,7 +1,7 @@
     1.4  ;;; yatexflt.el --- YaTeX filter command utilizer -*- coding: sjis -*-
     1.5  ;;; 
     1.6  ;;; (c)1993-2018 by HIROSE Yuuji.[yuuji@yatex.org]
     1.7 -;;; Last modified Sat Jun  2 15:55:38 2018 on firestorm
     1.8 +;;; Last modified Sat Jun  2 18:12:41 2018 on firestorm
     1.9  ;;; $Id$
    1.10  
    1.11  ;;; Commentary:
    1.12 @@ -80,9 +80,8 @@
    1.13       "dot -T %t -o %o"
    1.14       "digraph {
    1.15    graph [charset=\"utf-8\"]
    1.16 -}
    1.17 -bigraph {
    1.18 -  graph [charset=\"utf-8\"]}"
    1.19 +  A -> B
    1.20 +}"
    1.21       )))
    1.22  
    1.23  ;;;###autoload
    1.24 @@ -235,6 +234,11 @@
    1.25  	(goto-char (point-max))
    1.26  	(insert (format "%s\n" (process-status proc))))))))
    1.27  
    1.28 +(defvar YaTeX-filter-block-marker "==="
    1.29 +  "Begining and Ending marker for contents for external filter program")
    1.30 +(defvar YaTeX-filter-src "#SRC"
    1.31 +  "Keyword for input filename for external filter program")
    1.32 +
    1.33  (defun YaTeX-filter-parse-filter-region (begend-info)
    1.34    "Return the list of SpecialFilter region.  If not on, return nil.
    1.35  BEGEND-INFO is a value from the function YaTeX-in-BEGEND-p.
    1.36 @@ -247,7 +251,10 @@
    1.37    (if begend-info
    1.38        (let ((b (car begend-info)) (e (nth 1 begend-info))
    1.39  	    delim (args (nth 2 begend-info))
    1.40 -	    (p (point)) openb closeb outfile source cmdline point-beg point-end)
    1.41 +	    (p (point)) openb closeb outfile source cmdline point-beg point-end
    1.42 +	    (src-ptn (format "^\\s *%s%s"
    1.43 +			     (regexp-quote comment-start)
    1.44 +			     (regexp-quote YaTeX-filter-src))))
    1.45  	(save-excursion
    1.46  	  (and
    1.47  	   (string-match "FILTER" args) ;easy test
    1.48 @@ -270,7 +277,7 @@
    1.49  	   (cond
    1.50  	    ((re-search-forward "^\\\\if0\\>" p t)  ;; Embedded source
    1.51  	     (forward-line 1)
    1.52 -	     (setq point-beg (if (looking-at "\\(.\\)\\1\\1") ;Triple chars
    1.53 +	     (setq point-beg (if (looking-at YaTeX-filter-block-marker)
    1.54  				 (progn (setq delim (YaTeX-match-string 0))
    1.55  					(forward-line 1)
    1.56  					(point))
    1.57 @@ -284,7 +291,8 @@
    1.58  				    (1+ point-beg) t)
    1.59  				   (match-beginning 0))
    1.60  			       (point))))
    1.61 -	    ((re-search-forward "^\\s *%#SRC{\\(.*\\)}" e t) ; external file
    1.62 +	    ((re-search-forward
    1.63 +	      (format "%s{\\(.*\\)}" src-ptn) e t) ; external file
    1.64  	     (setq source (YaTeX-match-string 1)
    1.65  		   point-beg (match-beginning 0)
    1.66  		   point-end (match-end 0)))
    1.67 @@ -388,14 +396,14 @@
    1.68  	       ((string-match "\\.\\(pdf\\|png\\|jpe?g\\|tiff?\\)$" f)
    1.69  		(format "%%# \\includegraphics{%s}\n" f)))))
    1.70      (and region-p (exchange-point-and-mark))
    1.71 -    (insert (format "%%#BEGIN FILTER{%s}{%s}\n%s"
    1.72 +    (insert (format "%%#BEGIN FILTER{%s}{%s}\n%s%s"
    1.73  		    f (or cmdargs "")
    1.74 +		    (format "%%#%% If you call program in yatex, type `%se'\n"
    1.75 +			    (key-description
    1.76 +			     (car (where-is-internal 'YaTeX-typeset-menu))))
    1.77  		    (if in-line "\\if0\n===\n" "")))
    1.78      (save-excursion
    1.79        (insert
    1.80 -       (format "%%#%% If you call program in yatex-mode, type `%se'\n"
    1.81 -	       (key-description
    1.82 -		(car (where-is-internal 'YaTeX-typeset-menu))))
    1.83         (if in-line
    1.84  	   (cond (template-text
    1.85  		  (concat template-text