yatex

changeset 521:cef987df070f dev

Move main stuffs of SpecialFilter to yatexflt.el
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 09 Jan 2018 13:35:08 +0900
parents 52175326855d
children ce46889a743d
files yatex.el yatexflt.el
diffstat 2 files changed, 58 insertions(+), 58 deletions(-) [+]
line diff
     1.1 --- a/yatex.el	Tue Jan 09 13:33:50 2018 +0900
     1.2 +++ b/yatex.el	Tue Jan 09 13:35:08 2018 +0900
     1.3 @@ -1,6 +1,6 @@
     1.4  ;;; yatex.el --- Yet Another tex-mode for emacs //쒹// -*- coding: sjis -*-
     1.5  ;;; (c)1991-2018 by HIROSE Yuuji.[yuuji@yatex.org]
     1.6 -;;; Last modified Sat Jan  6 22:52:02 2018 on firestorm
     1.7 +;;; Last modified Tue Jan  9 13:30:45 2018 on firestorm
     1.8  ;;; $Id$
     1.9  ;;; The latest version of this software is always available at;
    1.10  ;;; https://www.yatex.org/
    1.11 @@ -378,58 +378,6 @@
    1.12  
    1.13  (defvar YaTeX-use-dot-env-extension t
    1.14    "*Use YaTeX's dot-env filter special environment.")
    1.15 -(defvar YaTeX-filter-special-env-alist-default
    1.16 -  '((".blockdiag"
    1.17 -     "blockdiag -T %t -o %o -"
    1.18 -     "blockdiag {
    1.19 -  default_fontsize = 32;
    1.20 -  A -> B;
    1.21 -}")
    1.22 -    (".seqdiag" "seqdiag -T %t -o %o -"
    1.23 -     "seqdiag {
    1.24 -  client -> server [label = \"SYN\"];
    1.25 -  client <- server [label = \"SYN/ACK\"];
    1.26 -  client -> server [label = \"ACK\"];}")
    1.27 -    (".actdiag" "actdiag -T %t -o %o -"
    1.28 -     "actdiag {
    1.29 -  sayHo -> ho -> hohoho
    1.30 -  lane dj {
    1.31 -    label = \"DJ\"
    1.32 -    sayHo [label = \"Say Ho\"]; hohoho [label = \"Ho Ho Ho!\"]; }
    1.33 -  lane mc { label = \"MC\"; ho [label = \"Hooooh!\"]}}")
    1.34 -    (".nwdiag" "nwdiag -T %t -o %o -"
    1.35 -     "nwdiag {
    1.36 -  network ext {
    1.37 -    address = \"10.1.2.0/24\"
    1.38 -    router [address = \"10.1.2.1\"]
    1.39 -  }
    1.40 -  network int {
    1.41 -    address = \"192.168.22.0/24\"
    1.42 -    router [address = \"192.168.22.1\"]
    1.43 -    websrv [address = \"192.168.22.80\"]
    1.44 -    cli-1; cli-2
    1.45 -  }
    1.46 -}")
    1.47 -    (".rackdiag" "rackdiag -T %t -o %o -"
    1.48 -     "rackdiag {
    1.49 -  16U;
    1.50 -  1: UPS [4U]; 5: Storage [3U]; 8: PC [2U]; 8: PC [2U];
    1.51 -}")
    1.52 -    (".dot"
    1.53 -     "dot -T %t -o %o"
    1.54 -     "digraph {
    1.55 -  graph [charset=\"utf-8\"]
    1.56 -}
    1.57 -bigraph {
    1.58 -  graph [charset=\"utf-8\"]}"
    1.59 -     )))
    1.60 -
    1.61 -(defvar YaTeX-filter-special-env-alist-private nil)
    1.62 -(defvar YaTeX-filter-special-env-alist
    1.63 -  (append YaTeX-filter-special-env-alist-private
    1.64 -	  YaTeX-filter-special-env-alist-default))
    1.65 -
    1.66 -
    1.67  
    1.68  ; Set tex-environment possible completion
    1.69  (defvar env-table
    1.70 @@ -455,10 +403,9 @@
    1.71  	 ("breakbox")))			;defined in eclbkbox
    1.72     (if YaTeX-use-AMS-LaTeX YaTeX-ams-env-table)
    1.73     YaTeX-math-other-env-alist
    1.74 -   (if YaTeX-use-dot-env-extension
    1.75 -       '((".blockdiag") (".nwdiag") (".seqdiag") (".rackdiag") (".packetdiag")
    1.76 -	 (".dot"))
    1.77 -     ))
    1.78 +   (and YaTeX-use-dot-env-extension
    1.79 +	(require 'yatexflt)
    1.80 +	YaTeX-filter-special-env-alist))
    1.81    "Default completion table for begin-type completion.")
    1.82  
    1.83  (defvar user-env-table nil)
     2.1 --- a/yatexflt.el	Tue Jan 09 13:33:50 2018 +0900
     2.2 +++ b/yatexflt.el	Tue Jan 09 13:35:08 2018 +0900
     2.3 @@ -1,7 +1,7 @@
     2.4  ;;; yatexflt.el --- YaTeX filter command utilizer -*- coding: sjis -*-
     2.5  ;;; 
     2.6  ;;; (c)1993-2018 by HIROSE Yuuji.[yuuji@yatex.org]
     2.7 -;;; Last modified Sun Jan  7 11:38:12 2018 on firestorm
     2.8 +;;; Last modified Tue Jan  9 13:28:56 2018 on firestorm
     2.9  ;;; $Id$
    2.10  
    2.11  ;;; Commentary:
    2.12 @@ -36,7 +36,60 @@
    2.13  ;;;	Then foo.pdf file will be generated and the image (as PNG) will
    2.14  ;;;	be displayed in the next window.
    2.15  
    2.16 +
    2.17  ;;; Code:
    2.18 +(require 'yatexlib)
    2.19 +(defvar YaTeX-filter-special-env-alist-default
    2.20 +  '((".blockdiag"
    2.21 +     "blockdiag -T %t -o %o -"
    2.22 +     "blockdiag {
    2.23 +  default_fontsize = 32;
    2.24 +  A -> B;
    2.25 +}")
    2.26 +    (".seqdiag" "seqdiag -T %t -o %o -"
    2.27 +     "seqdiag {
    2.28 +  client -> server [label = \"SYN\"];
    2.29 +  client <- server [label = \"SYN/ACK\"];
    2.30 +  client -> server [label = \"ACK\"];}")
    2.31 +    (".actdiag" "actdiag -T %t -o %o -"
    2.32 +     "actdiag {
    2.33 +  sayHo -> ho -> hohoho
    2.34 +  lane dj {
    2.35 +    label = \"DJ\"
    2.36 +    sayHo [label = \"Say Ho\"]; hohoho [label = \"Ho Ho Ho!\"]; }
    2.37 +  lane mc { label = \"MC\"; ho [label = \"Hooooh!\"]}}")
    2.38 +    (".nwdiag" "nwdiag -T %t -o %o -"
    2.39 +     "nwdiag {
    2.40 +  network ext {
    2.41 +    address = \"10.1.2.0/24\"
    2.42 +    router [address = \"10.1.2.1\"]
    2.43 +  }
    2.44 +  network int {
    2.45 +    address = \"192.168.22.0/24\"
    2.46 +    router [address = \"192.168.22.1\"]
    2.47 +    websrv [address = \"192.168.22.80\"]
    2.48 +    cli-1; cli-2
    2.49 +  }
    2.50 +}")
    2.51 +    (".rackdiag" "rackdiag -T %t -o %o -"
    2.52 +     "rackdiag {
    2.53 +  16U;
    2.54 +  1: UPS [4U]; 5: Storage [3U]; 8: PC [2U]; 8: PC [2U];
    2.55 +}")
    2.56 +    (".dot"
    2.57 +     "dot -T %t -o %o"
    2.58 +     "digraph {
    2.59 +  graph [charset=\"utf-8\"]
    2.60 +}
    2.61 +bigraph {
    2.62 +  graph [charset=\"utf-8\"]}"
    2.63 +     )))
    2.64 +
    2.65 +(defvar YaTeX-filter-special-env-alist-private nil)
    2.66 +(defvar YaTeX-filter-special-env-alist
    2.67 +  (append YaTeX-filter-special-env-alist-private
    2.68 +	  YaTeX-filter-special-env-alist-default))
    2.69 +
    2.70  (defun YaTeX-filter-filter-set-conversion-flag ()
    2.71    (let ((ovl (get 'YaTeX-filter-filter-sentinel 'overlay)))
    2.72      (if ovl				;; When successful conversion met,