From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jens Schmidt via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65379: 29.1.50; isearch started through `isearch-resume' incorrectly moves point after failure Date: Sat, 19 Aug 2023 11:45:58 +0200 Message-ID: <281b7bc5-43cf-0163-9fee-3f44d8aad827@vodafonemail.de> Reply-To: Jens Schmidt Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16844"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 To: 65379@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 19 11:47:26 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 1qXIYI-00047r-Dx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Aug 2023 11:47:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXIXv-0006Qo-8x; Sat, 19 Aug 2023 05:47:03 -0400 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 1qXIXt-0006Qb-Ey for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 05:47:01 -0400 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 1qXIXt-0003yb-73 for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 05:47:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qXIXu-0006uI-36 for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 05:47:02 -0400 X-Loop: help-debbugs@gnu.org 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-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169243840226509 (code B ref -1); Sat, 19 Aug 2023 09:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Aug 2023 09:46:42 +0000 Original-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 Original-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 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 1qXIXN-0006PW-6I for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 05:46:31 -0400 Original-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= Original-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) Original-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) Content-Language: de-DE-frami, en-US 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-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:267839 Archived-At: 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.