~ubuntu-branches/ubuntu/saucy/texmacs/saucy

« back to all changes in this revision

Viewing changes to TeXmacs/progs/text/text-menu.scm

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA
  • Date: 2011-04-04 13:58:09 UTC
  • mfrom: (4.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110404135809-6f6jvotefb694vgp
Tags: 1:1.0.7.10-1
* New Upstream Release.
* Added gostscript to Build-Depends.  (Closes: #582228)

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
13
 
14
14
(texmacs-module (text text-menu)
15
 
  (:use (text format-text-edit) (text std-text-edit)))
 
15
  (:use (text format-text-edit)
 
16
        (text std-text-edit)
 
17
        (text tm-structure)))
16
18
 
17
19
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
18
20
;; Document headers
19
21
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20
22
 
21
 
(menu-bind author-menu
22
 
  ("Insert author" (make-doc-data-element 'doc-author-data))
23
 
  ---
24
 
  (when (inside? 'doc-author-data)
25
 
        ("Address" (make-author-data-element 'author-address))
26
 
        ("Email" (make-author-data-element 'author-email))
27
 
        ("Homepage" (make-author-data-element 'author-homepage))
28
 
        ("Note" (make-author-data-element 'author-note))))
29
 
 
30
23
(menu-bind title-menu
31
24
  (when (not (inside? 'doc-data))
32
25
        ("Insert title" (make-doc-data)))
33
 
  ---
34
 
  (when (inside? 'doc-data)
35
 
        ("Subtitle" (make-doc-data-element 'doc-subtitle))
36
 
        (-> "Author" (link author-menu))
37
 
        (-> "Date"
38
 
            ("Default" (make-doc-data-element 'doc-date))
39
 
            ("Today"
40
 
             (begin (make-doc-data-element 'doc-date) (make-arity 'date 0))))
41
 
        (-> "Note"
42
 
            ("General note" (make-doc-data-element 'doc-note))
43
 
            ("Written with TeXmacs" (begin (make-doc-data-element 'doc-note)
44
 
                                           (make 'with-TeXmacs-text))))
45
 
        (-> "Hidden"
46
 
            (if (doc-data-disactivated?)
47
 
                ("Activate hidden" (doc-data-activate-all)))
48
 
            (if (not (doc-data-disactivated?))
49
 
                ("Show hidden" (doc-data-disactivate-all)))
50
 
            ---
51
 
            ("Running title" (make-doc-data-element 'doc-running-title))
52
 
            ("Running author" (make-doc-data-element 'doc-running-author))
53
 
            ("Keywords" (make-doc-data-element 'doc-keywords))
54
 
            ("A.M.S. subject classification"
55
 
             (make-doc-data-element 'doc-AMS-class))))
56
 
  ---
57
26
  (when (and (not (inside? 'doc-data)) (not (inside? 'abstract)))
58
27
        ("Abstract" (make 'abstract))))
59
28
 
99
68
  ("Subparagraph" (make-section 'subparagraph)))
100
69
 
101
70
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
102
 
;; Theorem like environments
 
71
;; Enunciations, quotations and programs
103
72
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
104
73
 
105
 
(menu-bind environment-menu
106
 
  (if (style-has? "header-exam-dtd")
107
 
      ("Exercise" (make 'exercise))
108
 
      ("Problem" (make 'problem)))
109
 
  (if (not (style-has? "header-exam-dtd"))
110
 
      (if (style-has? "env-theorem-dtd")
111
 
          ("Theorem" (make 'theorem))
112
 
          ("Proposition" (make 'proposition))
113
 
          ("Lemma" (make 'lemma))
114
 
          ("Corollary" (make 'corollary))
115
 
          ("Proof" (make 'proof))
116
 
          ("Axiom" (make 'axiom))
117
 
          ("Definition" (make 'definition))
118
 
          ("Notation" (make 'notation))
119
 
          ---
120
 
          ("Remark" (make 'remark))
121
 
          ("Note" (make 'note))
122
 
          ("Example" (make 'example))
123
 
          ("Warning" (make 'warning))
124
 
          ("Exercise" (make 'exercise))
125
 
          ("Problem" (make 'problem))
126
 
          ---)
127
 
      ("Verbatim" (make 'verbatim))
128
 
      ("Code" (make 'code))
129
 
      ("Quote" (make 'quote-env))
130
 
      ("Quotation" (make 'quotation))
131
 
      ("Verse" (make 'verse))))
 
74
(menu-bind enunciation-menu
 
75
  (if (style-has? "env-theorem-dtd")
 
76
      ("Theorem" (make 'theorem))
 
77
      ("Proposition" (make 'proposition))
 
78
      ("Lemma" (make 'lemma))
 
79
      ("Corollary" (make 'corollary))
 
80
      ("Proof" (make 'proof))
 
81
      ---
 
82
      ("Axiom" (make 'axiom))
 
83
      ("Definition" (make 'definition))
 
84
      ("Notation" (make 'notation))
 
85
      ---
 
86
      ("Remark" (make 'remark))
 
87
      ("Note" (make 'note))
 
88
      ("Example" (make 'example))
 
89
      ("Warning" (make 'warning))
 
90
      ---)
 
91
  ("Exercise" (make 'exercise))
 
92
  ("Problem" (make 'problem))
 
93
  ("Solution" (make 'solution))
 
94
  ("Question" (make 'question))
 
95
  ("Answer" (make 'answer)))
 
96
 
 
97
(menu-bind prominent-menu
 
98
  ("Quote" (make 'quote-env))
 
99
  ("Quotation" (make 'quotation))
 
100
  ("Verse" (make 'verse))
 
101
  ---
 
102
  ("Padded" (make 'padded))
 
103
  ("Underlined" (make 'underlined))
 
104
  ("Lines around" (make 'bothlined))
 
105
  ("Framed" (make 'framed))
 
106
  (if (style-has? "ornaments-dtd")
 
107
      ---
 
108
      ("Manila paper" (make 'manila-paper))
 
109
      ("Rough paper" (make 'rough-paper))
 
110
      ("Ridged paper" (make 'ridged-paper))
 
111
      ("Pine" (make 'pine))
 
112
      ("Granite" (make 'granite))
 
113
      ("Metal" (make 'metal))))
 
114
 
 
115
(menu-bind code-menu
 
116
  ("Algorithm" (make 'algorithm))
 
117
  ("Pseudo code" (make 'pseudo-code))
 
118
  ---
 
119
  ("Indent" (make 'indent))
 
120
  ("Tabbed" (make 'tabbed))
 
121
  ---
 
122
  (-> "Inline code"
 
123
      ("C++" (make 'cpp))
 
124
      ("Mathemagix" (make 'mmx))
 
125
      ("Scheme" (make 'scm))
 
126
      ("Shell" (make 'shell))
 
127
      ("Verbatim" (make 'verbatim)))
 
128
  (-> "Block of code"
 
129
      ("C++" (make 'cpp-code))
 
130
      ("Mathemagix" (make 'mmx-code))
 
131
      ("Scheme" (make 'scm-code))
 
132
      ("Shell" (make 'shell-code))
 
133
      ("Verbatim" (make 'verbatim-code))))
132
134
 
133
135
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
134
136
;; Tags
197
199
  ("Dashes" (make-tmlist 'description-dash))
198
200
  ("Long" (make-tmlist 'description-long)))
199
201
 
 
202
(menu-bind list-menu
 
203
  ("Itemize" (make-tmlist 'itemize))
 
204
  ---
 
205
  ("Bullets" (make-tmlist 'itemize-dot))
 
206
  ("Dashes" (make-tmlist 'itemize-minus))
 
207
  ("Arrows" (make-tmlist 'itemize-arrow))
 
208
  ---
 
209
  ("Enumerate" (make-tmlist 'enumerate))
 
210
  ---
 
211
  ("1, 2, 3, ..." (make-tmlist 'enumerate-numeric))
 
212
  ("i, ii, iii, ..." (make-tmlist 'enumerate-roman))
 
213
  ("I, II, III, ..." (make-tmlist 'enumerate-Roman))
 
214
  ("a, b, c, ..." (make-tmlist 'enumerate-alpha))
 
215
  ("A, B, C, ..." (make-tmlist 'enumerate-Alpha))
 
216
  ---
 
217
  ("Description" (make-tmlist 'description))
 
218
  ---
 
219
  ("Compact" (make-tmlist 'description-compact))
 
220
  ("Aligned" (make-tmlist 'description-aligned))
 
221
  ("Dashes" (make-tmlist 'description-dash))
 
222
  ("Long" (make-tmlist 'description-long)))
 
223
 
200
224
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
201
225
;; Automatically generated content
202
226
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
229
253
  (if (and (style-has? "section-base-dtd")
230
254
           (not (style-has? "header-exam-dtd")))
231
255
      (-> "Section" (link section-menu)))
232
 
  (if (style-has? "std-markup-dtd")
233
 
      (-> "Environment" (link environment-menu))
 
256
  (if (or (style-has? "env-theorem-dtd")
 
257
          (style-has? "header-exam-dtd"))
 
258
      (-> "Enunciation" (link enunciation-menu)))
 
259
  (if (style-has? "std-markup-dtd")
 
260
      (-> "Prominent" (link prominent-menu)))
 
261
  (if (style-has? "std-markup-dtd")
 
262
      (-> "Program" (link code-menu)))
 
263
  (if (style-has? "section-base-dtd")
 
264
      (-> "Automatic" (link automatic-menu)))
 
265
  (if (style-has? "std-list-dtd")
 
266
      ---
 
267
      (-> "Itemize" (link itemize-menu))
 
268
      (-> "Enumerate" (link enumerate-menu))
 
269
      (-> "Description" (link description-menu)))
 
270
  ---
 
271
  (if (style-has? "std-markup-dtd")
234
272
      (-> "Content tag" (link content-tag-menu))
235
273
      (-> "Size tag" (link size-tag-menu)))
236
274
  (-> "Presentation tag" (link presentation-tag-menu))
237
 
  (if (style-has? "std-dtd")
238
 
      ---)
239
 
  (if (style-has? "std-list-dtd")
240
 
      (-> "Itemize" (link itemize-menu))
241
 
      (-> "Enumerate" (link enumerate-menu))
242
 
        (-> "Description" (link description-menu))
243
 
        (when (inside-list-tag?) ("New item" (make-item)))
244
 
        ---)
245
 
  (if (style-has? "section-base-dtd")
246
 
      (-> "Automatic" (link automatic-menu))))
 
275
  ---
 
276
  (-> "Mathematics" (link insert-math-menu))
 
277
  (-> "Table" (link insert-table-menu))
 
278
  (-> "Image" (link insert-image-menu))
 
279
  (-> "Link" (link insert-link-menu))
 
280
  (if (detailed-menus?)
 
281
      (if (style-has? "std-fold-dtd")
 
282
          (-> "Fold" (link insert-fold-menu)))
 
283
      (-> "Animation" (link insert-animation-menu)))
 
284
  (if (and (style-has? "session-dtd") (detailed-menus?))
 
285
      (-> "Session" (link insert-session-menu))))
247
286
 
248
287
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
249
288
;; Icons for text mode
250
289
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
251
290
 
252
291
(menu-bind text-icons
253
 
  (if (and (style-has? "header-title-dtd")
254
 
           (not (style-has? "header-letter-dtd"))
255
 
           (not (style-has? "header-exam-dtd")))
256
 
      (=> (balloon (icon "tm_title.xpm") "Enter a title")
257
 
          (link title-menu)))
 
292
  ;;("Goedenmiddag" (display* "Hi there\n"))
 
293
  ;;(input (display* answer "\n") "string" '("Hello" "Bonjour") "0.5w")
258
294
  (if (style-has? "header-letter-dtd")
259
295
      (=> (balloon (icon "tm_title.xpm") "Make a letter environment")
260
296
          (link letter-header-menu)))
268
304
           (not (style-has? "header-exam-dtd")))
269
305
      (=> (balloon (icon "tm_section.xpm") "Start a new section")
270
306
          (link section-menu)))
271
 
  (if (style-has? "std-markup-dtd")
272
 
      (=> (balloon (icon "tm_theorem.xpm") "Insert an environment")
273
 
          (link environment-menu)))
274
 
  (=> (balloon (icon "tm_parstyle.xpm") "Set paragraph mode")
275
 
      ((balloon (icon "tm_left.xpm") "Align text to the left")
276
 
       (make-line-with "par-mode" "left"))
277
 
      ((balloon (icon "tm_center.xpm") "Center text")
278
 
       (make-line-with "par-mode" "center"))
279
 
      ((balloon (icon "tm_right.xpm") "Align text to the right")
280
 
       (make-line-with "par-mode" "right"))
281
 
      ((balloon (icon "tm_justify.xpm") "Justify text")
282
 
       (make-line-with "par-mode" "justify")))
283
 
  (=> (balloon (icon "tm_parindent.xpm") "Set paragraph margins")
284
 
      ("Left margin" (make-interactive-line-with "par-left"))
285
 
      ("Right margin" (make-interactive-line-with "par-right"))
286
 
      ("First indentation" (make-interactive-line-with "par-first")))
287
 
  (if (and (style-has? "env-float-dtd") (detailed-menus?))
288
 
      (if (not (inside? 'float))
289
 
          (=> (balloon (icon "tm_pageins.xpm") "Make a page insertion")
290
 
              (link insert-page-insertion-menu)))
291
 
      (if (inside? 'float)
292
 
          (=> (balloon (icon "tm_floatpos.xpm") "Position floating object")
293
 
              (link position-float-menu))))
294
 
;;((balloon (icon "tm_footnote.xpm") "Insert a footnote") ())
295
 
;;((balloon (icon "tm_margin.xpm") "Insert a marginal note") ())
296
 
;;((balloon (icon "tm_floating.xpm") "Insert a floating object") ())
297
 
;;((balloon (icon "tm_multicol.xpm") "Start multicolumn context") ())
 
307
  (if (or (style-has? "env-theorem-dtd")
 
308
          (style-has? "header-exam-dtd"))
 
309
      (=> (balloon (icon "tm_theorem.xpm") "Insert an enunciation")
 
310
          (link enunciation-menu)))
 
311
  (if (style-has? "std-markup-dtd")
 
312
      (=> (balloon (icon "tm_prominent.xpm") "Insert a prominent piece of text")
 
313
          (link prominent-menu)))
 
314
  (if (style-has? "std-markup-dtd")
 
315
      (=> (balloon (icon "tm_program.xpm") "Insert a computer program")
 
316
          (link code-menu)))
 
317
  (if (style-has? "std-list-dtd")
 
318
      (=> (balloon (icon "tm_list.xpm") "Insert a list")
 
319
          (link list-menu)))
298
320
  (if (style-has? "section-base-dtd")
299
321
      (=> (balloon (icon "tm_index.xpm")
300
322
                   "Insert automatically generated content")
301
323
          (link automatic-menu)))
302
 
  (if (style-has? "std-list-dtd")
303
 
      |
304
 
      (=> (balloon (icon "tm_itemize.xpm") "Itemize")
305
 
          (link itemize-menu))
306
 
      (=> (balloon (icon "tm_enumerate.xpm") "Enumerate")
307
 
          (link enumerate-menu))
308
 
      (=> (balloon (icon "tm_description.xpm") "Description")
309
 
          (link description-menu))
310
 
      (if (inside-list-tag?)
311
 
          ((balloon (icon "tm_item.xpm") "Insert a new item")
312
 
           (make-item)))))
 
324
  (link text-format-icons)
 
325
  (link texmacs-insert-icons))
 
326
 
 
327
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
328
;; Focus menus for entering title information
 
329
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
330
 
 
331
(tm-menu (focus-document-extra-menu t)
 
332
  (:require (document-propose-title?))
 
333
  ("Title" (make-doc-data)))
 
334
 
 
335
(tm-menu (focus-document-extra-icons t)
 
336
  (:require (document-propose-title?))
 
337
  (minibar
 
338
    ((balloon "Title" "Insert title") (make-doc-data))))
 
339
 
 
340
(tm-menu (focus-document-extra-menu t)
 
341
  (:require (document-propose-abstract?))
 
342
  ("Abstract" (make 'abstract)))
 
343
 
 
344
(tm-menu (focus-document-extra-icons t)
 
345
  (:require (document-propose-abstract?))
 
346
  (minibar
 
347
    ((balloon "Abstract" "Insert abstract") (make 'abstract))))
 
348
 
 
349
(tm-define (focus-can-move? t)
 
350
  (:require (doc-title-context? t))
 
351
  #f)
 
352
 
 
353
(tm-menu (focus-title-menu)
 
354
  ("Subtitle" (make-doc-data-element 'doc-subtitle))
 
355
  ("Author" (make-doc-data-element 'doc-author-data))
 
356
  ("Date" (make-doc-data-element 'doc-date))
 
357
  ("Today"
 
358
   (begin (make-doc-data-element 'doc-date) (make-arity 'date 0)))
 
359
  ("Note" (make-doc-data-element 'doc-note))
 
360
  ("TeXmacs notice" (begin (make-doc-data-element 'doc-note)
 
361
                           (make 'with-TeXmacs-text))))
 
362
 
 
363
(tm-menu (focus-title-hidden-menu)
 
364
  ("Running title" (make-doc-data-element 'doc-running-title))
 
365
  ("Running author" (make-doc-data-element 'doc-running-author))
 
366
  ("Keywords" (make-doc-data-element 'doc-keywords))
 
367
  ("M.S.C."
 
368
   (make-doc-data-element 'doc-AMS-class)))
 
369
 
 
370
(tm-menu (focus-title-icons)
 
371
  (assuming (doc-data-has-hidden?)
 
372
    ((check (balloon (icon "tm_show_hidden.xpm") "Show hidden") "v"
 
373
            (doc-data-disactivated?))
 
374
     (doc-data-activate-toggle)))
 
375
  (mini #t
 
376
    (inert ("Title" (noop))))
 
377
  (=> (balloon (icon "tm_add.xpm") "Add title information")
 
378
      (link focus-title-menu)
 
379
      (-> "Hidden" (link focus-title-hidden-menu))))
 
380
 
 
381
(tm-menu (focus-ancestor-menu t)
 
382
  (:require (doc-title-context? t))
 
383
  (group "Title")
 
384
  (link focus-title-menu)
 
385
  ---
 
386
  (group "Hidden")
 
387
  (link focus-title-hidden-menu)
 
388
  ---)
 
389
 
 
390
(tm-menu (focus-ancestor-icons t)
 
391
  (:require (doc-title-context? t))
 
392
  (minibar (dynamic (focus-title-icons)))
 
393
  (glue #f #f 5 0))
 
394
 
 
395
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
396
;; Focus menus for entering authors
 
397
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
398
 
 
399
(tm-define (focus-can-move? t)
 
400
  (:require (doc-author-context? t))
 
401
  #f)
 
402
 
 
403
(tm-menu (focus-author-menu)
 
404
  ("Address" (make-author-data-element 'author-address))
 
405
  ("Email" (make-author-data-element 'author-email))
 
406
  ("Homepage" (make-author-data-element 'author-homepage))
 
407
  ("Note" (make-author-data-element 'author-note)))
 
408
 
 
409
(tm-menu (focus-author-icons)
 
410
  (mini #t
 
411
    (inert ("Author" (noop))))
 
412
  (=> (balloon (icon "tm_add.xpm") "Add author information")
 
413
      (link focus-author-menu)))
 
414
 
 
415
(tm-menu (focus-ancestor-menu t)
 
416
  (:require (doc-author-context? t))
 
417
  (group "Title")
 
418
  (link focus-title-menu)
 
419
  ---
 
420
  (group "Hidden")
 
421
  (link focus-title-hidden-menu)
 
422
  ---
 
423
  (group "Author")
 
424
  (link focus-author-menu)
 
425
  ---)
 
426
 
 
427
(tm-menu (focus-ancestor-icons t)
 
428
  (:require (doc-author-context? t))
 
429
  (minibar (dynamic (focus-title-icons)))
 
430
  (glue #f #f 5 0)
 
431
  (minibar (dynamic (focus-author-icons)))
 
432
  (glue #f #f 5 0))
 
433
 
 
434
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
435
;; Focus menus for sections
 
436
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
437
 
 
438
(tm-menu (focus-section-menu)
 
439
  (for (s (tree-search-sections (buffer-tree)))
 
440
    ((eval (tm/section-get-title-string s))
 
441
     (when (and (tree->path s) (section-context? s))
 
442
       (tree-go-to s 0 :end)))))
 
443
 
 
444
(tm-menu (focus-document-extra-menu t)
 
445
  (:require (previous-section))
 
446
  (-> "Sections" (link focus-section-menu)))
 
447
 
 
448
(tm-menu (focus-document-extra-icons t)
 
449
  (:require (previous-section))
 
450
  (mini #t
 
451
    (=> (eval (tm/section-get-title-string (previous-section)))
 
452
        (link focus-section-menu))))
 
453
 
 
454
(tm-menu (focus-extra-menu t)
 
455
  (:require (section-context? t))
 
456
  ---
 
457
  (-> "Go to section"
 
458
      (link focus-section-menu)))
 
459
 
 
460
(tm-menu (focus-extra-icons t)
 
461
  (:require (section-context? t))
 
462
  (glue #f #f 5 0)
 
463
  (mini #t
 
464
    (=> (eval (tm/section-get-title-string t))
 
465
        (link focus-section-menu))))
 
466
 
 
467
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
468
;; Focus menus for algorithms
 
469
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
470
 
 
471
(tm-define (focus-tag-name l)
 
472
  (:require (in? l (algorithm-tag-list)))
 
473
  (with r (algorithm-root l)
 
474
    (with s (upcase-first (tree-name (tree r)))
 
475
      (string-replace s "-" " "))))
 
476
 
 
477
(tm-menu (focus-toggle-menu t)
 
478
  (:require (algorithm-context? t))
 
479
  (when (not (algorithm-named? (focus-tree)))
 
480
    ((check "Numbered" "v" (algorithm-numbered? (focus-tree)))
 
481
     (algorithm-toggle-number (focus-tree))))
 
482
  ((check "Named" "v" (algorithm-named? (focus-tree)))
 
483
   (algorithm-toggle-name t))
 
484
  ((check "Specified" "v" (algorithm-specified? (focus-tree)))
 
485
   (algorithm-toggle-specification t)))
 
486
 
 
487
(tm-menu (focus-toggle-icons t)
 
488
  (:require (algorithm-context? t))
 
489
  (when (not (algorithm-named? (focus-tree)))
 
490
    ((check (balloon (icon "tm_numbered.xpm") "Toggle numbering") "v"
 
491
            (algorithm-numbered? (focus-tree)))
 
492
     (algorithm-toggle-number (focus-tree))))
 
493
  ((check (balloon (icon "tm_small_textual.xpm") "Toggle name") "v"
 
494
          (algorithm-named? (focus-tree)))
 
495
   (algorithm-toggle-name t))
 
496
  ((check (balloon (icon "tm_specified.xpm") "Toggle specification") "v"
 
497
          (algorithm-specified? (focus-tree)))
 
498
   (algorithm-toggle-specification t)))