From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#74287: [PATCH] Rework history Isearch for Eshell Date: Tue, 10 Dec 2024 09:46:27 +0200 Organization: LINKOV.NET Message-ID: <8734iwq8to.fsf@mail.linkov.net> References: <871pzjkhmm.fsf@pengjiz.com> <8c80ae91-476e-e665-43be-86d72fb57ed1@gmail.com> <86v7waz603.fsf@gmx.net> <6fdd8386-8915-e3a8-046a-b18750a7057d@gmail.com> <87v7vzgtuq.fsf@mail.linkov.net> <87jzcecnc9.fsf@pengjiz.com> <87h67icmu1.fsf@pengjiz.com> <87cyi159vo.fsf@pengjiz.com> <87msh4n29s.fsf@mail.linkov.net> <8734iwl5kw.fsf@pengjiz.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5576"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: Jim Porter , 74287@debbugs.gnu.org To: Pengji Zhang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 10 08:50:29 2024 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 1tKv0n-0001JG-4N for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 Dec 2024 08:50:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKv0U-00073G-RT; Tue, 10 Dec 2024 02:50:10 -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 1tKv0N-00072g-NE for bug-gnu-emacs@gnu.org; Tue, 10 Dec 2024 02:50:04 -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 1tKv0M-0005sk-Kq for bug-gnu-emacs@gnu.org; Tue, 10 Dec 2024 02:50:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=kYE5gLvkSv8K4imE2pXMShnZlPPNeDlV5qfjSQDQwHE=; b=Ms6+RW0DZR9B3J9zMP+PTrvWxeK0/yq6yDkyPbdCAjDW7rPan4YR+k2flBAq0An5V18qGYydtoXk2Y8mr3a5moW4DnMqOTUSQPFMplsK7ngJAV+vn8DVFTsq1dFe+/5JD/2emGUey+20DIoSzWH4fe9frFUKxT4uUw+WpdEeLZzEXL/J8mC2Eq+5dw/MSpVGJOw9rNhjHLs1ZA2khILq7GDRMV3wUaIHAnntLj06PxA89rAI2ZGzi1vkpjk+qloEQy/DgfbXhC+73YcVLLMCWOSaOGZ88/fLAKzv2jpcqEJWsHb3Ny3DlbYNl0GPzyu6bDBa/qnFbZYaQNbM6pI+WA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKv0M-0000nR-7N for bug-gnu-emacs@gnu.org; Tue, 10 Dec 2024 02:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Dec 2024 07:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74287 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74287-submit@debbugs.gnu.org id=B74287.17338170003046 (code B ref 74287); Tue, 10 Dec 2024 07:50:02 +0000 Original-Received: (at 74287) by debbugs.gnu.org; 10 Dec 2024 07:50:00 +0000 Original-Received: from localhost ([127.0.0.1]:56807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKv0J-0000n3-WD for submit@debbugs.gnu.org; Tue, 10 Dec 2024 02:50:00 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:56193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKv0F-0000mS-QF for 74287@debbugs.gnu.org; Tue, 10 Dec 2024 02:49:56 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id DE30260007; Tue, 10 Dec 2024 07:49:48 +0000 (UTC) In-Reply-To: <8734iwl5kw.fsf@pengjiz.com> (Pengji Zhang's message of "Tue, 10 Dec 2024 08:55:27 +0800") X-GND-Sasl: juri@linkov.net 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:296736 Archived-At: >> So do you propose to add an internal variable that duplicates the user >> option? > > Yes, sort of. It does not fully duplicates the user option though. > Because we only need to force turning *on* history search, it is made to > override the user option only when it is non-nil. Basically, it is > something like: > > @@ -951,7 +954,8 @@ eshell--isearch-setup > (when (and > ;; Eshell is busy running a foreground process > (not eshell-foreground-command) > - (or (eq eshell-history-isearch t) > + (or eshell--force-history-isearch > + (eq eshell-history-isearch t) > (and (eq eshell-history-isearch 'dwim) > (>= (point) eshell-last-output-end)))) > (setq isearch-message-prefix-add "history ") > @@ -975,7 +979,7 @@ eshell-history-isearch-end > (remove-hook 'isearch-mode-end-hook #'eshell-history-isearch-end t) > (setq isearch-opoint (point)) > (unless isearch-suspended > - (custom-reevaluate-setting 'eshell-history-isearch))) > + (setq eshell--force-history-isearch nil))) I agree this would be the right thing, because even in Isearch we have variables that duplicate the user options such as e.g. the option 'search-invisible' and the internal variable 'isearch-invisible'.