Better interface for pasting
part of darcs patch Thu Sep 22 00:43:18 EEST 2005 Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
This commit is contained in:
parent
c40ea7f252
commit
af369b2d3a
|
@ -0,0 +1,9 @@
|
||||||
|
(define maybe-modal-window #f)
|
||||||
|
|
||||||
|
(define (set-modal-window! reader)
|
||||||
|
(if maybe-modal-window
|
||||||
|
(error "tried to set a second modal window"))
|
||||||
|
(set! maybe-modal-window reader))
|
||||||
|
|
||||||
|
(define (close-modal-window!)
|
||||||
|
(set! maybe-modal-window #f))
|
|
@ -11,11 +11,14 @@
|
||||||
(define-interface utils-interface
|
(define-interface utils-interface
|
||||||
(export display-to-string
|
(export display-to-string
|
||||||
write-to-string
|
write-to-string
|
||||||
on/off-option-processor))
|
on/off-option-processor
|
||||||
|
paste-selection))
|
||||||
|
|
||||||
(define-structure utils utils-interface
|
(define-structure utils utils-interface
|
||||||
(open scheme
|
(open scheme
|
||||||
srfi-6)
|
srfi-6
|
||||||
|
(subset srfi-13 (string-join))
|
||||||
|
formats)
|
||||||
(files utils))
|
(files utils))
|
||||||
|
|
||||||
;;; history data structure
|
;;; history data structure
|
||||||
|
@ -242,7 +245,8 @@
|
||||||
|
|
||||||
(define-structure network-viewer (export)
|
(define-structure network-viewer (export)
|
||||||
(open scheme-with-scsh
|
(open scheme-with-scsh
|
||||||
|
(subset srfi-13 (string-join))
|
||||||
|
|
||||||
plugin
|
plugin
|
||||||
select-line)
|
select-line)
|
||||||
(files network-viewer))
|
(files network-viewer))
|
||||||
|
@ -342,6 +346,7 @@
|
||||||
paint-selection-list-at
|
paint-selection-list-at
|
||||||
select-list-get-selection
|
select-list-get-selection
|
||||||
select-list-get-marked
|
select-list-get-marked
|
||||||
|
select-list-has-marks?
|
||||||
select-list-selected-entry
|
select-list-selected-entry
|
||||||
|
|
||||||
select-list-key?
|
select-list-key?
|
||||||
|
|
|
@ -154,6 +154,14 @@
|
||||||
(filter element-marked?
|
(filter element-marked?
|
||||||
(select-list-elements select-list))))
|
(select-list-elements select-list))))
|
||||||
|
|
||||||
|
(define (select-list-has-marks? select-list)
|
||||||
|
(let lp ((elts (select-list-elements select-list)))
|
||||||
|
(if (null? elts)
|
||||||
|
#f
|
||||||
|
(if (element-marked? (car elts))
|
||||||
|
#t
|
||||||
|
(lp (cdr elts))))))
|
||||||
|
|
||||||
(define (select-list-selected-entry select-list)
|
(define (select-list-selected-entry select-list)
|
||||||
(element-value
|
(element-value
|
||||||
(select-list-selected-element select-list)))
|
(select-list-selected-element select-list)))
|
||||||
|
|
|
@ -13,3 +13,14 @@
|
||||||
(lambda (option arg-name arg ops)
|
(lambda (option arg-name arg ops)
|
||||||
(cons (cons name #t) ops)))
|
(cons (cons name #t) ops)))
|
||||||
|
|
||||||
|
|
||||||
|
(define (paste-selection vals marks? for-scheme-mode? to-scheme to-command)
|
||||||
|
(if marks?
|
||||||
|
(if for-scheme-mode?
|
||||||
|
(format #f "'(~a)" (string-join (map to-scheme vals)))
|
||||||
|
(string-join (map to-command vals)))
|
||||||
|
(if (null? vals)
|
||||||
|
""
|
||||||
|
(if for-scheme-mode?
|
||||||
|
(to-scheme (car vals))
|
||||||
|
(to-command (car vals))))))
|
Loading…
Reference in New Issue