From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#12986: Pressing backspace during isearch exits case-sensitive and word modes Date: Tue, 13 Oct 2020 04:26:48 +0200 Message-ID: <877dru97yv.fsf@gnus.org> References: <1354124058.21763.YahooMailClassic@web141103.mail.bf1.yahoo.com> <87a9u1jqzh.fsf@mail.jurta.org> <87obbolu5c.fsf@mail.jurta.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22777"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 12986@debbugs.gnu.org, Kelly Dean To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 13 04:28:11 2020 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 1kSA2r-0005my-2X for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Oct 2020 04:28:09 +0200 Original-Received: from localhost ([::1]:40938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSA2q-00037q-5f for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Oct 2020 22:28:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSA2k-00037b-4g for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2020 22:28:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSA2j-0001UC-Rb for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2020 22:28:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kSA2j-0007ne-NL for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2020 22:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Oct 2020 02:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12986 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 12986-submit@debbugs.gnu.org id=B12986.160255602929922 (code B ref 12986); Tue, 13 Oct 2020 02:28:01 +0000 Original-Received: (at 12986) by debbugs.gnu.org; 13 Oct 2020 02:27:09 +0000 Original-Received: from localhost ([127.0.0.1]:44612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSA1t-0007mX-0R for submit@debbugs.gnu.org; Mon, 12 Oct 2020 22:27:09 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:40748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSA1q-0007ly-3f for 12986@debbugs.gnu.org; Mon, 12 Oct 2020 22:27:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2wBbG8rGgLB4ekkNUt3V/XaCqdYeG0exHFi8q2/K3m4=; b=nqvLo2Jt2Ed1P4KCKfBt6PDC5o VH5hkHZGC7M8SKTsbf6CHLwQDjdkflPOUvSrmgroHRuayQ7zMjAgbsfhoIDri+pDtVYYUrmq2tiTc RSeEXQJ3whkR5SWV8WmK4fyrZe/SieraGPaDstZmtuFCXeK4D8/iSQneYHyIwCM1lcAU=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSA1Z-00010I-Op; Tue, 13 Oct 2020 04:26:59 +0200 X-Now-Playing: Oval's _Wohnton_: "WoistdieStadt?" In-Reply-To: <87obbolu5c.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 02 Jun 2013 12:49:19 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:190379 Archived-At: Juri Linkov writes: >> Good point. `isearch-delete-char' (that uses `isearch-pop-state') >> restores word mode but not regexp mode. This looks like >> unaccountable inconsistency. Perhaps it should restore >> regexp mode as well. [...] > This patch adds a new user option `isearch-keep-stack-variables' > intended to accompany another option `isearch-keep-mode-variables' > added in bug#11378. It adds a new option but doesn't change > the default behavior - its default value is `isearch-regexp' > that means to not keep regexp mode when pressing backspace > (other search variables will be supported later as well). I respun the patch for Emacs 28, but looking at it, I guess it doesn't support actually restoring the modes it's discussing? diff --git a/lisp/isearch.el b/lisp/isearch.el index 0879f948cf..e9a3a2e921 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -167,6 +167,17 @@ isearch-hide-immediately the search, with the exception of the last successful match, if any." :type 'boolean) +(defcustom isearch-keep-stack-variables '(isearch-regexp) + "A set of search variables to keep and not to restore from the search stack." + :type '(set (const :tag "Regexp search" isearch-regexp) + (const :tag "Case folding" isearch-case-fold-search) + (const :tag "Invisible text" isearch-invisible) + (const :tag "Filters" isearch-filter-predicates) + (const :tag "Lax whitespace" isearch-lax-whitespace) + (const :tag "Regexp lax whitespace" isearch-regexp-lax-whitespace)) + :version "28.1" + :group 'isearch) + (defcustom isearch-resume-in-command-history nil "If non-nil, `isearch-resume' commands are added to the command history. This allows you to resume earlier Isearch sessions through the @@ -1515,6 +1526,7 @@ isearch-update-from-string-properties (case-fold-search isearch-case-fold-search) (pop-fun (if isearch-push-state-function (funcall isearch-push-state-function))) + (regexp isearch-regexp) (match-data isearch-match-data)))) (string nil :read-only t) (message nil :read-only t) @@ -1528,6 +1540,7 @@ isearch-update-from-string-properties (barrier nil :read-only t) (case-fold-search nil :read-only t) (pop-fun nil :read-only t) + (regexp :read-only t) (match-data nil :read-only t)) (defun isearch--set-state (cmd) @@ -1542,6 +1555,8 @@ isearch--set-state isearch-barrier (isearch--state-barrier cmd) isearch-case-fold-search (isearch--state-case-fold-search cmd) isearch-match-data (isearch--state-match-data cmd)) + (unless (memq 'isearch-regexp isearch-keep-stack-variables) + (setq isearch-regexp (isearch--state-regexp cmd))) (if (functionp (isearch--state-pop-fun cmd)) (funcall (isearch--state-pop-fun cmd) cmd)) (goto-char (isearch--state-point cmd))) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no