GNU bug report logs - #24510
25.1; Info: searching for ` does not find what looks like `

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Thu, 22 Sep 2016 17:05:01 UTC

Severity: minor

Tags: moreinfo

Found in versions 25.1, 24.5

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Drew Adams <drew.adams <at> oracle.com>, 24510 <at> 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
[Message part 1 (text/plain, inline)]
>>> 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:

[help-mode-search-default.patch (text/x-diff, inline)]
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)
[Message part 3 (text/plain, inline)]
PS: ISTR, there was a discussion about supporting simultaneous replacements
instead of using thread-last.  Is this a work in progress?

This bug report was last modified 3 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.