39 lines
1.0 KiB
Scheme
39 lines
1.0 KiB
Scheme
(define (display-to-string val)
|
|
(let ((exp-port (open-output-string)))
|
|
(display val exp-port)
|
|
(get-output-string exp-port)))
|
|
|
|
;;expression as string
|
|
(define (write-to-string val)
|
|
(let ((exp-port (open-output-string)))
|
|
(write val exp-port)
|
|
(get-output-string exp-port)))
|
|
|
|
(define (on/off-option-processor name)
|
|
(lambda (option arg-name arg 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))))))
|
|
|
|
(define *redisplay-everything* #t)
|
|
|
|
(define (set-redisplay-everything)
|
|
(set! *redisplay-everything* #t))
|
|
|
|
(define (unset-redisplay-everything)
|
|
(set! *redisplay-everything* #f))
|
|
|
|
(define (redisplay-everything?)
|
|
*redisplay-everything*)
|
|
|
|
(define (identity-function x) x) |