From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67514: 30.0.50; completion preview symbol length calculation should use point Date: Tue, 28 Nov 2023 22:46:32 +0100 Message-ID: References: <87y1ehfw8a.fsf@gmail.com> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="621"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67514@debbugs.gnu.org To: =?UTF-8?Q?G=C3=A9za?= Herman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 28 22:47:30 2023 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 1r85vV-000AWH-FS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Nov 2023 22:47:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r85v4-0005im-9u; Tue, 28 Nov 2023 16:47:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r85uw-0005hv-TU for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2023 16:46:55 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r85uw-0003gH-Li for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2023 16:46:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r85v3-0006b1-NM for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2023 16:47:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Nov 2023 21:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67514 X-GNU-PR-Package: emacs Original-Received: via spool by 67514-submit@debbugs.gnu.org id=B67514.170120800625330 (code B ref 67514); Tue, 28 Nov 2023 21:47:01 +0000 Original-Received: (at 67514) by debbugs.gnu.org; 28 Nov 2023 21:46:46 +0000 Original-Received: from localhost ([127.0.0.1]:48384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r85un-0006aU-TZ for submit@debbugs.gnu.org; Tue, 28 Nov 2023 16:46:46 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:38558 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r85um-0006aL-Gk for 67514@debbugs.gnu.org; Tue, 28 Nov 2023 16:46:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1701207995; bh=h+vjMO9DyFOrKXnicGWLYIkKz/gFj3pfYRnTB1rMBbI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ibQNcvhD+70JQltxhhQzIHNPzXLokf5ldl0+W8jKc+WwMx2n1F2Zjgo+aO0+mK58C WeRedU3LlTvnh04Bxvb5768fuMMFAT23oKldF2b49WcL/qV/ZtyGa/ByTpRmfY4xTT iyo2KLEypiqzrzFxAmVOsIxgjPTFvWndXf+gDV6XRJyQ3K2CbNrlDVOR2qdQo49Juy TXqrP9J1kIlmtuJ19NBtflWk1EAxiiYp2OWRmSyn0vDXk4Y/F3nxXnISH5yijgcUmB 3O7N6dGvMIsUCtpHsoxsL2ZjgDF8Zs9RN5nTgT9k0YeysvPnxWDF60Ui7qpsTp6lWl f6VukjjrNZ3yg== In-Reply-To: <87y1ehfw8a.fsf@gmail.com> (Herman@debbugs.gnu.org's message of "Tue, 28 Nov 2023 21:39:49 +0100") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275182 Archived-At: G=C3=A9za Herman writes: > I checked out completion-preview, and so far I like it. Great. > There is a thing which maybe can be improved (so this is not a bug > report, just a suggestion): it's how > completion-preview-require-minimum-symbol-length calculates the > length. Currently it just returns the length of the symbol under the > cursor. I think it would be better to use the length of the part that > actually will be used for completion, because if the point is inside a > word, then it should only consider the part between the symbol start > end the point. Could you please explain why you consider that preferable? The current behavior is intentional and, unless I'm missing something, correct. `completion-at-point-functions` take into account text that follows point as well as the text that precedes point, and Completion Preview mode works also when you're typing in the middle of a symbol. For example, consider the following text in an Elisp buffer: --8<---------------cut here---------------start------------->8--- (minor --8<---------------cut here---------------end--------------->8--- With point between the opening parenthesis and the letter "m", type "define-". The completion preview displays "-mode" just after "minor", suggesting that you complete to "define-minor-mode". That's because the text after point ("minor", in this case) plays a role too. Best, Eshel