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#24510: 25.1; Info: searching for ` does not find what looks like ` Date: Thu, 05 May 2022 19:20:01 +0300 Organization: LINKOV.NET Message-ID: <86bkwct2ti.fsf@mail.linkov.net> References: <6905ca6f-0573-4a2b-b346-d5df47862e09@default> <87zgk5mqkm.fsf@gnus.org> <86levp6rce.fsf@mail.linkov.net> <8735hxjcqj.fsf@gnus.org> <86fslwxuxe.fsf@mail.linkov.net> <87pml0gq1p.fsf@gnus.org> <86bkwjvmwg.fsf@mail.linkov.net> <874k2a4wwl.fsf@gnus.org> <86y1zlgou1.fsf@mail.linkov.net> <87ee1dcc5y.fsf@gnus.org> <865ymnrk01.fsf@mail.linkov.net> <877d72zyzt.fsf@gnus.org> <86leviilvy.fsf@mail.linkov.net> <87levitru8.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40318"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Drew Adams , 24510@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 05 18:50:49 2022 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 1nmegj-000ANT-R1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 May 2022 18:50:49 +0200 Original-Received: from localhost ([::1]:56280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmegi-0006xd-QR for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 May 2022 12:50:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmeVK-0001KA-Gk for bug-gnu-emacs@gnu.org; Thu, 05 May 2022 12:39:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52447) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nmeVK-0002ZJ-5E for bug-gnu-emacs@gnu.org; Thu, 05 May 2022 12:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nmeVK-0007fA-0v for bug-gnu-emacs@gnu.org; Thu, 05 May 2022 12:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 May 2022 16:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24510 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 24510-submit@debbugs.gnu.org id=B24510.165176873229412 (code B ref 24510); Thu, 05 May 2022 16:39:01 +0000 Original-Received: (at 24510) by debbugs.gnu.org; 5 May 2022 16:38:52 +0000 Original-Received: from localhost ([127.0.0.1]:46338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nmeV9-0007eJ-MX for submit@debbugs.gnu.org; Thu, 05 May 2022 12:38:51 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:40011) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nmeV7-0007e3-UM for 24510@debbugs.gnu.org; Thu, 05 May 2022 12:38:50 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id A2ED1FF80A; Thu, 5 May 2022 16:38:42 +0000 (UTC) In-Reply-To: <87levitru8.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 03 May 2022 20:05:03 +0200") 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:231447 Archived-At: --=-=-= Content-Type: text/plain >>> No, I want the default Isearch to fold `' with the fancy variants in >>> these modes. :-) >> >> So the users will have no way to search for ' literally? > > Yes, I don't think anybody would want to. But like I said, I'd prefer > if it was possible to have this as a minor mode so that people could > switch it off (even if they probably won't want to). If you are sure about this, here is the simplest way to implement it, and the users can disable it easily in help-mode-hook: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=help-mode-search-default.patch Content-Transfer-Encoding: 8bit diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 94bd591131..4ad8e36070 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -414,6 +414,13 @@ help-mode (setq-local tool-bar-map help-mode-tool-bar-map) (setq-local help-mode--current-data nil) + (unless search-default-mode + (setq-local search-default-mode + (lambda (string &optional _lax) + (thread-last + (regexp-quote string) + (replace-regexp-in-string "`" "[`‘]") + (replace-regexp-in-string "'" "['’]"))))) (setq-local bookmark-make-record-function #'help-bookmark-make-record)) diff --git a/lisp/info.el b/lisp/info.el index abfb77b055..7e0d4f646f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4487,6 +4487,14 @@ Info-mode (setq-local isearch-wrap-function #'Info-isearch-wrap) (setq-local isearch-push-state-function #'Info-isearch-push-state) (setq-local isearch-filter-predicate #'Info-isearch-filter) + (unless search-default-mode + (setq-local search-default-mode + (lambda (string &optional _lax) + (thread-last + (regexp-quote string) + (replace-regexp-in-string "`" "[`‘]") + (replace-regexp-in-string "'" "['’]") + (replace-regexp-in-string "\"" "[\"“”]"))))) (setq-local revert-buffer-function #'Info-revert-buffer-function) (setq-local font-lock-defaults '(Info-mode-font-lock-keywords t t)) (Info-set-mode-line) --=-=-= Content-Type: text/plain PS: ISTR, there was a discussion about supporting simultaneous replacements instead of using thread-last. Is this a work in progress? --=-=-=--