unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Matthew Henry <mcthenry@gmail.com>
To: 37086@debbugs.gnu.org
Subject: bug#37086: Guile Ice-9 Readline with-readline-completion-function
Date: Mon, 19 Aug 2019 20:12:27 -0400	[thread overview]
Message-ID: <CAFZHh1qrZ6pEh3CA0Wm21MQKmj1JxXmgNVAv03vONncBVw6P0g@mail.gmail.com> (raw)
In-Reply-To: <CAFZHh1qSRxn6nVj4E0KAUFU2aXaAHdZ86cpv9EBgvqnSGrW0rQ@mail.gmail.com>

I'm early in my Scheme journey, but here's a suggested fix:

(define-syntax-rule (with-readline-completion-function completer expr ...)
  "With @var{completer} as readline completion function, call @var{expr ...}."
  (let ((old-completer *readline-completion-function*))
    (dynamic-wind
      (lambda ()
    (set! *readline-completion-function* completer))
      (lambda () expr ...)
      (lambda ()
    (set! *readline-completion-function* old-completer)))))

(export with-readline-completion-function)





  reply	other threads:[~2019-08-20  0:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 17:36 bug#37086: Guile Ice-9 Readline with-readline-completion-function Matthew Henry
2019-08-20  0:12 ` Matthew Henry [this message]
2019-08-20  3:00 ` Mark H Weaver
2019-08-20 11:35   ` Matthew Henry

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=CAFZHh1qrZ6pEh3CA0Wm21MQKmj1JxXmgNVAv03vONncBVw6P0g@mail.gmail.com \
    --to=mcthenry@gmail.com \
    --cc=37086@debbugs.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).