From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#39600: [PATCH] Fix handling of non-exclusive non-prefix completion functions Date: Sat, 08 Aug 2020 17:58:39 -0400 Message-ID: References: <874kpdz12d.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22065"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 39600@debbugs.gnu.org, Amai Kinono To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 08 23:59:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k4Wrt-0005Yf-Rt for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Aug 2020 23:59:10 +0200 Original-Received: from localhost ([::1]:33872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4Wrs-00068n-8u for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Aug 2020 17:59:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4Wrm-00068X-6M for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2020 17:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48146) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k4Wrl-0002k1-RL for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2020 17:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k4Wrl-0008BO-R3 for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2020 17:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Aug 2020 21:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39600 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 39600-submit@debbugs.gnu.org id=B39600.159692393731438 (code B ref 39600); Sat, 08 Aug 2020 21:59:01 +0000 Original-Received: (at 39600) by debbugs.gnu.org; 8 Aug 2020 21:58:57 +0000 Original-Received: from localhost ([127.0.0.1]:59690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4Wrh-0008B0-9w for submit@debbugs.gnu.org; Sat, 08 Aug 2020 17:58:57 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4Wrf-0008Am-Hp for 39600@debbugs.gnu.org; Sat, 08 Aug 2020 17:58:55 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 75DFE100ED1; Sat, 8 Aug 2020 17:58:49 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8CC8E100312; Sat, 8 Aug 2020 17:58:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1596923927; bh=F73rhbIJpjMZ7sC7tVza+LqH4aV99k+lJdf3SAwiKg4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=WFz1QtxJ335dUXOF80UHdv9QWqAVy/0JFojLWYetJgzS1tZA5JfcaoyQF9ozDIIuR ePu7QYNzZTrqspmnoiy5g5HMGd0uXex4smNNGFYlRCnvalHtcSf4uHeAC483gWOBQN S8RzZfbAxE2FmoqtnyvI/YbZGuJJOxEqGjw1Sa+TEdlNKo838Un+S8g7mUKmkDgTTy sqbckLrZkvcRlT/CI5JyydIFesa2LAKQXZPL5h7B10Dgq2V+1JQCrSzxUWmhwaaTTj GcnDeNmTxY3TJT77Z8s5oZNWqhKilYzl87pZnG2oE2Mva4ok5UNp/HTDOwow395Xvd nFYB/GxWZ/H1w== Original-Received: from milanesa (unknown [45.72.246.108]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 47DE012029D; Sat, 8 Aug 2020 17:58:47 -0400 (EDT) In-Reply-To: <874kpdz12d.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 08 Aug 2020 16:04:10 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:184372 Archived-At: >> Currently, with non-exclusive completion functions, Emacs will do >> `try-completion` on the current text, and decide whether to try next >> completion function based on that. This makes completion functions that >> can do non-prefix completions fails when the current text only occurs in >> the middle of the candidates. This is a problem I found in a FIXME in >> the code. >> >> # How does this work? >> >> I use `completion-all-completions` instead. As far as I know, this >> respects the `completion-styles`. > [...] > Stefan, how does this patch look to you? I think it replaces one set of problems with another. Within the completion-at-point-function we shouldn't call anything like `try-completion`: we should only decide which completion table to use but we shouldn't look inside those completion tables. So a better solution is to build a new completion table which combines (e.g. with `completion-table-in-turn`) the current one with that of "the rest". [ The tricky (but still doable) case being when when the current completion table and that of the rest don't use the same BEG and END. ] Stefan