From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: `isearch-complete1' should use `completion-at-point' or `completion-in-region' Date: Mon, 13 Jan 2020 14:38:12 -0500 Message-ID: References: <7da1738e-1e8a-3c12-31bf-741ee171db5c@Alexander.Shukaev.name> <8736ckl015.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="190186"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Alexander Shukaev , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 13 20:40:28 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.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 1ir5Y5-000bQh-AB for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Jan 2020 20:38:53 +0100 Original-Received: from localhost ([::1]:54956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ir5Y4-00031j-5k for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Jan 2020 14:38:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39597) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ir5XY-0002bC-5M for emacs-devel@gnu.org; Mon, 13 Jan 2020 14:38:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ir5XW-0000tK-Gg for emacs-devel@gnu.org; Mon, 13 Jan 2020 14:38:19 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19264) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ir5XW-0000rv-Cs for emacs-devel@gnu.org; Mon, 13 Jan 2020 14:38:18 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 41A97102856; Mon, 13 Jan 2020 14:38:17 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5982D100A09; Mon, 13 Jan 2020 14:38:15 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1578944295; bh=qjOq49oopGACW+1ZNlQTehA6lclwUcCM5e/Y/g4/eMU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=OVp0DgWOWnCcUxK2hAD4eyHmDo6GTFTyHSB/3jRRe8as+6FqcisKHk/oKxU/1Ca1x bf0zw5YGDM/dQlpzU2lu6mMq/VFJbw52CbZh5fhqrtD+NaucZk7CwpV/fCyYU9AggV j+/v4+8oy1H5o8UEYMXgsWDlY8ML7anIIAl8RFvlioI5xNfHvoC0stYoc/aJ3SCMba vKnBLasigdK1LpDiv640g9CnMTmrJRhzdGnnbdHw7VjNwKsW7HjPrEI/dGB4ppBCfz FC5uoDWokArchO5Viaii3rmwxWMx09sQ7gEOX2WE39eN+vh4ODizoo01YvQKFi5x6N rjOfTsU/kRmpg== Original-Received: from alfajor (modemcable157.163-203-24.mc.videotron.ca [24.203.163.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3049B12076C; Mon, 13 Jan 2020 14:38:15 -0500 (EST) In-Reply-To: <8736ckl015.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 13 Jan 2020 01:36:54 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:244237 Archived-At: > But there is one thing I don't understand: how packages prefer to hook > into auto-completion? Is it enough to convert `isearch-complete1' to > just `completing-read' in the minibuffer activated by `isearch-edit-string'? First, there are 2 different cases: `isearch-complete-edit` and `isearch-complete`. For `isearch-complete-edit` we could indeed use `completing-read`, but I don't think I like this idea (e.g. I think it'd be odd for Icomplete to kick in when in `isearch-edit`). So I think the better solution is to set `completion-at-point-functions` and then turn `isearch-complete-edit` into an alias for `completion-at-point`. For `isearch-complete`, it's a bit more tricky because it's a form of completion that is performed on a text that's kept inside a string rather than inside a buffer, so I think we'll still need some ad-hoc code, but it could better use our completion framework. Stefan