File: plugin-write.it.tm

package info (click to toggle)
texmacs 1%3A2.1.4%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 145,076 kB
  • sloc: cpp: 227,393; lisp: 197,386; ansic: 5,395; python: 1,939; makefile: 1,065; sh: 781; perl: 339; xml: 100; awk: 36
file content (148 lines) | stat: -rw-r--r-- 4,918 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<TeXmacs|1.0.1.18>

<style|tmdoc>

<\body>
  <expand|tmdoc-title|Scrivere un proprio plugin>

  Per scrivere un proprio plugin, ad esempio <verbatim|<em|mioplugin>>, si
  inizia creando la directory

  <\verbatim>
    \ \ \ \ $TEXMACS_HOME_PATH/plugins/<em|mioplugin>
  </verbatim>

  in cui sistemare tutti i file (si ricorda che <verbatim|$TEXMACS_HOME_PATH>
  per default  <verbatim|$HOME/.TeXmacs>). Opzionalmente  possibile creare
  le seguenti sottodirectory:

  <\expand|description-dash>
    <expand|item*|<verbatim|bin>>per file binari

    <expand|item*|<verbatim|doc>>per la documentazione (non ancora
    supportata).

    <expand|item*|<verbatim|langs>>per il supporto linguistico, come ad
    esempio il dizionario (non ancora supportata).

    <expand|item*|<verbatim|lib>>per le librerie

    <expand|item*|<verbatim|packages>>per i pacchetti di stile

    <expand|item*|<verbatim|progs>>per i programmi in <value|scheme>

    <expand|item*|<verbatim|src>>per i file sorgente

    <expand|item*|<verbatim|styles>>per i file di stile
  </expand>

  L'idea  che i file presenti in queste sottodirectory vengano
  automaticamente riconosciuti all'avvio di <TeXmacs>. Ad esempio se 
  prevista una sottodirectory <verbatim|bin> allora la stringa

  <\verbatim>
    \ \ \ \ $TEXMACS_HOME_PATH/plugins/<em|mioplugin>/bin
  </verbatim>

  verr automaticamente aggiunta, all'avvio, alla variabile ambientale
  <verbatim|PATH>. Osserviamo come la struttura della sottodirectory di un
  plugin sia molto simile alla struttura della sottodirectory di
  <verbatim|$TEXMACS_PATH>.

  <\example>
    Il tipo pi semplice di plugin consiste solo di file di dati, ossia di
    una collezione di file di stile e di pacchetti. Per creare un plugin di
    questo genere  sufficiente creare le sottodirectory:

    <\verbatim>
      \ \ \ \ $TEXMACS_HOME_PATH/plugins/<em|mioplugin>

      \ \ \ \ $TEXMACS_HOME_PATH/plugins/<em|mioplugin>/styles

      \ \ \ \ $TEXMACS_HOME_PATH/plugins/<em|mioplugin>/packages
    </verbatim>

    e sistemare i file di stile e i pacchetti nelle ultime due
    sottodirectory. Dopo aver rilanciato <TeXmacs> i file di stile e i
    pacchetti appariranno automaticamente nei menu
    <apply|menu|Document|Style> e <apply|menu|Document|Use package>.
  </example>

  Per plugin pi complessi, che richiedono l'aggiunta di parti di codice in
  <value|scheme> o in <name|C++>,  necessario scrivere un file di
  configurazione in <value|scheme>

  <\verbatim>
    \ \ \ \ $TEXMACS_HOME_PATH/plugins/<em|mioplugin>/progs/init-<em|mioplugin>.scm
  </verbatim>

  che dovrebbe contenere istruzioni del tipo

  <\expand|scheme-fragment>
    (plugin-configure <em|myplugin>

    \ \ <em|configuration-options>
  </expand>

  dove le opzioni <verbatim|<em|configuration-options>> descrivono le
  principali azioni da eseguire all'inizio, incluso il controllo del
  funzionamento del plugin stesso. Nella sezione seguente descriveremo alcuni
  semplici plugin e la loro configurazione. Molti altri esempi sono contenuti
  nella directory

  <\verbatim>
    \ \ \ \ $TEXMACS_PATH/examples/plugins
  </verbatim>

  Alcuni di questi verranno comunque descritti in dettaglio nel capitolo
  relativo alla stesura di nuove interfacce.

  <apply|tmdoc-copyright|1998--2003|Joris van der Hoeven, Andrea Centomo>

  <expand|tmdoc-license|Permission is granted to copy, distribute and/or
  modify this document under the terms of the GNU Free Documentation License,
  Version 1.1 or any later version published by the Free Software Foundation;
  with no Invariant Sections, with no Front-Cover Texts, and with no
  Back-Cover Texts. A copy of the license is included in the section entitled
  "GNU Free Documentation License".>
</body>

<\initial>
  <\collection>
    <associate|paragraph width|150mm>
    <associate|odd page margin|30mm>
    <associate|shrinking factor|4>
    <associate|page right margin|30mm>
    <associate|page top margin|30mm>
    <associate|reduction page right margin|25mm>
    <associate|page type|a4>
    <associate|reduction page bottom margin|15mm>
    <associate|even page margin|30mm>
    <associate|reduction page left margin|25mm>
    <associate|page bottom margin|30mm>
    <associate|reduction page top margin|15mm>
    <associate|language|italian>
  </collection>
</initial>

<\references>
  <\collection>
    <associate|idx-1|<tuple|1|?>>
    <associate|toc-1|<tuple|<uninit>|?>>
    <associate|idx-2|<tuple|1|?>>
    <associate|toc-2|<tuple|<uninit>|?>>
    <associate|idx-3|<tuple|1|?>>
  </collection>
</references>

<\auxiliary>
  <\collection>
    <\associate|idx>
      <tuple|<tuple|<with|font family|<quote|ss>|Documento>|<with|font
      family|<quote|ss>|Stile>>|<pageref|idx-1>>

      <tuple|<tuple|<with|font family|<quote|ss>|Documento>|<with|font
      family|<quote|ss>|Usa pacchetto>>|<pageref|idx-2>>
    </associate>
  </collection>
</auxiliary>