[BACK]Return to init-openxm.scm CVS log [TXT][DIR] Up to [local] / OpenXM / src / kxx

Annotation of OpenXM/src/kxx/init-openxm.scm, Revision 1.8

1.8     ! ohara       1: ; $OpenXM: OpenXM/src/kxx/init-openxm.scm,v 1.7 2004/03/16 03:26:40 ohara Exp $
1.3       ohara       2:
1.7       ohara       3: (define (openxm-eval t)
1.3       ohara       4:   (import-from (texmacs plugin plugin-cmd))
                      5:   (import-from (texmacs plugin plugin-convert))
                      6:   (plugin-eval "openxm" "default" (object->tree t)))
                      7:
1.7       ohara       8: (define (openxm-eval-paste t)
                      9:   (insert-tree (object->tree (openxm-eval t))))
1.5       ohara      10:
                     11: (define (openxm-path t)
                     12:   (if (string? t)
                     13:     (let* ((openxm-home (or (getenv "OpenXM_HOME") "/usr/local/OpenXM"))
1.7       ohara      14:            (local-path (string-append openxm-home "/" t))
                     15:            (web-prefix "http://www.math.kobe-u.ac.jp/OpenXM/Current/")
                     16:            (web-path   (string-append web-prefix t)))
1.5       ohara      17:       (if (url-exists? local-path) local-path web-path))))
1.2       ohara      18:
1.8     ! ohara      19: (define w3m-cmd
        !            20:   (cond
        !            21:    ((url-exists-in-path? "w3m")
        !            22:        (cond ((url-exists-in-path? "rxvt")  "rxvt  -g 100x50 -e w3m")
        !            23:                  ((url-exists-in-path? "xterm") "xterm -g 100x50 -e w3m")
        !            24:                  (else #f)))
        !            25:    ((url-exists-in-path? "mozilla" ) "mozilla" )
        !            26:    ((url-exists-in-path? "netscape") "netscape")
        !            27:    ((url-exists-in-path? "iexplore") "iexplore")
        !            28:    (else #f)))
        !            29:
1.2       ohara      30: (define (w3m t)
1.8     ! ohara      31:   (if (and (string? t) w3m-cmd)
        !            32:     (system (string-append w3m-cmd " " t " &"))))
1.2       ohara      33:
1.5       ohara      34: (define (w3m-search t)
                     35:   (w3m (openxm-path t)))
1.1       ohara      36:
                     37: (define (openxm-initialize)
                     38:   (menu-extend texmacs-session-help-icons
1.5       ohara      39:     (if (in-openxm?)
1.1       ohara      40:     |
                     41:     ((balloon (icon "tm_help.xpm") "Risa/Asir manual")
1.5       ohara      42:      (w3m-search "doc/asir2000/html-jp/man_toc.html"))))
1.1       ohara      43:   (menu-extend texmacs-extra-menu
                     44:     (if (in-openxm?)
                     45:       (=> "OpenXM"
1.3       ohara      46:         (-> "Select engines"
                     47:           ("Risa/Asir" (insert-string "!asir;"))
                     48:           ("Kan/sm1"   (insert-string "!sm1;")))
1.7       ohara      49:         (-> "Select display style"
                     50:           ("LaTeX"     (openxm-eval "!latex;"))
                     51:           ("verbatim"  (openxm-eval "!verbatim;")))
                     52:         (-> "Load Modules (Asir)"
                     53:           ("dsolv"     (openxm-eval "load(\"dsolv\");"))
                     54:           ("ccurve"    (openxm-eval "load(\"ccurve.rr\");"))
                     55:           ("yang"      (openxm-eval "load(\"yang.rr\");"))
                     56:           )
                     57:         (-> "Display Configuration (Asir)"
                     58:           ("Load default"   (openxm-eval "noro_print_env(0);"))
                     59:           ("Weyl algebra"   (openxm-eval "noro_print_env(\"weyl\");"))
                     60:           ("Euler OPs"      (openxm-eval "noro_print_env(\"yang\");"))
                     61:           )
1.3       ohara      62:         ---
                     63:         (-> "Manuals"
1.5       ohara      64:           ("Risa/Asir manual"
                     65:            (w3m-search "doc/asir2000/html-jp/man_toc.html"))
                     66:           ("Asir-contrib manual"
                     67:            (w3m-search "doc/asir-contrib/html-ja/cman-ja_toc.html")))
1.3       ohara      68:         (-> "Web"
                     69:           ("The OpenXM Project"  (w3m "http://www.math.kobe-u.ac.jp/OpenXM/")))
                     70:         )))
1.1       ohara      71: )
                     72:
                     73: (plugin-configure openxm
1.6       ohara      74:   (:require (url-exists-in-path? "openxm"))
1.1       ohara      75:   (:initialize (openxm-initialize))
1.4       ohara      76:   (:launch "exec openxm ox_texmacs")
1.5       ohara      77:   (:session "OpenXM[asir,sm1]"))

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>