From unknown Wed Jun 18 23:18:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#54374 <54374@debbugs.gnu.org> To: bug#54374 <54374@debbugs.gnu.org> Subject: Status: 29.0.50; previous-completion fails at beginning of completions buffer Reply-To: bug#54374 <54374@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:18:38 +0000 retitle 54374 29.0.50; previous-completion fails at beginning of completion= s buffer reassign 54374 emacs submitter 54374 Juri Linkov severity 54374 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 13 14:13:41 2022 Received: (at submit) by debbugs.gnu.org; 13 Mar 2022 18:13:41 +0000 Received: from localhost ([127.0.0.1]:43257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTSir-00065v-3e for submit@debbugs.gnu.org; Sun, 13 Mar 2022 14:13:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:59942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTSip-00065n-43 for submit@debbugs.gnu.org; Sun, 13 Mar 2022 14:13:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTSio-0007cx-Tl for bug-gnu-emacs@gnu.org; Sun, 13 Mar 2022 14:13:38 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:48041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTSil-0001FB-6g for bug-gnu-emacs@gnu.org; Sun, 13 Mar 2022 14:13:37 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id CD3BCC0003 for ; Sun, 13 Mar 2022 18:13:30 +0000 (UTC) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: 29.0.50; previous-completion fails at beginning of completions buffer Organization: LINKOV.NET Date: Sun, 13 Mar 2022 19:39:13 +0200 Message-ID: <86h782b3zk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.198; envelope-from=juri@linkov.net; helo=relay6-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) X-Debbugs-Cc: Philip Kaludercic This is not reproducible in Emacs 28, so looks like a recent regression: 0. emacs -Q 1. M-x TAB 2. move point to the beginning of the *Completions* buffer 3. type S-TAB () Debugger entered--Lisp error: (args-out-of-range 0 0) get-text-property(0 mouse-face) next-completion(-1) previous-completion(1) funcall-interactively(previous-completion 1) command-execute(previous-completion) completing-read-default("M-x " ...) read-extended-command() command-execute(execute-extended-command) From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 13 16:40:04 2022 Received: (at 54374) by debbugs.gnu.org; 13 Mar 2022 20:40:04 +0000 Received: from localhost ([127.0.0.1]:43438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTV0V-0003od-V1 for submit@debbugs.gnu.org; Sun, 13 Mar 2022 16:40:04 -0400 Received: from mout01.posteo.de ([185.67.36.65]:36407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTV0U-0003o1-8x for 54374@debbugs.gnu.org; Sun, 13 Mar 2022 16:40:03 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 1FC40240028 for <54374@debbugs.gnu.org>; Sun, 13 Mar 2022 21:39:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647203995; bh=dKvxDYUGO3mDvALQFq0TuWqeDAlu3aPJxeWGGRc7Uqc=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=G9Dj9iNXeDPSXJzRDVmO1pK6PSH1nnBthvM53nlOIfQe3q4pvjdAcG2NBLmzCI8Ov U/srtDAC4+BNaWUl/oTLEPeyW3YhgoUVL+AoaYGEye1dHuWXmGsEGFCVvGMM0x6Aaw 2z/f1kFjoG4jKsld8zGtfAD86WiBjk+fJKU+UXuUPT7hj/fxvODYp+HoAXA8ezre0b XV/0bkqgs5lrlWv2NLUyDknwmBc3Oa95WYu7Yng15hirX3igpEJmJgb/onEPylHQDa 72aCZvVEln2xOOpmqNj5K7Mvm93u5eebbvn6GluBmUwDE2HYRXoSZvXyIQJYcnkqmB UJ5RAKii9EeaQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KGs3t32Z6z6tn8; Sun, 13 Mar 2022 21:39:54 +0100 (CET) From: Philip Kaludercic To: Juri Linkov Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer References: <86h782b3zk.fsf@mail.linkov.net> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Sun, 13 Mar 2022 20:39:53 +0000 In-Reply-To: <86h782b3zk.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 13 Mar 2022 19:39:13 +0200") Message-ID: <871qz5k2na.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Juri Linkov writes: > X-Debbugs-Cc: Philip Kaludercic > > This is not reproducible in Emacs 28, so looks like a recent regression: This seems to fix it: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/simple.el b/lisp/simple.el index accc119e2b..7d47aba1ee 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9125,7 +9125,7 @@ next-completion (unless (get-text-property (point) 'mouse-face) (goto-char (next-single-property-change (point) 'mouse-face nil end))) (setq n (1- n))) - (while (< n 0) + (while (and (< n 0) (< 1 (point))) (let ((prop (get-text-property (1- (point)) 'mouse-face))) ;; If in a completion, move to the start of it. (when (and prop (eq prop (get-text-property (point) 'mouse-face))) --=-=-= Content-Type: text/plain > 0. emacs -Q > 1. M-x TAB > 2. move point to the beginning of the *Completions* buffer > 3. type S-TAB () > > Debugger entered--Lisp error: (args-out-of-range 0 0) > get-text-property(0 mouse-face) > next-completion(-1) > previous-completion(1) > funcall-interactively(previous-completion 1) > command-execute(previous-completion) > completing-read-default("M-x " ...) > read-extended-command() > command-execute(execute-extended-command) > > -- Philip Kaludercic --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 13 23:23:14 2022 Received: (at 54374) by debbugs.gnu.org; 14 Mar 2022 03:23:14 +0000 Received: from localhost ([127.0.0.1]:43693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTbIf-0007Uf-TO for submit@debbugs.gnu.org; Sun, 13 Mar 2022 23:23:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTbIe-0007UQ-Rt for 54374@debbugs.gnu.org; Sun, 13 Mar 2022 23:23:13 -0400 Received: from [2001:470:142:3::e] (port=39190 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTbIZ-0001eO-6p; Sun, 13 Mar 2022 23:23:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=p21XegAHtHR/Nv9wuhEsXKC1nGq3FuP1ZPQDHmZxjuQ=; b=ob31LKODmYMx WM87Q8p3ZebxYUzj3m9Ajbj8Q1oGU1Wbcxb4gWyGPZ0j4MjBJtsL7rJREJcnIpxtc9D8a/0ODwqvk cWKq3d71joAaLM5MhQ5cph+3wOki5tcXWk+1JhewnzBJCJSlJrBiZ+XzIImznif87uaivoQUlXaFE za7D6r+uOEt38wHsslLk0gMeg2QlHKKCYPIq6ITdU9Nlo2FFwN1k0DuvSvPdz4Z76jToThA+ISlbD ELBePutkXbMepV2YEdDmVgB+ffxL7e8MoYoOMjh4fq9cycbRoNkyAVNGtFjCUOCsYPREJqHuYmkSU S7vvMrVM/PTTrrn1YwPFww==; Received: from [87.69.77.57] (port=1375 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTbIY-0003hm-Gt; Sun, 13 Mar 2022 23:23:06 -0400 Date: Mon, 14 Mar 2022 05:22:53 +0200 Message-Id: <83bky9kyk2.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <871qz5k2na.fsf@posteo.net> (message from Philip Kaludercic on Sun, 13 Mar 2022 20:39:53 +0000) Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Date: Sun, 13 Mar 2022 20:39:53 +0000 > Cc: 54374@debbugs.gnu.org > > - (while (< n 0) > + (while (and (< n 0) (< 1 (point))) Please always use point-min, never a literal 1. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 04:20:40 2022 Received: (at 54374) by debbugs.gnu.org; 14 Mar 2022 08:20:40 +0000 Received: from localhost ([127.0.0.1]:43998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTfwW-0006j6-1N for submit@debbugs.gnu.org; Mon, 14 Mar 2022 04:20:40 -0400 Received: from mout01.posteo.de ([185.67.36.65]:46099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTfwU-0006it-8m for 54374@debbugs.gnu.org; Mon, 14 Mar 2022 04:20:38 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5596B24002B for <54374@debbugs.gnu.org>; Mon, 14 Mar 2022 09:20:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647246032; bh=mcDh5Ths4uGodBQV1riBJA69Y6ckgRXmfwuJJmVdgHw=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=Iba2DdEhfrn1wXmyJkH3lTRb0lMFr5FdpNlIthRwalTXov66HTW+OTW3pOraWVjht gCe5KNBALPWuU4RsV78dTtNyQ9fiNd31JDF1+EXrirb18Xt1EGaeoeKAY59WLOUeYj S9U4AKOEw3XEkGPglZ8rK71BJi4b1MAiPZbgj2jmIKMbM6bSH3MiiDdZOM+UgM/1J5 hwVcpWFsteC/jcySq/aK1rwqPJqZnE2gTdlwXGQLMVDiCM0Dbk3qJvP8PXDZAqUbeT 4R6oK5hi5VjA/mQcNPvC2/OiYZjL+yoJeTP9VMRGrYwTN0e2iqnpxgjuD7W/zlNDrb lL1hap3aI6ikA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KH8cH06kqz6tmj; Mon, 14 Mar 2022 09:20:30 +0100 (CET) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <83bky9kyk2.fsf@gnu.org> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Mon, 14 Mar 2022 08:20:29 +0000 In-Reply-To: <83bky9kyk2.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 14 Mar 2022 05:22:53 +0200") Message-ID: <87wngx9c8i.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> From: Philip Kaludercic >> Date: Sun, 13 Mar 2022 20:39:53 +0000 >> Cc: 54374@debbugs.gnu.org >> >> - (while (< n 0) >> + (while (and (< n 0) (< 1 (point))) > > Please always use point-min, never a literal 1. Can do, but does it make a difference in this case? The only reason the comparison is made is so that (1- (point)) doesn't return an invalid point value. > Thanks. -- Philip Kaludercic From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 04:35:34 2022 Received: (at 54374) by debbugs.gnu.org; 14 Mar 2022 08:35:34 +0000 Received: from localhost ([127.0.0.1]:44015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTgAw-00077s-J1 for submit@debbugs.gnu.org; Mon, 14 Mar 2022 04:35:34 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:55741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTgAu-00077j-AE for 54374@debbugs.gnu.org; Mon, 14 Mar 2022 04:35:33 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4KH8xZ68sSz1s76G; Mon, 14 Mar 2022 09:35:30 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4KH8xZ3l8Gz1qyQ5; Mon, 14 Mar 2022 09:35:30 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id cmKPBVUoo_l8; Mon, 14 Mar 2022 09:35:29 +0100 (CET) X-Auth-Info: hHN3p8sBps0oA4us7UGnmqZZzouQg+bi0ibE5VA1wVz+NCEk9FlBEWynTIsnFNTp Received: from igel.home (ppp-46-244-164-179.dynamic.mnet-online.de [46.244.164.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 14 Mar 2022 09:35:29 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id 2E7592C29CC; Mon, 14 Mar 2022 09:35:29 +0100 (CET) From: Andreas Schwab To: Eli Zaretskii Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <83bky9kyk2.fsf@gnu.org> X-Yow: I smell like a wet reducing clinic on Columbus Day! Date: Mon, 14 Mar 2022 09:35:29 +0100 In-Reply-To: <83bky9kyk2.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 14 Mar 2022 05:22:53 +0200") Message-ID: <87wngxlyni.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org, Philip Kaludercic , juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) On Mär 14 2022, Eli Zaretskii wrote: >> From: Philip Kaludercic >> Date: Sun, 13 Mar 2022 20:39:53 +0000 >> Cc: 54374@debbugs.gnu.org >> >> - (while (< n 0) >> + (while (and (< n 0) (< 1 (point))) > > Please always use point-min, never a literal 1. But it should be written as (not (bobp)). -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 04:47:36 2022 Received: (at 54374) by debbugs.gnu.org; 14 Mar 2022 08:47:37 +0000 Received: from localhost ([127.0.0.1]:44020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTgMa-0007Q3-N5 for submit@debbugs.gnu.org; Mon, 14 Mar 2022 04:47:36 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:41925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTgMY-0007PA-Tp for 54374@debbugs.gnu.org; Mon, 14 Mar 2022 04:47:35 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id D6C442000F; Mon, 14 Mar 2022 08:47:27 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer Organization: LINKOV.NET References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> Date: Mon, 14 Mar 2022 10:30:56 +0200 In-Reply-To: <871qz5k2na.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 13 Mar 2022 20:39:53 +0000") Message-ID: <86bky99c7r.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > This seems to fix it: > > diff --git a/lisp/simple.el b/lisp/simple.el > index accc119e2b..7d47aba1ee 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -9125,7 +9125,7 @@ next-completion > (unless (get-text-property (point) 'mouse-face) > (goto-char (next-single-property-change (point) 'mouse-face nil end))) > (setq n (1- n))) > - (while (< n 0) > + (while (and (< n 0) (< 1 (point))) > (let ((prop (get-text-property (1- (point)) 'mouse-face))) > ;; If in a completion, move to the start of it. > (when (and prop (eq prop (get-text-property (point) 'mouse-face))) Thanks, I confirm that it doesn't fail. However, there is some strange behaviour: when point is at the beginning of the completion buffer, then previous-completion switches to the minibuffer. But if point is at the first completion, then previous-completion wraps to the last completion. Shouldn't point at the beginning of the buffer wrap to the last completion as well? From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 08:59:36 2022 Received: (at 54374) by debbugs.gnu.org; 14 Mar 2022 12:59:36 +0000 Received: from localhost ([127.0.0.1]:44325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTkIS-000061-0W for submit@debbugs.gnu.org; Mon, 14 Mar 2022 08:59:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTkIQ-00005m-7w for 54374@debbugs.gnu.org; Mon, 14 Mar 2022 08:59:34 -0400 Received: from [2001:470:142:3::e] (port=46968 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTkIK-0002cH-1d; Mon, 14 Mar 2022 08:59:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1NlxD+GrEM0KONhemsk9w8+GPsoq8ri+t1cTZyIpOFM=; b=Iv8ZncC4vRZg P8PcOZfC4hcKrgc/Wd8IBMUIwl1BXXPLd1tPCdNP0xLZezimrYpRBbptFzWw0kyIEQnDg+5mF1lHp R2K62xm6I8xtUn1s7ju+5rIxvUnJe7BG8G90GsVNVKfDH+pY8vtUMBr3s/Ol/oeUh9p8cEfNCsgvi Yw0+h1inUIUuirADq9ZW378phxzS4xsplld0ZuOAHQMHvHfeZrlMn0PNnNsbw6FTrYh73VReVAWvG 29iNopXv2VILHtBu2+4X9DB2dhbmjr87kNQV9x0paP85Yb8ks5mz+ozo+uPB3bD75x3Nz8atTKjoh daKgzG0EPdoT12w40Csggw==; Received: from [87.69.77.57] (port=4703 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTkII-00014i-Pj; Mon, 14 Mar 2022 08:59:27 -0400 Date: Mon, 14 Mar 2022 14:59:14 +0200 Message-Id: <83wngwk7vh.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87wngx9c8i.fsf@posteo.net> (message from Philip Kaludercic on Mon, 14 Mar 2022 08:20:29 +0000) Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <83bky9kyk2.fsf@gnu.org> <87wngx9c8i.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: juri@linkov.net, 54374@debbugs.gnu.org > Date: Mon, 14 Mar 2022 08:20:29 +0000 > > Eli Zaretskii writes: > > >> From: Philip Kaludercic > >> Date: Sun, 13 Mar 2022 20:39:53 +0000 > >> Cc: 54374@debbugs.gnu.org > >> > >> - (while (< n 0) > >> + (while (and (< n 0) (< 1 (point))) > > > > Please always use point-min, never a literal 1. > > Can do, but does it make a difference in this case? The only reason the > comparison is made is so that (1- (point)) doesn't return an invalid > point value. Any buffer position outside of the accessible portion of the buffer is almost always invalid; the number of APIs which tolerate such values of buffer position is very small. Here, try this: emacs -Q M-: (narrow-to-region 20 (point-max)) RET M-: (get-text-property 1 'mouse-face) RET You will get the same args-out-of-range error. That's because get-text-property validates the position against the accessible portion of the buffer, not against some absolute values. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 09:34:36 2022 Received: (at 54374) by debbugs.gnu.org; 14 Mar 2022 13:34:36 +0000 Received: from localhost ([127.0.0.1]:44386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTkqJ-00013A-Ue for submit@debbugs.gnu.org; Mon, 14 Mar 2022 09:34:36 -0400 Received: from mout02.posteo.de ([185.67.36.66]:41571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTkqI-00012v-HH for 54374@debbugs.gnu.org; Mon, 14 Mar 2022 09:34:35 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6B476240106 for <54374@debbugs.gnu.org>; Mon, 14 Mar 2022 14:34:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647264868; bh=oGN93VE6cJKDi9d39khsiToOu4TqBRy1T0hFzv2bIs0=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=TAtSjpZnruzHuifFCVAQ3PtKgf7CwKNl8KgtkNViAKhNjAIzrwelq4BEtQwRnmNEz z/bwvPx3SKoq8qp3nnzEaZtFF4gCGZx1QKomXNBz3tibV/xHJ1f+JGy7gtGYiQLf4z lmMtADmeWig98FgKrJ8bPUhHRS13j5lSVBMSqWppczgqgOCUgS4n2XuQ601rLL85cX e3tmS6im05fI7+PtTQPLw7FfHeJ0S+3YQJXeifEx6QaOKIDE5ma6fju6T558Uk1t2T TSqptN1hN3q3JQBal1uXH6FsDOFph8kLnftr8V+RCpqt5Wk5V605ik/LSrlqfBXQi9 RMWtHF3mBnlNA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KHHZW4qzPz9rxN; Mon, 14 Mar 2022 14:34:27 +0100 (CET) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <83bky9kyk2.fsf@gnu.org> <87wngx9c8i.fsf@posteo.net> <83wngwk7vh.fsf@gnu.org> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Mon, 14 Mar 2022 13:34:26 +0000 In-Reply-To: <83wngwk7vh.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 14 Mar 2022 14:59:14 +0200") Message-ID: <875yog4pzx.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: juri@linkov.net, 54374@debbugs.gnu.org >> Date: Mon, 14 Mar 2022 08:20:29 +0000 >> >> Eli Zaretskii writes: >> >> >> From: Philip Kaludercic >> >> Date: Sun, 13 Mar 2022 20:39:53 +0000 >> >> Cc: 54374@debbugs.gnu.org >> >> >> >> - (while (< n 0) >> >> + (while (and (< n 0) (< 1 (point))) >> > >> > Please always use point-min, never a literal 1. >> >> Can do, but does it make a difference in this case? The only reason the >> comparison is made is so that (1- (point)) doesn't return an invalid >> point value. > > Any buffer position outside of the accessible portion of the buffer is > almost always invalid; the number of APIs which tolerate such values > of buffer position is very small. > > Here, try this: > > emacs -Q > M-: (narrow-to-region 20 (point-max)) RET > M-: (get-text-property 1 'mouse-face) RET > > You will get the same args-out-of-range error. That's because > get-text-property validates the position against the accessible > portion of the buffer, not against some absolute values. I didn't know that, thank you for the background information! -- Philip Kaludercic From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 10:12:50 2022 Received: (at 54374) by debbugs.gnu.org; 14 Mar 2022 14:12:50 +0000 Received: from localhost ([127.0.0.1]:45911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTlRJ-0004fM-Ml for submit@debbugs.gnu.org; Mon, 14 Mar 2022 10:12:49 -0400 Received: from mout01.posteo.de ([185.67.36.65]:59777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTlRI-0004f9-24 for 54374@debbugs.gnu.org; Mon, 14 Mar 2022 10:12:48 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DCF2A240026 for <54374@debbugs.gnu.org>; Mon, 14 Mar 2022 15:12:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647267161; bh=QPuQ0GwmmD1qqzVjVppD7SrRpZHmFTNIpVVKbavTA38=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=RBo/yWqvoyB6oQUcBGkLPj1CvEeM/eAnurJPJY5Ss0iPvUIG1ZXP6Ii29E7F1SS3K YZqCyUfreCmQsbsQfZZeWlrHnua4WBjNA6LrkWLRLntIc/bD5gw1QwyZJD+d6o5uMD KJzUhNHrp/AqjkPMBKGwkD4IoGHKi80sFlgoOGIukQCw7gI4UrK3Lif5BJ3U9JpfT4 ULOIHFNI5liaGvG6tlp6zXrx/TCITnfb2c37v72awPj8+WuW1QZnJ3DtI+abqvVfZd VE9Q4Qm68TVmvjQZFzwwdlUo/H6VAQN5QEE8Y60h0zdVwPmP4dxgg6Az5+WasAKklr tV5SIBdPWxnsQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KHJQd1KnMz6tmS; Mon, 14 Mar 2022 15:12:40 +0100 (CET) From: Philip Kaludercic To: Juri Linkov Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <86bky99c7r.fsf@mail.linkov.net> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Mon, 14 Mar 2022 14:12:40 +0000 In-Reply-To: <86bky99c7r.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 14 Mar 2022 10:30:56 +0200") Message-ID: <87fsnk39nr.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Juri Linkov writes: >> This seems to fix it: >> >> diff --git a/lisp/simple.el b/lisp/simple.el >> index accc119e2b..7d47aba1ee 100644 >> --- a/lisp/simple.el >> +++ b/lisp/simple.el >> @@ -9125,7 +9125,7 @@ next-completion >> (unless (get-text-property (point) 'mouse-face) >> (goto-char (next-single-property-change (point) 'mouse-face nil end))) >> (setq n (1- n))) >> - (while (< n 0) >> + (while (and (< n 0) (< 1 (point))) >> (let ((prop (get-text-property (1- (point)) 'mouse-face))) >> ;; If in a completion, move to the start of it. >> (when (and prop (eq prop (get-text-property (point) 'mouse-face))) > > Thanks, I confirm that it doesn't fail. > > However, there is some strange behaviour: when point is at the beginning > of the completion buffer, then previous-completion switches to the minibuffer. > But if point is at the first completion, then previous-completion wraps > to the last completion. Shouldn't point at the beginning of the buffer > wrap to the last completion as well? I didn't notice that, because completion-auto-select was enabled on my end. How about this: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/simple.el b/lisp/simple.el index accc119e2b..5fba27b868 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9108,6 +9108,13 @@ next-completion With prefix argument N, move N items (negative N means move backward)." (interactive "p") + (let ((prev (previous-single-property-change (point) 'mouse-face))) + (goto-char (cond + ((not prev) + (1- (next-single-property-change (point) 'mouse-face))) + ((/= prev (point)) + (point)) + (t prev)))) (let ((beg (point-min)) (end (point-max))) (catch 'bound (while (> n 0) --=-=-= Content-Type: text/plain (Note that this also fixes the "issue" jumping back to the beginning of the same completion option, if the point is not at the beginning of said option.) -- Philip Kaludercic --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 11:21:16 2022 Received: (at 54374) by debbugs.gnu.org; 14 Mar 2022 15:21:17 +0000 Received: from localhost ([127.0.0.1]:46009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTmVY-0006bd-Mz for submit@debbugs.gnu.org; Mon, 14 Mar 2022 11:21:16 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:50190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTmVW-0006bU-Sm for 54374@debbugs.gnu.org; Mon, 14 Mar 2022 11:21:16 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22EEonmW013725; Mon, 14 Mar 2022 15:21:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=pKn2BpzvRj9eHJFegjtoGsF3HUXrI3mNxmHEkbQOdgA=; b=GM7TLRAUlKxHEC5Vhdqr8G+I1+2resQtLXqb8GUd3Ja/VuDYysYMjGolaLyb2pNlx5AG JC8p0CgvJSDyDI4fqCXqdV2OFzSGQPVlrSJ122muwet2aAa0909b1hfya1bP70mSVYyK Ka3FTANYM9Qajfgo4OfK69wRYFgfnVq7f4q2vqNxGsx6s342KhY77UMuF7w1gPMCze6D BYHyeHsQrK30NNSGe2gS9X2Y/D3q3HAfzXXjFj+Mcn2j5RDM7CZtUhTAWY4s9wPTKNOv K4QV/CvVef2rlhPiLcqXKJPlZfV2Nv06hDIwM4jEfeGMrAsOPlg9twakW6Xdv/Ql1Vt1 sg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3et5s6gj85-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Mar 2022 15:21:13 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 22EFGjfL134071; Mon, 14 Mar 2022 15:21:12 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by userp3030.oracle.com with ESMTP id 3et65nutwh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Mar 2022 15:21:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XkD1JmR6onp3xg7Dwq5IKHaDfzt9O36xkLyzUNW5EkDI9a4qUGthPS7FaGgCfM4XvYcwJBjIAKrxlDvyvwlVbzQGrCGGzUUUP5uNOH6++RPinuTsfCTWsUAOQthGedWGntIH+4iGcFEnrzqxTzBSovEYQ1YunFTNEllxyWml2YRJeQRt+0maWI1rBQPLWWOe3cIUcF3SOWVSt8tnEW6VF8iIqrNG0auTJkx98GLknDctUXmyIkAyuxOj84qal6uOzNwKhnJg716wbx0rmM2INkIG1np7XJufTAVbPdEjiIxwykskirDRL6waKehojqzYNP1sCpmmzhxkQ46egBeFew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pKn2BpzvRj9eHJFegjtoGsF3HUXrI3mNxmHEkbQOdgA=; b=UlgSTD6Wc0ucfFD8qX/ItgAhtBzlRwIFmWTCiv/4TpldaevwaXlEu1WptfMV6/zgjFmNyc8zv19gasAWPDLhu8cOsiab10u1Xa9tnOsoD0nuES2qGrd3xv/jkrAaR+gSeZMqjkF8zVmG3A0g0R6a45222lPyd39lfEAUkupp8IrOKaCmUsNJq+LYWnGDL2uxcUGr7lPIYNz55UWlTqh0BVB839OOdlxKOJaQ1Px6vayK7kC7F8H4TLcXauZybQPRvuMHC+ymRjzCNxvYqMG/v0rjX2msZYVqusu0IfEh4brm9MosiS5juM6JPtVeyGjbUuqXhwMjrrhammcVVQXe3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pKn2BpzvRj9eHJFegjtoGsF3HUXrI3mNxmHEkbQOdgA=; b=E4jfWI8qcUE3MAQXTGw22jx2NYLDS6v3zpHSMJ1/p+Pn5mdKIA+BkVNlSdEX24nCc2/rmL12Tj1iyMBNDdnjYi4RcaJczM9IBf/+CqNTx+D7nPSSXKEHb9DJvP94dpqdHMmlExXA8UeIkLugSnMIpKQR69WJtIzVFgOO+NVRKHs= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by DM5PR1001MB2092.namprd10.prod.outlook.com (2603:10b6:4:36::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.26; Mon, 14 Mar 2022 15:21:10 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::ec69:8077:89b0:4379]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::ec69:8077:89b0:4379%6]) with mapi id 15.20.5061.028; Mon, 14 Mar 2022 15:21:10 +0000 From: Drew Adams To: Juri Linkov , Philip Kaludercic Subject: RE: [External] : bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer Thread-Topic: [External] : bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer Thread-Index: AQHYN4BACyqbXEbJnEGcPiQ1EIIQPqy++mdw Date: Mon, 14 Mar 2022 15:21:10 +0000 Message-ID: References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <86bky99c7r.fsf@mail.linkov.net> In-Reply-To: <86bky99c7r.fsf@mail.linkov.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 90b50cb1-653f-4ac6-4bd1-08da05ce4511 x-ms-traffictypediagnostic: DM5PR1001MB2092:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7sPBfA6YWQd0s+REFJjX7HS5O2NADU3jXx7K5ptuo3HgWiluaUkMyA2juvJsxlaL/P00uK2M+VTkZ1FHH2KkXPKoGbYVgvbr4iKIBYIXLkRmEN8H8y1K57KYYdDzwdCetmtqc8Lkn9IwHJHldV9JQ+ptK+WggvWGtlIOGHxgOMP394mxkUUE4YZT2RrvNUhDOuJOW0DEOWS3Jnt2e4ktYQVXAl/hTDXlx28Y/TxnXzDGgMvCIbzGgULYeCbhdZDEpi4Pp9f4uWQAkIlTuY25JJZaojcAX0/N+B6SrDwmKYnJi4ZdVspYkZJUu6KOBhoEOZcn89z22jARtQyPh6dlBMDZG350FNbQVtojOBCTWbToNTd7AkAxR2u80gJgmLBoZiehDIXniZHpsmlLSAlFAGbXmOWWztgZJjTOOem+l3T/kvDBlBMhd0sxwbH6bU49INazCZLlpuVha+TyBNX2plJJx+l73ojIjFMrliMWva1pRfxLserlGZkrkYy6KvMEBYHYV3xPo6Q7DYq1Ot3ea1w2wneMtKHrvyfsoFEap/mebyUa5A8juW99eqsssYkzWh7Z/xNsKubhQ/XicfOXulz2rMGZ5qPWPAZFba6+Va9zL1wkQXXF1+d7iV34qvnwfcOxryIYk8/aoVSlcFo2cCMB4UFZhDxyaOnKMQ8h7yymhLxSPV0mY0x7s8f1xIfc+MHwy0XD7BGEdY5MejsaQw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(122000001)(5660300002)(8676002)(71200400001)(4744005)(44832011)(110136005)(8936002)(4326008)(64756008)(66946007)(76116006)(66446008)(66476007)(66556008)(316002)(52536014)(26005)(186003)(9686003)(508600001)(2906002)(7696005)(6506007)(55016003)(86362001)(38070700005)(38100700002)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LZ8gV/y8OWAHOqHsl0SvqqU542zyZcA2OuJEdQludsu371MxTsF05Imdw8RN?= =?us-ascii?Q?ZDqdDky/dM3cGBMSta9GEhPph03WPZ9Gz98pjKuiuyqdtK8xK4p1hL/CesB6?= =?us-ascii?Q?PdZOzhZ6U/NTR0Ubii3S+3cdpemte9xCyMzbSRpmjCJ4r24aPcq4Z+ZfpUJQ?= =?us-ascii?Q?SuxafryQQl36hGliL4WQPICjaOqHzaM9KPu/zK8HwTQ+ZqkDnwrvZaEBisxS?= =?us-ascii?Q?yb4zPNQfJE2aAY1lpIXR+kruaf6N2Dp5LDMnx6Uq2f/Dp8swNUOmPtdLt878?= =?us-ascii?Q?dXPcG/uHMf+pjzZ99rHffy8+nANSPGa24pctMAeVwOTdnlzxozIygQaxFU1S?= =?us-ascii?Q?sOQCpVDYQ3MsLtPisQGh82ud9gVGc3Np6+XBFdAMUWfvR4FwzUHdv2YQ0iIN?= =?us-ascii?Q?/3lHB3er2ApoEkh9WFKx5CSQaXht7wh+hGgX6zal2+ewYbYfksKZaEtWYnCN?= =?us-ascii?Q?U5iydPNy40r50nOUhaPi8EfNeT9+zdDFiAn4XKeLB2dqjmGNAHZ/id4ngZAM?= =?us-ascii?Q?Kt5a/wxDpKziAK2jvHRG9zN2YtFn+EznE+GsNRF2QDtzZlMMZXhZy/Rb7UDz?= =?us-ascii?Q?SyyJAlNwQfNKgj5uTGs7P80tjg71gCR3qJyXLLnRcJ2Njyv8anG4ebfzT3ze?= =?us-ascii?Q?/PiKJUZMZJ8nMw6IT5yaCr8fcd40CQfu1C57HRCYPY2lnvxsiiFnfqQ67gRI?= =?us-ascii?Q?IcOFaaBfHjiHKM6MtaRkKuG9SW6kIikRKQLfPOs9aSTuawOvl69BaQarEqha?= =?us-ascii?Q?/GJoQB/1GLFikStd8wa4LziLKvilmmkVtwxzkdO9P94txkrd3uHc6sBOLM4Y?= =?us-ascii?Q?00RBHoznpXqwlpOndgoQswct+mzPqfCezmMm/VNG2okR5zrnWaabckbYK6m4?= =?us-ascii?Q?044SwNAn1IGkP/YymQjpqaGY99ewJZ6odlIIuQx5SP7SfPxHsxX4zyVjW7zS?= =?us-ascii?Q?fD+XiTbLBjtCNRi0bEXN2ec+8n+efA24adzFvEP2pwLUOygeSR6vncmDj16w?= =?us-ascii?Q?0pLAusxFz1V6Kb7aWxK6BEZ8NLA2TymNFjxWYHGQcsT2dKZR+AyhLSlkGvnT?= =?us-ascii?Q?HgQwxOklc1iWP5VYzPqZNLfZ4SNvHpvxjyyRreJgIfxlF31HaK7pYFALKqmC?= =?us-ascii?Q?X71yAntiJs3unuijDFfINxVNEn0qLWzk6vewC6SQ4QsNDL0QwemYrIulEh2p?= =?us-ascii?Q?SVILSP0wmJRavzTk4o23Lv0as6aOWlSnQgvyJWNNZw2jeSrsAr4JlXEG+1j1?= =?us-ascii?Q?sHckT9XJ7hzyUzJp9dwYr3qgClHNzyD/yTv8fNJmDNfqUmukITQla13g6T2Y?= =?us-ascii?Q?+RbYshZUW3qivNtntJKJZ/6P1MFUqL0FZh2xacYjyaahmMyWPMTjJY8HmBLD?= =?us-ascii?Q?6j9cD6wOUZcM9Pe98V+8ZxXGyuwlIpBGpFkeUys9CWRJrkrrV1LNVG1c5rtO?= =?us-ascii?Q?cU2CLv/tu8vQVvETFxFMIJLHXaEmQjJFPvjViqMWZHuvGMwCBIDv51NWBal8?= =?us-ascii?Q?NNtONled5JRzEbBp8pZP25DE7gZQARffyurdEZPpvvbvMXERu+94XSB2xZHT?= =?us-ascii?Q?mEVIUUN6PrNTgRaIAAgbB3t7ly3GXq6a8BbrkRN1GDMqpscK5JavBfiRdMge?= =?us-ascii?Q?Xg=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90b50cb1-653f-4ac6-4bd1-08da05ce4511 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2022 15:21:10.5572 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KWWSUAjAONo5CcCEV3wTfbxjEIO+moTjwKhWkUQSydhIwYTLbtCGWvKrTwxCSNAxGPs85gaqBc2eE0AEMkUdGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2092 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10285 signatures=693139 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=795 phishscore=0 suspectscore=0 adultscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203140097 X-Proofpoint-GUID: n824Wau86dbmHz2egvDUjuPrqCgZYeIZ X-Proofpoint-ORIG-GUID: n824Wau86dbmHz2egvDUjuPrqCgZYeIZ X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54374 Cc: "54374@debbugs.gnu.org" <54374@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > when point is at the beginning of the completion buffer, > then previous-completion switches to the minibuffer. Not good. Keys that cycle among completions should do exactly that. And they should wrap around, at least by default (with a user option to not do that). If point is at bob then backward cycling should move to the last completion. > But if point is at the first completion, then previous-completion wraps > to the last completion. Shouldn't point at the beginning of the buffer > wrap to the last completion as well? Of course it should. If point is there or at any place before the first completion then backward cycling should wrap around to the last completion. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 14:28:45 2022 Received: (at 54374) by debbugs.gnu.org; 14 Mar 2022 18:28:45 +0000 Received: from localhost ([127.0.0.1]:46285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTpQz-0005jr-HQ for submit@debbugs.gnu.org; Mon, 14 Mar 2022 14:28:45 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:60137) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTpQy-0005jd-EN for 54374@debbugs.gnu.org; Mon, 14 Mar 2022 14:28:45 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 40A171BF205; Mon, 14 Mar 2022 18:28:36 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer Organization: LINKOV.NET References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <86bky99c7r.fsf@mail.linkov.net> <87fsnk39nr.fsf@posteo.net> Date: Mon, 14 Mar 2022 20:24:57 +0200 In-Reply-To: <87fsnk39nr.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 14 Mar 2022 14:12:40 +0000") Message-ID: <86k0cwlcge.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I didn't notice that, because completion-auto-select was enabled on my > end. How about this: > > (Note that this also fixes the "issue" jumping back to the beginning of > the same completion option, if the point is not at the beginning of said > option.) Thanks, this fixed the issue. And I noticed another one: at the beginning of the buffer previous-completion wraps to the end of the buffer, not to the beginning of the last completion. Also when point at the last completion, next-completion jumps to the end of the buffer instead of wrapping to the first completion. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 18 17:49:26 2022 Received: (at 54374) by debbugs.gnu.org; 18 Mar 2022 21:49:26 +0000 Received: from localhost ([127.0.0.1]:58554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVKTO-0004UT-6S for submit@debbugs.gnu.org; Fri, 18 Mar 2022 17:49:26 -0400 Received: from mout01.posteo.de ([185.67.36.65]:45813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVKTM-0004UE-4L for 54374@debbugs.gnu.org; Fri, 18 Mar 2022 17:49:24 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DAAF4240026 for <54374@debbugs.gnu.org>; Fri, 18 Mar 2022 22:49:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647640157; bh=JghjyM68sYjSmMx+TJk7aEWb1SuJ5a3OoVJnDthI4pc=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=lS9HLKmD1AXfcCA5yZDvsbMj7OQjCiBpY4M2ZJ2CuXoCBd0kPoNbBYcqPxKEbenQl qae6dx4nXZWPQuVryu4KsBLyLayiSN92fqEpHblUd+UaGvqlH07e36+lWW8jHIeOXi 3LpCzCrNMCDdrlU6d1XxmHv6ClJ42PJZwAx8OiOgNhJADzQfjb8sp5Ls7kuzMMBwGR n/vXAXDnf2PHXdDAqUIkqbm2z8zUVviQc2pyYqQU6qqMnUHrUFX0Zi4DrVNFy/53TN beqgwQjlFXotXDfJyVFEX0idTCd3faY0Be9gL5tOC5zMGRjWdUThxE+CNthc8oNxCg DOXJoJYZk0n4w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KKyMd1grwz9rxK; Fri, 18 Mar 2022 22:49:16 +0100 (CET) From: Philip Kaludercic To: Juri Linkov Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <86bky99c7r.fsf@mail.linkov.net> <87fsnk39nr.fsf@posteo.net> <86k0cwlcge.fsf@mail.linkov.net> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Fri, 18 Mar 2022 21:49:16 +0000 In-Reply-To: <86k0cwlcge.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 14 Mar 2022 20:24:57 +0200") Message-ID: <875yobnd7n.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: >> I didn't notice that, because completion-auto-select was enabled on my >> end. How about this: >> >> (Note that this also fixes the "issue" jumping back to the beginning of >> the same completion option, if the point is not at the beginning of said >> option.) > > Thanks, this fixed the issue. And I noticed another one: at the > beginning of the buffer previous-completion wraps to the end of the buffer, > not to the beginning of the last completion. > > Also when point at the last completion, next-completion > jumps to the end of the buffer instead of wrapping to the > first completion. I cannot replicate this issue in every case, but only if the last option has completion annotation. It should be fixable by checking for these kinds of edge-cases, but it might also be better to reconsider if next-completion should be using `mouse-face' for navigation, or if a special text property might be more elegant? -- Philip Kaludercic From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 19 15:28:28 2022 Received: (at 54374) by debbugs.gnu.org; 19 Mar 2022 19:28:28 +0000 Received: from localhost ([127.0.0.1]:60605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVekW-0001qy-Aq for submit@debbugs.gnu.org; Sat, 19 Mar 2022 15:28:28 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:44119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVekT-0001qX-Ht for 54374@debbugs.gnu.org; Sat, 19 Mar 2022 15:28:27 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id BD54840005; Sat, 19 Mar 2022 19:28:18 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer Organization: LINKOV.NET References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <86bky99c7r.fsf@mail.linkov.net> <87fsnk39nr.fsf@posteo.net> <86k0cwlcge.fsf@mail.linkov.net> <875yobnd7n.fsf@posteo.net> Date: Sat, 19 Mar 2022 21:13:14 +0200 In-Reply-To: <875yobnd7n.fsf@posteo.net> (Philip Kaludercic's message of "Fri, 18 Mar 2022 21:49:16 +0000") Message-ID: <864k3tu4pp.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Thanks, this fixed the issue. And I noticed another one: at the >> beginning of the buffer previous-completion wraps to the end of the buffer, >> not to the beginning of the last completion. >> >> Also when point at the last completion, next-completion >> jumps to the end of the buffer instead of wrapping to the >> first completion. > > I cannot replicate this issue in every case, but only if the last option > has completion annotation. It should be fixable by checking for these > kinds of edge-cases, but it might also be better to reconsider if > next-completion should be using `mouse-face' for navigation, or if a > special text property might be more elegant? I agree that `mouse-face' is unsuitable for detecting the completion boundaries, and it causes other problems: typing RET on the completion prefix or on the completion suffix/annotation causes the error: Debugger entered--Lisp error: (error "No completion here") error("No completion here") choose-completion(13 nil) funcall-interactively(choose-completion 13 nil) command-execute(choose-completion) So a special text property could also help to detect the completion for RET, if there are no such text properties already. But I see there is the text property 'completion--string'. So maybe it could be extended to cover prefix and suffix/annotation as well. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 24 14:12:20 2022 Received: (at 54374) by debbugs.gnu.org; 24 Mar 2022 18:12:20 +0000 Received: from localhost ([127.0.0.1]:49392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXRwa-0003CF-7A for submit@debbugs.gnu.org; Thu, 24 Mar 2022 14:12:20 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:42931) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXRwX-0003C0-HR for 54374@debbugs.gnu.org; Thu, 24 Mar 2022 14:12:18 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 856F4FF80C; Thu, 24 Mar 2022 18:12:09 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer Organization: LINKOV.NET References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <86bky99c7r.fsf@mail.linkov.net> <87fsnk39nr.fsf@posteo.net> Date: Thu, 24 Mar 2022 20:11:46 +0200 In-Reply-To: <87fsnk39nr.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 14 Mar 2022 14:12:40 +0000") Message-ID: <864k3nusnx.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > (Note that this also fixes the "issue" jumping back to the beginning of > the same completion option, if the point is not at the beginning of said > option.) Thanks for the fixes. I pushed both patches with the same commit (that also uses the suggested (not (bobp))). From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 15:14:36 2022 Received: (at 54374) by debbugs.gnu.org; 24 May 2022 19:14:36 +0000 Received: from localhost ([127.0.0.1]:53443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntZzH-00054Q-Kb for submit@debbugs.gnu.org; Tue, 24 May 2022 15:14:36 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:41407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntZzD-00053z-Qy for 54374@debbugs.gnu.org; Tue, 24 May 2022 15:14:32 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id D59EA240003; Tue, 24 May 2022 19:14:24 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer Organization: LINKOV.NET References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <86bky99c7r.fsf@mail.linkov.net> <87fsnk39nr.fsf@posteo.net> <86k0cwlcge.fsf@mail.linkov.net> <875yobnd7n.fsf@posteo.net> <864k3tu4pp.fsf@mail.linkov.net> Date: Tue, 24 May 2022 22:12:27 +0300 In-Reply-To: <864k3tu4pp.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 19 Mar 2022 21:13:14 +0200") Message-ID: <861qwiu4rd.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >>> Thanks, this fixed the issue. And I noticed another one: at the >>> beginning of the buffer previous-completion wraps to the end of the buffer, >>> not to the beginning of the last completion. >>> >>> Also when point at the last completion, next-completion >>> jumps to the end of the buffer instead of wrapping to the >>> first completion. >> >> I cannot replicate this issue in every case, but only if the last option >> has completion annotation. It should be fixable by checking for these >> kinds of edge-cases, but it might also be better to reconsider if >> next-completion should be using `mouse-face' for navigation, or if a >> special text property might be more elegant? > > I agree that `mouse-face' is unsuitable for detecting the completion > boundaries, and it causes other problems: typing RET on the completion prefix > or on the completion suffix/annotation causes the error: > > Debugger entered--Lisp error: (error "No completion here") > error("No completion here") > choose-completion(13 nil) > funcall-interactively(choose-completion 13 nil) > command-execute(choose-completion) > > So a special text property could also help to detect the completion for RET, > if there are no such text properties already. But I see there is the > text property 'completion--string'. So maybe it could be extended to cover > prefix and suffix/annotation as well. Here is the patch that fixes 4 bugs: 2 bugs described above, and also bug#55289 and bug#55430. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=first-completion.patch diff --git a/lisp/ido.el b/lisp/ido.el index e5717d6e53..73cd163d46 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -3939,7 +3939,7 @@ ido-switch-to-completions ;; In the new buffer, go to the first completion. ;; FIXME: Perhaps this should be done in `ido-completion-help'. (when (bobp) - (next-completion 1))))) + (first-completion))))) (defun ido-completion-auto-help () "Call `ido-completion-help' if `completion-auto-help' is non-nil." diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 8287007d32..8948d16949 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2070,11 +2151,11 @@ completion--insert (when prefix (let ((beg (point)) (end (progn (insert prefix) (point)))) - (put-text-property beg end 'mouse-face nil))) + (add-text-properties beg end `(mouse-face nil completion--string ,(car str))))) (completion--insert (car str) group-fun) (let ((beg (point)) (end (progn (insert suffix) (point)))) - (put-text-property beg end 'mouse-face nil) + (add-text-properties beg end `(mouse-face nil completion--string ,(car str))) ;; Put the predefined face only when suffix ;; is added via annotation-function without prefix, ;; and when the caller doesn't use own face. diff --git a/lisp/simple.el b/lisp/simple.el index 1efd900030..75b548aea6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9523,6 +9523,20 @@ completion-auto-select :version "29.1" :group 'completion) +(defun first-completion () + (interactive) + (goto-char (point-min)) + (unless (get-text-property (point) 'completion--string) + (let ((next (next-single-property-change (point) 'completion--string))) + (when next (goto-char next))))) + +(defun last-completion () + (interactive) + (goto-char (point-max)) + (unless (get-text-property (point) 'completion--string) + (let ((prev (previous-single-property-change (point) 'completion--string))) + (when prev (goto-char prev))))) + (defun previous-completion (n) "Move to the previous item in the completion list. With prefix argument N, move back N items (negative N means move @@ -9539,14 +9553,6 @@ next-completion Also see the `completion-wrap-movement' variable." (interactive "p") - (let ((prev (previous-single-property-change (point) 'mouse-face))) - (goto-char (cond - ((not prev) - (1- (next-single-property-change (point) 'mouse-face))) - ((/= prev (point)) - (point)) - (t prev)))) - (let ((beg (point-min)) (end (point-max)) (tabcommand (member (this-command-keys) '("\t" [backtab]))) @@ -9554,44 +9560,43 @@ next-completion (catch 'bound (while (> n 0) ;; If in a completion, move to the end of it. - (when (get-text-property (point) 'mouse-face) - (goto-char (next-single-property-change (point) 'mouse-face nil end))) + (when (get-text-property (point) 'completion--string) + (goto-char (next-single-property-change (point) 'completion--string nil end))) ;; If at the last completion option, wrap or skip to the - ;; minibuffer, if requested. We can't use (eobp) because some - ;; extra text may be after the last candidate: ex: when - ;; completion-detailed - (setq prop (next-single-property-change (point) 'mouse-face nil end)) + ;; minibuffer, if requested. + (setq prop (next-single-property-change (point) 'completion--string nil end)) (when (and completion-wrap-movement (eq end prop)) (if (and completion-auto-select tabcommand) (throw 'bound nil) (goto-char (point-min)))) ;; Move to start of next one. - (unless (get-text-property (point) 'mouse-face) - (goto-char (next-single-property-change (point) 'mouse-face nil end))) + (unless (get-text-property (point) 'completion--string) + (goto-char (next-single-property-change (point) 'completion--string nil end))) (setq n (1- n))) - (while (and (< n 0) (not (bobp))) - (setq prop (get-text-property (1- (point)) 'mouse-face)) + (while (< n 0) + (unless (bobp) + (setq prop (get-text-property (1- (point)) 'completion--string))) ;; If in a completion, move to the start of it. - (when (and prop (eq prop (get-text-property (point) 'mouse-face))) + (when (and prop (eq prop (get-text-property (point) 'completion--string))) (goto-char (previous-single-property-change - (point) 'mouse-face nil beg))) + (point) 'completion--string nil beg))) ;; Move to end of the previous completion. - (unless (or (bobp) (get-text-property (1- (point)) 'mouse-face)) + (unless (or (bobp) (get-text-property (1- (point)) 'completion--string)) (goto-char (previous-single-property-change - (point) 'mouse-face nil beg))) + (point) 'completion--string nil beg))) ;; If at the first completion option, wrap or skip to the ;; minibuffer, if requested. - (setq prop (previous-single-property-change (point) 'mouse-face nil beg)) + (setq prop (previous-single-property-change (point) 'completion--string nil beg)) (when (and completion-wrap-movement (eq beg prop)) (if (and completion-auto-select tabcommand) (progn - (goto-char (next-single-property-change (point) 'mouse-face nil end)) + (goto-char (next-single-property-change (point) 'completion--string nil end)) (throw 'bound nil)) (goto-char (point-max)))) ;; Move to the start of that one. (goto-char (previous-single-property-change - (point) 'mouse-face nil beg)) + (point) 'completion--string nil beg)) (setq n (1+ n)))) (when (/= 0 n) (switch-to-minibuffer)))) @@ -9620,13 +9625,14 @@ choose-completion (goto-char (posn-point (event-start event))) (let (beg) (cond - ((and (not (eobp)) (get-text-property (point) 'mouse-face)) + ((and (not (eobp)) (get-text-property (point) 'completion--string)) (setq beg (1+ (point)))) ((and (not (bobp)) - (get-text-property (1- (point)) 'mouse-face)) + (get-text-property (1- (point)) 'completion--string)) (setq beg (point))) (t (error "No completion here"))) - (setq beg (previous-single-property-change beg 'mouse-face)) + (setq beg (or (previous-single-property-change beg 'completion--string) + beg)) (substring-no-properties (get-text-property beg 'completion--string)))))) @@ -9832,8 +9838,8 @@ switch-to-completions ((and (memq this-command '(completion-at-point minibuffer-complete)) (equal (this-command-keys) [backtab])) (goto-char (point-max)) - (previous-completion 1)) - (t (next-completion 1)))))) + (last-completion)) + (t (first-completion)))))) (defun read-expression-switch-to-completions () "Select the completion list window while reading an expression." --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 26 12:27:35 2022 Received: (at 54374) by debbugs.gnu.org; 26 May 2022 16:27:35 +0000 Received: from localhost ([127.0.0.1]:59869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuGKk-0003Ak-VR for submit@debbugs.gnu.org; Thu, 26 May 2022 12:27:35 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:36275) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuGKi-0003AM-JR; Thu, 26 May 2022 12:27:33 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 5B337100005; Thu, 26 May 2022 16:27:24 +0000 (UTC) From: Juri Linkov To: 54374@debbugs.gnu.org Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer Organization: LINKOV.NET References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <86bky99c7r.fsf@mail.linkov.net> <87fsnk39nr.fsf@posteo.net> <86k0cwlcge.fsf@mail.linkov.net> <875yobnd7n.fsf@posteo.net> <864k3tu4pp.fsf@mail.linkov.net> <861qwiu4rd.fsf@mail.linkov.net> Date: Thu, 26 May 2022 19:26:41 +0300 In-Reply-To: <861qwiu4rd.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 24 May 2022 22:12:27 +0300") Message-ID: <86y1yoqmym.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54374 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) forcemerge 54374 55289 55430 quit > Here is the patch that fixes 4 bugs: 2 bugs described above, > and also bug#55289 and bug#55430. I pushed the test suite that will help to verify that these bugs are correctly fixed. From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 12:14:12 2022 Received: (at 54374) by debbugs.gnu.org; 27 May 2022 16:14:12 +0000 Received: from localhost ([127.0.0.1]:35665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nucbM-0007Qo-Lb for submit@debbugs.gnu.org; Fri, 27 May 2022 12:14:12 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:35389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nucbL-0007QZ-Aa; Fri, 27 May 2022 12:14:11 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 33C80100003; Fri, 27 May 2022 16:14:02 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer Organization: LINKOV.NET References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <86bky99c7r.fsf@mail.linkov.net> <87fsnk39nr.fsf@posteo.net> <86k0cwlcge.fsf@mail.linkov.net> <875yobnd7n.fsf@posteo.net> <864k3tu4pp.fsf@mail.linkov.net> <861qwiu4rd.fsf@mail.linkov.net> Date: Fri, 27 May 2022 19:13:44 +0300 In-Reply-To: <861qwiu4rd.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 24 May 2022 22:12:27 +0300") Message-ID: <86a6b3hs1z.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54374 Cc: 54374@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 54374 29.0.50 thanks > Here is the patch that fixes 4 bugs: 2 bugs described above, > and also bug#55289 and bug#55430. Now all fixes with tests pushed to master. From unknown Wed Jun 18 23:18:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 25 Jun 2022 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator