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

« back to all changes in this revision

Viewing changes to TeXmacs/progs/dynamic/fold-edit.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:
17
17
        (dynamic dynamic-drd)))
18
18
 
19
19
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20
 
;; Abstract stuff for fold tags and switches
 
20
;; Dynamic movements for fold tags and switches
21
21
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22
22
 
23
23
(tm-define (dynamic-context? t)
24
24
  (or (toggle-tag? (tree-label t))
25
25
      (switch-tag? (tree-label t))))
26
26
 
27
 
(tm-define (dynamic-first) (noop))
28
 
(tm-define (dynamic-previous) (noop))
29
 
(tm-define (dynamic-next) (noop))
30
 
(tm-define (dynamic-last) (noop))
31
 
 
32
 
(tm-define (structured-left)
33
 
  (:context dynamic-context?)
34
 
  (dynamic-previous))
35
 
 
36
 
(tm-define (structured-right)
37
 
  (:context dynamic-context?)
38
 
  (dynamic-next))
39
 
 
40
 
(tm-define (structured-up)
41
 
  (:context dynamic-context?)
42
 
  (dynamic-previous))
43
 
 
44
 
(tm-define (structured-down)
45
 
  (:context dynamic-context?)
46
 
  (dynamic-next))
47
 
 
48
 
(tm-define (structured-first)
49
 
  (:context dynamic-context?)
50
 
  (dynamic-first))
51
 
 
52
 
(tm-define (structured-last)
53
 
  (:context dynamic-context?)
54
 
  (dynamic-last))
55
 
 
56
 
(tm-define (structured-top)
57
 
  (:context dynamic-context?)
58
 
  (dynamic-first))
59
 
 
60
 
(tm-define (structured-bottom)
61
 
  (:context dynamic-context?)
62
 
  (dynamic-last))
63
 
 
64
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
65
 
;; Operations on toggle trees
66
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
67
 
 
68
 
(tm-define (toggle-toggle t)
69
 
  (:synopsis "Toggle a fold/unfold")
70
 
  (tree-assign-node! t (ahash-ref toggle-table (tree-label t))))
 
27
(tm-define (dynamic-extremal t forwards?)
 
28
  (and-with p (tree-outer t)
 
29
    (dynamic-extremal p forwards?)))
 
30
 
 
31
(tm-define (dynamic-incremental t forwards?)
 
32
  (and-with p (tree-outer t)
 
33
    (dynamic-incremental p forwards?)))
 
