2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4 ;; MODULE : preferences-menu.scm
5 ;; DESCRIPTION : the preferences menus
6 ;; COPYRIGHT : (C) 1999 Joris van der Hoeven
8 ;; This software falls under the GNU general public license version 3 or later.
9 ;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
10 ;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
12 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14 (texmacs-module (texmacs menus preferences-menu)
16 (utils edit auto-close)
17 (texmacs texmacs tm-server)
18 (texmacs texmacs tm-view)
19 (texmacs texmacs tm-print)
20 (texmacs keyboard config-kbd)
21 (convert latex init-latex)))
23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
24 ;; The Preferences menus
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27 (tm-define page-setup-tree
28 '((enum ("Preview command" "preview command")
29 "default" "ggv" "ghostview" "gv" "kghostview"
31 (enum ("Printing command" "printing command")
34 (enum ("Paper type" "paper type")
35 "A3" "A4" "A5" "B4" "B5" "B6"
36 "Letter" "Legal" "Executive"
38 (enum ("Printer dpi" "printer dpi")
39 "150" "200" "300" "400" "600" "800" "1200"
41 (enum ("Font type" "font type")
42 ("Metafont bitmaps only" "Metafont only")
43 ("Metafont and available type 1" "Metafont + Type 1")
44 ("Type 1 with metafont fallback" "Type 1 + Metafont")
45 ("Type 1 only" "Type 1 only"))))
47 (tm-define preferences-tree
48 `((enum ("Look and feel" "look and feel")
52 ; (enum ("Profile" "profile")
53 ; ("Beginner" "beginner")
55 ; ("Advanced" "advanced"))
56 (enum ("Interactive questions" "interactive questions")
57 ("On the footer" "footer")
58 ("In popup windows" "popup"))
59 (enum ("Details in menus" "detailed menus")
60 ("Simplified menus" "simple")
61 ("Detailed menus" "detailed"))
63 (toggle ("Header" "header"))
64 (toggle ("Main icon bar" "main icon bar"))
65 (toggle ("Context dependent icons" "context dependent icons"))
66 (toggle ("User provided icons" "user provided icons"))
67 (toggle ("Status bar" "status bar"))
68 (enum ("Shrinking factor" "shrinking factor")
69 "1" "2" "3" "4" "5" "7" "10" *))
71 (enum ("Language" "language")
73 ("Bulgarian" "bulgarian")
82 ("Hungarian" "hungarian")
84 ("Japanese" "japanese")
87 ("Portuguese" "portuguese")
88 ("Romanian" "romanian")
93 ("Taiwanese" "taiwanese")
94 ("Ukrainian" "ukrainian"))
96 (enum ("A modifier" "A")
98 ("Equivalent for#Mod1" "Mod1")
99 ("Equivalent for#Mod2" "Mod2")
100 ("Equivalent for#Mod3" "Mod3")
101 ("Equivalent for#Mod4" "Mod4")
102 ("Equivalent for#Mod5" "Mod5"))
103 (enum ("M modifier" "M")
104 ("Default" "default")
105 ("Equivalent for#Mod1" "Mod1")
106 ("Equivalent for#Mod2" "Mod2")
107 ("Equivalent for#Mod3" "Mod3")
108 ("Equivalent for#Mod4" "Mod4")
109 ("Equivalent for#Mod5" "Mod5"))
110 (enum ("H modifier" "H")
111 ("Default" "default")
112 ("Equivalent for#Mod1" "Mod1")
113 ("Equivalent for#Mod2" "Mod2")
114 ("Equivalent for#Mod3" "Mod3")
115 ("Equivalent for#Mod4" "Mod4")
116 ("Equivalent for#Mod5" "Mod5"))
118 (enum ("Alt key" "alt")
119 ("Do not remap" "default")
120 ("Map to#A modifier" "A")
121 ("Map to#M modifier" "M")
122 ("Map to#H modifier" "H"))
123 (enum ("Meta key" "meta")
124 ("Do not remap" "default")
125 ("Map to#A modifier" "A")
126 ("Map to#M modifier" "M")
127 ("Map to#H modifier" "H"))
128 (enum ("Windows key" "windows")
129 ("Do not remap" "default")
130 ("Map to#A modifier" "A")
131 ("Map to#M modifier" "M")
132 ("Map to#H modifier" "H"))
133 (enum ("Caps-lock key" "caps-lock")
134 ("Do not remap" "default")
135 ("Map to#A modifier" "A")
136 ("Map to#M modifier" "M")
137 ("Map to#H modifier" "H"))
139 (enum ("Cyrillic input method" "cyrillic input method")
140 ("Translit" "translit")
142 ("Yawerty" "yawerty")
145 (enum ("Automatic quotes" "automatic quotes")
146 ("Default" "default")
149 ("English" "english")
152 ("Spanish" "spanish")
154 (toggle ("Automatically close brackets"
155 "automatically close brackets")))
156 (-> "Printer" . ,page-setup-tree)
157 (enum ("Security" "security")
158 ("Accept no scripts" "accept no scripts")
159 ("Prompt on scripts" "prompt on scripts")
160 ("Accept all scripts" "accept all scripts"))
162 (-> "TeXmacs -> Html"
163 ; (toggle ("Use CSS" "texmacs->html:css"))
164 (toggle ("Use MathML" "texmacs->html:mathml"))
165 (toggle ("Export formulas as images" "texmacs->html:images")))
166 (-> "TeXmacs -> LaTeX"
167 (toggle ("Replace unrecognized styles"
168 "texmacs->latex:replace-style"))
169 (toggle ("Expand unrecognized macros"
170 "texmacs->latex:expand-macros"))
171 (toggle ("Expand user-defined macros"
172 "texmacs->latex:expand-user-macros"))
173 (toggle ("Export bibliographies as links"
174 "texmacs->latex:indirect-bib"))
175 (toggle ("Use catcode definitions in preamble"
176 "texmacs->latex:use-catcodes"))
177 (toggle ("Allow for macro definitions in preamble"
178 "texmacs->latex:use-macros")))
179 (-> "TeXmacs -> Verbatim"
180 (toggle ("Wrap lines"
181 "texmacs->verbatim:wrap"))
182 (enum ("Encoding" "texmacs->verbatim:encoding")
183 ("Iso-8859-1" "iso-8859-1")
185 (-> "Verbatim -> TeXmacs"
186 (toggle ("Wrap lines"
187 "verbatim->texmacs:wrap"))
188 (enum ("Encoding" "verbatim->texmacs:encoding")
189 ("Iso-8859-1" "iso-8859-1")
192 ("None" (set-preference "scripting language" "none"))
194 (link scripts-preferences-menu))
196 (toggle ("Debugging tool" "debugging tool"))
197 (toggle ("Linking tool" "linking tool"))
198 (toggle ("Versioning tool" "versioning tool"))
199 (toggle ("Remote connections" "remote connections")))
201 (enum ("Autosave" "autosave")
207 (enum ("Bibtex command" "bibtex command")
208 "bibtex" "rubibtex" *)))
210 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
211 ;; Computation of the preference menu
212 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
214 (define (id-or-car x)
215 (if (string? x) x (car x)))
217 (define (id-or-cadr x)
218 (if (string? x) x (cadr x)))
220 (define (compute-preferences-entry s)
221 `(interactive (lambda (val) (set-preference ,s val))
224 (define (compute-preferences-enum s l)
227 (list '--- (list "Other" (compute-preferences-entry s))))
228 (else (cons (list (id-or-car (car l))
229 `(set-preference ,s ,(id-or-cadr (car l))))
230 (compute-preferences-enum s (cdr l))))))
232 (define (compute-preferences-menu-sub l)
233 (cond ((or (nlist? l) (null? l)) l)
234 ((== (car l) 'string)
238 (list s (compute-preferences-entry v))))
243 (cons* '-> s (compute-preferences-enum v (cddr l)))))
244 ((== (car l) 'toggle)
248 (list s (list 'toggle-preference v))))
249 (else (map-in-order compute-preferences-menu-sub l))))
251 (tm-define (compute-preferences-menu l)
252 (eval `(menu-dynamic ,@(compute-preferences-menu-sub l))))
254 (menu-bind page-setup-menu ,@(compute-preferences-menu page-setup-tree))
255 (menu-bind preferences-menu ,@(compute-preferences-menu preferences-tree))