From: Paul Emsley <paul.emsley@bioch.ox.ac.uk>
To: guile-user@gnu.org
Subject: Re: X11 bindings and shell bindings
Date: Thu, 18 Sep 2008 18:16:09 +0100 [thread overview]
Message-ID: <48D28CD9.5070707@bioch.ox.ac.uk> (raw)
In-Reply-To: <59ea12330809180538u6f7d7a42gdfef60909ad96157@mail.gmail.com>
Ishan Arora wrote:
> Hi,
>
> Is there a procedure to get mouse position.
I guess there may be a way via X11, but it is not clear to me. What you
might want to be doing is knowing the coordinates of a click in a
canvas, which is not the same thing (and easier).
> And is there a procedure to synchronously run a shell code and return
> the output as a String. Thanks.
;; code from thi <ttn at mingle.glug.org>
;;
;; run command and put the output into a string and return
;; it. (c.f. @code{run-command/strings})
(define (shell-command-to-string cmd)
(with-output-to-string
(lambda ()
(let ((in-port (open-input-pipe cmd)))
(let loop ((line (read-line in-port 'concat)))
(or (eof-object? line)
(begin
(display line)
(loop (read-line in-port 'concat)))))))))
Paul.
next prev parent reply other threads:[~2008-09-18 17:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-18 12:38 X11 bindings and shell bindings Ishan Arora
2008-09-18 13:52 ` Jon Wilson
2008-09-18 15:10 ` Ishan Arora
2008-09-18 17:01 ` JonWilson
2008-09-18 17:16 ` Paul Emsley [this message]
2008-09-18 18:43 ` Andy Wingo
2008-09-18 19:37 ` Linas Vepstas
2008-09-18 21:09 ` Andy Wingo
-- strict thread matches above, loose matches on Subject: below --
2008-09-18 16:08 dsmich
2008-09-18 16:58 ` Neil Jerram
[not found] <cmu-lmtpd-23352-1221754132-4@mail-imap1.uio.no>
2008-09-18 16:54 ` Kjetil S. Matheussen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48D28CD9.5070707@bioch.ox.ac.uk \
--to=paul.emsley@bioch.ox.ac.uk \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).