Subject: Re: bug#24510: 25.1; Info: searching for ` does not find what looks like `

From: Juri Linkov <[email-masked]>
Date: Fri, 29 Apr 2022 09:51:09 +0300

>> It's possible to enable char-fold search only in Info mode,
>> but probably this should be left for user customization,
>> because this problem is not Info-specific: most likely the user
>> might want ` and ‘ to be treated equivalently pretty much everywhere.
>
> My thorough research shows that 99.7% of Emacs users don't see a ‘
> outside of *Help* and *info*, so doing something special there seems
> useful.
>
>> But still if the user want this only in Info, it's very easy to type
>> C-s M-s ' `list.
>
> That does more than just fold `' with ‘’, though.

So only folding `' with ‘’ is required?  Then it's easy to do:

diff --git a/lisp/info.el b/lisp/info.el
index 8ca6c54979..656a3b0b11 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -41,7 +41,9 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl-lib))
+(eval-when-compile
+  (require 'cl-lib)
+  (require 'subr-x))
 
 (defgroup info nil
   "Info subsystem."
@@ -2147,7 +2149,10 @@ Info-isearch-search
 		   (funcall isearch-regexp-function string lax)
 		 (word-search-regexp string lax))))
 	    (isearch-regexp string)
-	    (t (regexp-quote string)))
+	    (t (thread-last
+		 (regexp-quote string)
+		 (replace-regexp-in-string "`" "[`‘]")
+		 (replace-regexp-in-string "'" "['’]"))))
 	   bound noerror count
 	   (unless isearch-forward 'backward)))
 	(point))