unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Drew Adams <drew.adams@oracle.com>, 24510@debbugs.gnu.org
Subject: bug#24510: 25.1; Info: searching for ` does not find what looks like `
Date: Thu, 05 May 2022 19:20:01 +0300	[thread overview]
Message-ID: <86bkwct2ti.fsf@mail.linkov.net> (raw)
In-Reply-To: <87levitru8.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 03 May 2022 20:05:03 +0200")

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

>>> 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:


[-- Attachment #2: help-mode-search-default.patch --]
[-- Type: text/x-diff, Size: 1574 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 136 bytes --]


PS: ISTR, there was a discussion about supporting simultaneous replacements
instead of using thread-last.  Is this a work in progress?

  parent reply	other threads:[~2022-05-05 16:20 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 17:04 bug#24510: 25.1; Info: searching for ` does not find what looks like ` Drew Adams
2016-09-22 18:40 ` Eli Zaretskii
2016-09-22 19:58   ` Drew Adams
2016-09-22 20:41     ` Clément Pit--Claudel
2016-09-22 21:16       ` Drew Adams
2016-09-23  6:54     ` Eli Zaretskii
2016-09-22 20:02 ` Clément Pit--Claudel
2016-09-22 22:10 ` Noam Postavsky
2016-09-22 22:27   ` Drew Adams
2022-04-28 10:48 ` Lars Ingebrigtsen
2022-04-28 16:12   ` Drew Adams
2022-04-28 17:38   ` Juri Linkov
2022-04-28 18:15     ` Lars Ingebrigtsen
2022-04-28 19:00       ` Drew Adams
2022-04-29  6:51       ` Juri Linkov
2022-04-29 10:08         ` Lars Ingebrigtsen
2022-04-29 15:06           ` Drew Adams
2022-04-29 17:17           ` Juri Linkov
2022-04-30 11:45             ` Lars Ingebrigtsen
2022-05-01 17:11               ` Juri Linkov
2022-05-01 18:58                 ` Lars Ingebrigtsen
2022-05-02 16:12                   ` Juri Linkov
2022-05-03 10:33                     ` Lars Ingebrigtsen
2022-05-03 14:58                       ` Drew Adams
2022-05-03 17:29                       ` Juri Linkov
2022-05-03 18:05                         ` Lars Ingebrigtsen
2022-05-03 19:26                           ` Drew Adams
2022-05-05 16:20                           ` Juri Linkov [this message]
2022-05-05 16:44                             ` Drew Adams
2022-05-06 23:20                               ` Richard Stallman
2022-05-06 11:30                             ` Lars Ingebrigtsen
2022-05-06 14:40                               ` Drew Adams
2022-05-06 15:32                               ` Juri Linkov
2022-05-06 17:57                                 ` Lars Ingebrigtsen
2022-05-03 19:23                         ` Drew Adams
2022-04-29 15:01         ` Drew Adams
2022-04-28 18:58     ` Drew Adams
     [not found] <<6905ca6f-0573-4a2b-b346-d5df47862e09@default>
     [not found] ` <<83intneq2g.fsf@gnu.org>
     [not found]   ` <<7f9c8f95-a04d-4e94-9c17-8a348bf89215@default>
     [not found]     ` <<83d1jvds1t.fsf@gnu.org>
2016-09-23 16:02       ` Drew Adams
2016-09-23 17:48         ` Eli Zaretskii
2016-09-23 20:07           ` Clément Pit--Claudel
2016-09-24  7:28             ` Eli Zaretskii
2016-09-24 16:30               ` Clément Pit--Claudel
2016-09-24 17:08                 ` Eli Zaretskii
2016-09-24 17:24                   ` Clément Pit--Claudel
2016-09-24 17:57                     ` Eli Zaretskii
2016-09-24 18:14                       ` Clément Pit--Claudel
2016-09-24 18:34                         ` Eli Zaretskii
2016-09-24 18:40                           ` Clément Pit--Claudel
2016-09-24 19:16                             ` Eli Zaretskii
2016-09-24 18:14                 ` Drew Adams
     [not found] <<<6905ca6f-0573-4a2b-b346-d5df47862e09@default>
     [not found] ` <<<83intneq2g.fsf@gnu.org>
     [not found]   ` <<<7f9c8f95-a04d-4e94-9c17-8a348bf89215@default>
     [not found]     ` <<<83d1jvds1t.fsf@gnu.org>
     [not found]       ` <<c5f5356e-222a-48b0-9b80-dd242f982cec@default>
     [not found]         ` <<83mviycxse.fsf@gnu.org>
2016-09-23 21:47           ` Drew Adams
2016-09-24  7:31             ` Eli Zaretskii
2016-09-25  8:07               ` Byung-Hee HWANG (황병희,  黃炳熙)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86bkwct2ti.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=24510@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).