34
 
 
35
(tm-define (dynamic-first)
 
36
  (dynamic-extremal (focus-tree) #f))
 
37
(tm-define (dynamic-last)
 
38
  (dynamic-extremal (focus-tree) #t))
 
39
(tm-define (dynamic-previous)
 
40
  (dynamic-incremental (focus-tree) #f))
 
41
(tm-define (dynamic-next)
 
42
  (dynamic-incremental (focus-tree) #t))
 
43
 
 
44
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
45
;; Abstract stuff for fold tags and switches
 
46
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
47
 
 
48
(tm-define (structured-horizontal t forwards?)
 
49
  (:require (dynamic-context? t))
 
50
  (dynamic-incremental t forwards?))
 
51
 
 
52
(tm-define (structured-vertical t downwards?)
 
53
  (:require (dynamic-context? t))
 
54
  (dynamic-incremental t downwards?))
 
55
 
 
56
(tm-define (structured-extremal t forwards?)
 
57
  (:require (dynamic-context? t))
 
58
  (dynamic-extremal t forwards?))
 
59
 
 
60
(tm-define (structured-incremental t downwards?)
 
61
  (:require (dynamic-context? t))
 
62
  (dynamic-extremal t downwards?))
71
63
 
72
64
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
73
65
;; Folding
82
74
(tm-define (toggle-second-context? t)
83
75
  (toggle-second-tag? (tree-label t)))
84
76
 
 
77
(tm-define (fold-context? t)
 
78
  (or (folded-tag? (tree-label t)) (unfolded-tag? (tree-label t))))
 
79
 
85
80
(tm-define (make-toggle tag)
86
81
  (:type (-> void))
87
82
  (:synopsis "Insert a 'fold' environment")
88
83
  (insert-go-to `(,tag (document "") (document "")) (list 0 0)))
89
84
 
90
 
(tm-define (fold)
91
 
  (:type (-> void))
92
 
  (:synopsis "Fold at the current cursor position")
93
 
  (noop))
94
 
 
95
 
(tm-define (fold)
96
 
  (:context toggle-second-context?)
97
 
  (with-innermost t toggle-second-context?
98
 
    (toggle-toggle t)
99
 
    (tree-go-to t 0 :start)))
100
 
 
101
 
(tm-define (unfold)
102
 
  (:type (-> void))
103
 
  (:synopsis "Unfold at the current cursor position")
104
 
  (noop))
105
 
 
106
 
(tm-define (unfold)
107
 
  (:context toggle-first-context?)
108
 
  (with-innermost t toggle-first-context?
109
 
    (toggle-toggle t)
110
 
    (tree-go-to t 1 :start)))
111
 
 
112
 
(tm-define (mouse-fold)
113
 
  (:type (-> void))
114
 
  (:synopsis "Fold using the mouse")
115
 
  (:secure #t)
116
 
  (with-action t
117
 
    (tree-go-to t :start)
118
 
    (fold)))
119
 
 
120
 
(tm-define (mouse-unfold)
121
 
  (:type (-> void))
122
 
  (:synopsis "Unfold using the mouse")
123
 
  (:secure #t)
124
 
  (with-action t
125
 
    (tree-go-to t :start)
126
 
    (unfold)))
127
 
 
128
 
(tm-define (hidden-variant)
129
 
  (:context toggle-first-context?)
130
 
  (unfold))
131
 
 
132
 
(tm-define (hidden-variant)
133
 
  (:context toggle-second-context?)
134
 
  (fold))
135
 
 
136
 
(tm-define (dynamic-first)
137
 
  (:context toggle-context?)
138
 
  (fold))
139
 
 
140
 
(tm-define (dynamic-previous)
141
 
  (:context toggle-context?)
142
 
  (fold))
143
 
 
144
 
(tm-define (dynamic-next)
145
 
  (:context toggle-context?)
146
 
  (unfold))
147
 
 
148
 
(tm-define (dynamic-last)
149
 
  (:context toggle-context?)
150
 
  (unfold))
 
85
(tm-define (alternate-toggle t)
 
86
  (:require (toggle-context? t))
 
87
  (with i (if (toggle-first-context? t) 1 0)
 
88
    (variant-set t (ahash-ref alternate-table (tree-label t)))
 
89
    (tree-go-to t i :start)))
 
90
 
 
91
(tm-define (dynamic-extremal t forwards?)
 
92
  (:require (toggle-context? t))
 
93
  (with action (if forwards? alternate-unfold alternate-fold)
 
94
    (action t)))
 
95
 
 
96
(tm-define (dynamic-incremental t forwards?)
 
97
  (:require (toggle-context? t))
 
98
  (with action (if forwards? alternate-unfold alternate-fold)
 
99
    (action t)))
151
100
 
152
101
(tm-define (tree-show-hidden t)
153
102
  (:require (toggle-context? t))
154
 
  (toggle-toggle t))
 
103
  (alternate-toggle t))
155
104
 
156
105
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
157
106
;; Operations on switch trees
183
132
    v))
184
133
 
185
134
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
186
 
;; Routines on innermost switch
 
135
;; Basic routines on switches
187
136
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
188
137
 
189
138
(tm-define (switch-context? t)
190
139
  (switch-tag? (tree-label t)))
191
140
 
192
 
(tm-define (switch-arity)
193
 
  (with t (tree-innermost switch-context?)
194
 
    (and t (tree-arity t))))
195
 
 
196
 
(tm-define (switch-valid-child? i)
197
 
  (with t (tree-innermost switch-context?)
198
 
    (and t i (>= i 0) (< i (tree-arity t)))))
199
 
 
200
 
(tm-define (switch-index . args)
201
 
  (:context switch-context?)
202
 
  (and-let* ((i (if (null? args) :current (car args)))
203
 
             (t (tree-innermost switch-context?))
204
 
             (c (tree-down-index t))
205
 
             (l (- (tree-arity t) 1))
206
 
             (v (switch-last-visible t)))
207
 
    (cond ((< v 0) #f)
208
 
          ((== i :visible) v)
209
 
          ((== i :current) c)
210
 
          ((== i :previous) (max 0 (- c 1)))
211
 
          ((== i :next) (min l (+ c 1)))
212
 
          ((== i :var-previous) (- c 1))
213
 
          ((== i :var-next) (+ c 1))
214
 
          ((== i :rotate-backward) (if (= c 0) l (- c 1)))
215
 
          ((== i :rotate-forward) (if (= c l) 0 (+ c 1)))
216
 
          ((== i :first) 0)
217
 
          ((== i :last) l)
218
 
          (else i))))
219
 
 
220
 
(tm-define (switch-to i . args)
221
 
  (set! i (switch-index i))
 
141
(tm-define (switch-valid-child? t i)
 
142
  (and t i (>= i 0) (< i (tree-arity t))))
 
143
 
 
144
(tm-define (switch-index t . args)
 
145
  (when (switch-context? t)
 
146
    (and-let* ((i (if (null? args) :current (car args)))
 
147
               (c (tree-down-index t))
 
148
               (l (- (tree-arity t) 1))
 
149
               (v (switch-last-visible t)))
 
150
      (cond ((< v 0) #f)
 
151
            ((== i :visible) v)
 
152
            ((== i :current) c)
 
153
            ((== i :previous) (max 0 (- c 1)))
 
154
            ((== i :next) (min l (+ c 1)))
 
155
            ((== i :var-previous) (- c 1))
 
156
            ((== i :var-next) (+ c 1))
 
157
            ((== i :rotate-backward) (if (= c 0) l (- c 1)))
 
158
            ((== i :rotate-forward) (if (= c l) 0 (+ c 1)))
 
159
            ((== i :first) 0)
 
160
            ((== i :last) l)
 
161
            (else i)))))
 
162
 
 
163
(tm-define (switch-to t i . args)
 
164
  (set! i (switch-index t i))
222
165
  (if (null? args) (set! args '(:start)))
223
 
  (when (switch-valid-child? i)
224
 
    (switch-select i)
225
 
    (with-innermost t switch-context?
226
 
      (apply tree-go-to (cons* t i 0 args)))))
227
 
 
228
 
(tm-define (switch-insert-at i)
229
 
  (set! i (if (== i :end) (switch-arity) (switch-index i)))
230
 
  (with-innermost t switch-context?
231
 
    (when (and (>= i 0) (<= i (tree-arity t)))
232
 
      (let* ((empty (if (tree-in? t (big-switch-tag-list)) '(document "") ""))
233
 
             (v (switch-index :visible)))
234
 
        (tree-insert! t i `((shown ,empty)))
235
 
        (if (tree-in? t (alternative-tag-list))
236
 
            (switch-select i)
237
 
            (switch-select (+ v 1)))
238
 
        (tree-go-to t i :start)))))
239
 
 
240
 
(tm-define (switch-remove-at i)
241
 
  (set! i (switch-index i))
242
 
  (with-innermost t switch-context?
243
 
    (when (and (>= i 0) (< i (tree-arity t)) (> (tree-arity t) 1))
244
 
      (let* ((v (switch-index :visible))
245
 
             (l (- (tree-arity t) 2)))
246
 
        (switch-set-range t (max 0 (- i 1)) (min l (+ i 1)) #t)
247
 
        (tree-remove! t i 1)
248
 
        (tree-go-to t (min i l) :start)
249
 
        (if (tree-in? t (alternative-tag-list))
250
 
            (switch-select (min i l))
251
 
            (switch-select (max 0 (- v 1))))))))
 
166
  (when (switch-valid-child? t i)
 
167
    (switch-select t i)
 
168
    (apply tree-go-to (cons* t i 0 args))))
 
169
 
 
170
(tm-define (switch-insert-at t i)
 
171
  (set! i (if (== i :end) (tree-arity t) (switch-index t i)))
 
172
  (when (and (>= i 0) (<= i (tree-arity t)))
 
173
    (let* ((empty (if (tree-in? t (big-switch-tag-list)) '(document "") ""))
 
174
           (v (switch-index t :visible)))
 
175
      (tree-insert! t i `((shown ,empty)))
 
176
      (if (tree-in? t (alternative-tag-list))
 
177
          (switch-select t i)
 
178
          (switch-select t (+ v 1)))
 
179
      (tree-go-to t i :start))))
 
180
 
 
181
(tm-define (switch-remove-at t i)
 
182
  (set! i (switch-index t i))
 
183
  (when (and (>= i 0) (< i (tree-arity t)) (> (tree-arity t) 1))
 
184
    (let* ((v (switch-index t :visible))
 
185
           (l (- (tree-arity t) 2)))
 
186
      (switch-set-range t (max 0 (- i 1)) (min l (+ i 1)) #t)
 
187
      (tree-remove! t i 1)
 
188
      (tree-go-to t (min i l) :start)
 
189
      (if (tree-in? t (alternative-tag-list))
 
190
          (switch-select t (min i l))
 
191
          (switch-select t (max 0 (- v 1)))))))
252
192
 
253
193
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
254
194
;; Specific types of switches
257
197
(define (alternative-context? t)
258
198
  (alternative-tag? (tree-label t)))
259
199
 
260
 
(tm-define (tree/switch-select t i)
 
200
(tm-define (switch-select t i)
261
201
  (:require (alternative-context? t))
262
202
  (switch-set-range t 0 :last #f)
263
203
  (switch-set t i #t))
265
205
(define (unroll-context? t)
266
206
  (unroll-tag? (tree-label t)))
267
207
 
268
 
(tm-define (tree/switch-select t i)
 
208
(tm-define (switch-select t i)
269
209
  (:require (unroll-context? t))
270
210
  (switch-set-range t 0 (+ i 1) #t)
271
211
  (switch-set-range t (+ i 1) :last #f))
273
213
(define (expanded-context? t)
274
214
  (expanded-tag? (tree-label t)))
275
215
 
276
 
(tm-define (tree/switch-select t i)
 
216
(tm-define (switch-select t i)
277
217
  (:require (expanded-context? t))
278
218
  (switch-set-range t 0 :last #t))
279
219
 
280
 
(tm-define (switch-select i)
281
 
  (with-innermost t switch-context?
282
 
    (tree/switch-select t i)))
283
 
 
284
220
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
285
221
;; User interface to switches
286
222
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
290
226
      (insert-go-to `(,tag (shown (document ""))) '(0 0 0 0))
291
227
      (insert-go-to `(,tag (shown "")) '(0 0 0))))
292
228
 
293
 
(tm-define (dynamic-first)
294
 
  (:context switch-context?)
295
 
  (switch-to :first :start))
296
 
 
297
 
(tm-define (dynamic-previous)
298
 
  (:context switch-context?)
299
 
  (switch-to :previous :end))
300
 
 
301
 
(tm-define (dynamic-next)
302
 
  (:context switch-context?)
303
 
  (switch-to :next :start))
304
 
 
305
 
(tm-define (dynamic-last)
306
 
  (:context switch-context?)
307
 
  (switch-to :last :end))
308
 
 
309
 
(tm-define (structured-insert forwards?)
310
 
  (:context switch-context?)
311
 
  (switch-insert-at (if forwards? :var-next :current)))
312
 
 
313
 
(tm-define (structured-insert-up)
314
 
  (:context switch-context?)
315
 
  (switch-insert-at :current))
316
 
 
317
 
(tm-define (structured-insert-down)
318
 
  (:context switch-context?)
319
 
  (switch-insert-at :var-next))
320
 
 
321
 
(tm-define (structured-remove forwards?)
322
 
  (:context switch-context?)
323
 
  (with-innermost t switch-context?
324
 
    (with i (if forwards? :current :var-previous)
325
 
      (set! i (switch-index i))
326
 
      (cond ((< i 0) (tree-go-to t :start))
327
 
            ((and forwards? (= i (- (tree-arity t) 1))) (tree-go-to t :end))
328
 
            (else (switch-remove-at i))))))
329
 
 
330
 
(tm-define (hidden-variant)
331
 
  (:context switch-context?)
332
 
  (switch-to :rotate-forward))
333
 
 
334
 
(tm-define (variant-circulate forward?)
335
 
  (:context switch-context?)
336
 
  (with-innermost t switch-context?
337
 
    (let* ((old (tree-label t))
338
 
           (val (big-switch-tag-list))
339
 
           (rot (list-search-rotate val old))
340
 
           (new (if (and forward? (nnull? rot)) (cadr rot) (cAr rot)))
341
 
           (i (switch-index)))
342
 
      (variant-replace old new)
343
 
      (switch-select i))))
 
229
(tm-define (dynamic-extremal t forwards?)
 
230
  (:require (switch-context? t))
 
231
  (if forwards?
 
232
      (switch-to t :last :end)
 
233
      (switch-to t :first :start)))
 
234
 
 
235
(tm-define (dynamic-incremental t forwards?)
 
236
  (:require (switch-context? t))
 
237
  (if forwards?
 
238
      (switch-to t :next :start)
 
239
      (switch-to t :previous :end)))
 
240
 
 
241
(tm-define (structured-insert-horizontal t forwards?)
 
242
  (:require (switch-context? t))
 
243
  (switch-insert-at t (if forwards? :var-next :current)))
 
244
 
 
245
(tm-define (structured-insert-vertical t downwards?)
 
246
  (:require (switch-context? t))
 
247
  (structured-insert-horizontal t downwards?))
 
248
 
 
249
(tm-define (structured-remove-horizontal t forwards?)
 
250
  (:require (switch-context? t))
 
251
  (with i (if forwards? :current :var-previous)
 
252
    (set! i (switch-index t i))
 
253
    (cond ((< i 0) (tree-go-to t :start))
 
254
          ((and forwards? (= i (- (tree-arity t) 1))) (tree-go-to t :end))
 
255
          (else (switch-remove-at t i)))))
 
256
 
 
257
(tm-define (structured-remove-vertical t downwards?)
 
258
  (:require (switch-context? t))
 
259
  (structured-remove-horizontal t downwards?))
 
260
 
 
261
(tm-define (alternate-toggle t)
 
262
  (:require (switch-context? t))
 
263
  (switch-to t :rotate-forward))
 
264
 
 
265
(tm-define (variant-circulate t forward?)
 
266
  (:require (switch-context? t))
 
267
  (with i (switch-index t)
 
268
    (variant-circulate-in t (big-switch-tag-list) forward?)
 
269
    (switch-select t i)))
344
270
 
345
271
(tm-define (tree-show-hidden t)
346
272
  (:require (switch-context? t))
347
273
  (with i (tree-down-index t)
348
274
    (if (tree-is? (tree-ref t i) 'hidden)
349
 
        (tree/switch-select t i))))
 
275
        (switch-select t i))))
350
276
 
351
277
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
352
278
;; Analyzing the environments occurring in folds
422
348
         (cond ((== mode :var-last)
423
349
                (tree-insert-node! t 0 '(traversed)))
424
350
               ((in? mode '(:unfold :expand :var-expand :last))
425
 
                (toggle-toggle t))
 
351
                (alternate-toggle t))
426
352
               ((and (pair? mode) (== (car mode) :unfold)
427
353
                     (fold-matching-env? t (cadr mode)))
428
 
                (toggle-toggle t))))
 
354
                (alternate-toggle t))))
429
355
        ((toggle-second-context? t)
430
356
         (cond ((== mode :var-last)
431
 
                (toggle-toggle t)
 
357
                (alternate-toggle t)
432
358
                (tree-insert-node! t 0 '(traversed)))
433
359
               ((in? mode '(:fold :compress :var-compress :first))
434
 
                (toggle-toggle t))
 
360
                (alternate-toggle t))
435
361
               ((and (pair? mode) (== (car mode) :fold)
436
362
                     (fold-matching-env? t (cadr mode)))
437
 
                (toggle-toggle t))))
 
363
                (alternate-toggle t))))
438
364
        ((and (== mode :expand) (switch-context? t))
439
365
         (switch-set-range t 0 :last #t))
440
366
        ((and (== mode :compress) (switch-context? t))
519
445
 
520
446
(define (dynamic-traverse-folded t mode)
521
447
  (cond ((in? mode '(:next :var-next))
522
 
         (toggle-toggle t)
 
448
         (alternate-toggle t)
523
449
         (dynamic-operate (tree-ref t 1) :first)
524
450
         (tree-go-to t 1 :end)
525
451
         #t)
527
453
 
528
454
(define (dynamic-traverse-unfolded t mode)
529
455
  (cond ((== mode :var-next)
530
 
         (toggle-toggle t)
 
456
         (alternate-toggle t)
531
457
         (tree-insert-node! t 0 '(traversed))
532
458
         #t)
533
459
        ((in? mode '(:previous :var-previous))
534
460
         (with last-mode (if (== mode :previous) :last :var-last)
535
 
           (toggle-toggle t)
 
461
           (alternate-toggle t)
536
462
           (dynamic-operate (tree-ref t 0) last-mode)
537
463
           (tree-go-to t 0 :end)
538
464
           #t))
546
472
        ((and (in? mode '(:next :var-next)) (< i l))
547
473
         (dynamic-operate (tree-ref t (1+ i)) :first)
548
474
         (tree-go-to t i :end)
549
 
         (switch-to :next)
 
475
         (switch-to t :next)
550
476
         #t)
551
477
        ((and (in? mode '(:previous :var-previous)) (> i 0))
552
478
         (with last-mode (if (== mode :previous) :last :var-last)
553
479
           (dynamic-operate (tree-ref t (- i 1)) last-mode)
554
480
           (tree-go-to t i :start)
555
 
           (switch-to :previous)
 
481
           (switch-to t :previous)
556
482
           #t))
557
483
        (else #f)))
558
484
 
602
528
 
603
529
(tm-define (dynamic-traverse-buffer mode)
604
530
  (dynamic-traverse (buffer-tree) mode))
 
531
 
 
532
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
533
;; Specific navigation for 'screens' switch
 
534
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
535
 
 
536
(tm-define (screens-switch-to which)
 
537
  (and-with t (tree-innermost 'screens)
 
538
    (switch-to t which :start)))