Richard Shann:

Does anyone know if there is a guile procedure to get the (text)
selection? (That is from doing Copy in another application)
Richard


Assuming you mean X selection, I've used the "xsel" program to do this:

(define-macro (include filename)
  (define ret "")
  (for-each-line-in-file (string-trim-right (eval-parse filename))
                         (lambda (line)
                           (set! ret (string-append ret line "\n"))))
  ret)

(define-macro (x11-selection)
  (define filename (tmpnam))
  (if (not (= 0 (system (string-append "xsel >" filename))))
      (display "Error. x11-selection requires the \"xsel\" program: 
http://www.vergenet.net/~conrad/software/xsel/";)
      `(include ,filename)))



Reply via email to