From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Matthew Henry Newsgroups: gmane.lisp.guile.bugs Subject: bug#37086: Guile Ice-9 Readline with-readline-completion-function Date: Mon, 19 Aug 2019 13:36:26 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000004f623705907bc88d" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="157717"; mail-complaints-to="usenet@blaine.gmane.org" To: 37086@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Aug 19 20:02:16 2019 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hzlyx-000evv-T8 for guile-bugs@m.gmane.org; Mon, 19 Aug 2019 20:02:16 +0200 Original-Received: from localhost ([::1]:55958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzlyw-00072b-IM for guile-bugs@m.gmane.org; Mon, 19 Aug 2019 14:02:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53600) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzlyo-00072K-NG for bug-guile@gnu.org; Mon, 19 Aug 2019 14:02:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzlym-0000NK-OY for bug-guile@gnu.org; Mon, 19 Aug 2019 14:02:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51682) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzlyl-0000MY-05 for bug-guile@gnu.org; Mon, 19 Aug 2019 14:02:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hzlyk-0005gT-Q8 for bug-guile@gnu.org; Mon, 19 Aug 2019 14:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matthew Henry Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 19 Aug 2019 18:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37086 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156623768821799 (code B ref -1); Mon, 19 Aug 2019 18:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Aug 2019 18:01:28 +0000 Original-Received: from localhost ([127.0.0.1]:60503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzlyC-0005fX-9f for submit@debbugs.gnu.org; Mon, 19 Aug 2019 14:01:28 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:36621) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzlaG-000553-C8 for submit@debbugs.gnu.org; Mon, 19 Aug 2019 13:36:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49215) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzlaF-0008WP-4W for bug-guile@gnu.org; Mon, 19 Aug 2019 13:36:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzlaE-0005Hq-0K for bug-guile@gnu.org; Mon, 19 Aug 2019 13:36:43 -0400 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:38828) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzlaD-0005H8-Pt for bug-guile@gnu.org; Mon, 19 Aug 2019 13:36:41 -0400 Original-Received: by mail-wm1-x334.google.com with SMTP id m125so281664wmm.3 for ; Mon, 19 Aug 2019 10:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=UHtTIvkK9eUO08eBxn0XcxwSOyc40yzsf/0eOicrjc4=; b=LhgpORkSC+v+I3qEPS+7EiBTQ/GxppOTFqJSNxPMf2uoUvkCCj21tK4oauosTJWT5e 9vdKQUnmY23QqG34IBWMkB+P+7e13hh4JYmkF2D4phrZOoplQih1zsLEeKpMkDHv4VA3 JDCW2JUzJUAMQdm6QKQH5BlkhqWGzqh48TAA6uwPOGG7rKwuoFygalxb6vOyX2c8SYlv N3yW0geU02bOwzEU9SfWBBMH9jCc85G5f9Oq4+kpA7Y3EGNOTAOMtUeh5HIMJ1y41EQJ DOfCCLcSL0VCRkzAolssZsqvGC2ba7p2ba8J3GcF+ZamnqXXTn7PlvDbolQdV5ioHKkN 1Awg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=UHtTIvkK9eUO08eBxn0XcxwSOyc40yzsf/0eOicrjc4=; b=Ba5TwBgz36qFv+gArmS34Mf4E87WkNYay0L/XkjFi04XW2M5riJHsRQvfkXvsET9Od JLWEzbTovvvp1YZU88DhrueJtAqgoIbccUgBqJQzBI6ihSSa+asjllh1MORvPm71XLYK tzd1c6sbLFY0dlP/jQloZKQWLx130hPZX+unQm3wD4badEqdqn56FgEJhWEk2k1WAqFQ XQLXggnkUafbVqd7GRKZF18F8jrO7QRWFy9ldm6HmiYSgfSmGnkOwKZfqceX/AEAp22M tT5cTsBASsamQ8VwzAUwX2VnW7Jg6WIM45j//4T9PrwiZmxwsU+oadYP1qpx7GHB0MW8 pPBQ== X-Gm-Message-State: APjAAAVpOlAaEeSgCOwpldM963nJwy/8k8LxVnOLNbcP8vN2ytRk1Om+ kVaMjfmL5FWYkihbyu3Ai8sBAY4ba4nbUCTwmVxV+4EK X-Google-Smtp-Source: APXvYqxv1UAYj9Lc1pIst2sECvH7fxY9frFo/XaVB33rNjfljyke/0PqB6aQTmo8XarCZfPrXrc9toVBto1uG0kEAMM= X-Received: by 2002:a7b:c091:: with SMTP id r17mr20275184wmh.74.1566236199566; Mon, 19 Aug 2019 10:36:39 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Mon, 19 Aug 2019 14:01:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9418 Archived-At: --0000000000004f623705907bc88d Content-Type: text/plain; charset="UTF-8" Seen in: guile (GNU Guile) 2.2.4 When using the with-readline-completion-function, the passed readline uses the default (apropos) completion function instead of the one provided to with-readline-completion-function. I believe that this is because root/guile-readline/ice-9/readline.scm has defined with-readline-completion-function as a function instead of as a macro. The readline provided in thunk is executed before the body of with-readline-completion-function executes and overrides *readline-completion-function*. As an aside, I think the API would be better if the completion function could be provided to readline directly. Attached is a sample program. Below is sample output of a run of the attached program. You can see that it's autocompleting Guile functions and variables (the default apropos completion) rather than the provided one which should have had only 3 options with just one starting in "th". ;;;;;;;;;;;;;;;;;;;;;;;;;;; Prompt: Display all 1859 possibilities? (y or n) Prompt: th the-eof-object the-scm-module thread-exited? thunk? the-root-module thread? throw Prompt: th --0000000000004f623705907bc88d Content-Type: application/octet-stream; name="readline-completion-bug.scm" Content-Disposition: attachment; filename="readline-completion-bug.scm" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jzio0fke0 KHVzZS1tb2R1bGVzIChpY2UtOSByZWFkbGluZSkpCgood2l0aC1yZWFkbGluZS1jb21wbGV0aW9u LWZ1bmN0aW9uCiAobWFrZS1jb21wbGV0aW9uLWZ1bmN0aW9uICcoIm9uZSIgInR3byIgInRocmVl IikpCiAocmVhZGxpbmUgIlByb21wdDogIikpCg== --0000000000004f623705907bc88d--