From unknown Sat Aug 09 01:11:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#65379: 29.1.50; isearch started through `isearch-resume' incorrectly moves point after failure Resent-From: Jens Schmidt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Aug 2023 09:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65379 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 65379@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169243840226509 (code B ref -1); Sat, 19 Aug 2023 09:47:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Aug 2023 09:46:42 +0000 Received: from localhost ([127.0.0.1]:49492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXIXZ-0006tV-Qn for submit@debbugs.gnu.org; Sat, 19 Aug 2023 05:46:42 -0400 Received: from lists.gnu.org ([2001:470:142::17]:40632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXIXX-0006tG-9J for submit@debbugs.gnu.org; Sat, 19 Aug 2023 05:46:40 -0400 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 1qXIXN-0006PW-6I for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 05:46:31 -0400 Received: from mr6.vodafonemail.de ([145.253.228.166]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qXIXK-0003vr-73 for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 05:46:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-21dec; t=1692438371; bh=ByUAq1Wv3fJ1Omqea/ntk17DwIR4b0GfUb59bn7aYfw=; h=Message-ID:Date:User-Agent:Content-Language:From:To:Subject: Content-Type:From; b=nfrEfWVWrGrdWDAptnvnMMb5+IDF8msXSJThfZxRAjGISLe1t9zmoshSkjMqrFJQh Eqsksd7MaglYXNMe+Zc4QHSOJzDpYtjFa2hN+KEhweJjyXP7Rdu7oi5RO4vpn3XFUe RuY88tdjE2UYrxBlO+CkQUoVPWqu0L6mV2cXHvss= Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr6.vodafonemail.de (Postfix) with ESMTPS id 4RSYll05NDz1y4B for ; Sat, 19 Aug 2023 09:46:11 +0000 (UTC) Received: from [192.168.178.41] (port-92-194-245-7.dynamic.as20676.net [92.194.245.7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4RSYlf5WZgz9sRC for ; Sat, 19 Aug 2023 09:46:03 +0000 (UTC) Message-ID: <281b7bc5-43cf-0163-9fee-3f44d8aad827@vodafonemail.de> Date: Sat, 19 Aug 2023 11:45:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Content-Language: de-DE-frami, en-US From: Jens Schmidt Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-purgate-type: clean X-purgate: clean X-purgate-size: 2353 X-purgate-ID: 155817::1692438366-E1FFA912-7D0E5ABE/0/0 Received-SPF: pass client-ip=145.253.228.166; envelope-from=jschmidt4gnu@vodafonemail.de; helo=mr6.vodafonemail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) 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.0 (-) One of the more arcane features of isearch ... I do not actually use that, but I modeled one of my personal isearch functions after `isearch-resume´ and came across this issue. emacs -Q M-: (setq isearch-resume-in-command-history t) RET Then execute: f ;; self-insert-command o ;; self-insert-command o ;; self-insert-command b ;; self-insert-command a ;; self-insert-command r ;; self-insert-command b ;; self-insert-command a ;; self-insert-command z ;; self-insert-command ;; newline C- ;; beginning-of-buffer C-s ;; isearch-forward f ;; isearch-printing-char o ;; isearch-printing-char o ;; isearch-printing-char b ;; isearch-printing-char a ;; isearch-printing-char r ;; isearch-printing-char b ;; isearch-printing-char a ;; isearch-printing-char z ;; isearch-printing-char ;; isearch-exit C- ;; beginning-of-buffer C-x ;; repeat-complex-command ;; read--expression-try-read C-s ;; isearch-repeat-forward => point jumps to bob and the complete buffer gets highlighted on the search failure after the `C-s' I'm not an isearch expert, but I think the remedy should be to add a call to `isearch-push-state' before the call to `isearch-update' in function `isearch-resume': diff --git a/lisp/isearch.el b/lisp/isearch.el index 3d2bbda4975..14f335f4cea 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -4640,6 +4640,7 @@ isearch-resume isearch-message message isearch-case-fold-search case-fold) (isearch-search) + (isearch-push-state) (isearch-update)) At least that helps preventing the incorrect behavior, and most other calls to `isearch-update' have a preceeding call to `isearch-push-state' in isearch.el. But that doesn't mean anything, of course, so somebody else should review that. From unknown Sat Aug 09 01:11:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#65379: 29.1.50; isearch started through `isearch-resume' incorrectly moves point after failure Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Aug 2023 17:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65379 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jens Schmidt Cc: 65379@debbugs.gnu.org Received: via spool by 65379-submit@debbugs.gnu.org id=B65379.169255320520287 (code B ref 65379); Sun, 20 Aug 2023 17:41:01 +0000 Received: (at 65379) by debbugs.gnu.org; 20 Aug 2023 17:40:05 +0000 Received: from localhost ([127.0.0.1]:54805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXmPF-0005H7-A8 for submit@debbugs.gnu.org; Sun, 20 Aug 2023 13:40:05 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]:47399) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXmPD-0005GQ-5y; Sun, 20 Aug 2023 13:40:03 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 89F8C60003; Sun, 20 Aug 2023 17:39:52 +0000 (UTC) From: Juri Linkov In-Reply-To: <281b7bc5-43cf-0163-9fee-3f44d8aad827@vodafonemail.de> (Jens Schmidt via's message of "Sat, 19 Aug 2023 11:45:58 +0200") Organization: LINKOV.NET References: <281b7bc5-43cf-0163-9fee-3f44d8aad827@vodafonemail.de> Date: Sun, 20 Aug 2023 20:37:28 +0300 Message-ID: <86pm3hipih.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) 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 65379 30.0.50 thanks > One of the more arcane features of isearch ... I do not actually > use that, but I modeled one of my personal isearch functions after > `isearch-resume´ and came across this issue. Thanks for the bug report. I don't use `isearch-resume', so never noticed this bug. > I'm not an isearch expert, but I think the remedy should be to add a > call to `isearch-push-state' before the call to `isearch-update' in > function `isearch-resume': > > diff --git a/lisp/isearch.el b/lisp/isearch.el > index 3d2bbda4975..14f335f4cea 100644 > --- a/lisp/isearch.el > +++ b/lisp/isearch.el > @@ -4640,6 +4640,7 @@ isearch-resume > isearch-message message > isearch-case-fold-search case-fold) > (isearch-search) > + (isearch-push-state) > (isearch-update)) > > At least that helps preventing the incorrect behavior, and most other > calls to `isearch-update' have a preceeding call to `isearch-push-state' > in isearch.el. But that doesn't mean anything, of course, so somebody > else should review that. You are absolutely right. This is the correct way to fix it. Now pushed to master. Thanks for the patch.