Subject: bug#45839: 28.0.50; Isearch and transient mode wierd behaviour in info-mode!

From: Juri Linkov <[email-masked]>
Date: Thu, 14 Jan 2021 11:20:27 +0200

>> Please see in the function 'Info-search' that it intentionally
>> deactivates the active region during the search by calling:
>>
>>   (deactivate-mark)
>>
>> This is because when the search arrives in another Info node,
>> then region highlighting breaks - the region's beginning stays
>> in the previous node, while the region's end moves to the next node.
>> To avoid such situation, it deactivates the active region.
>
> FWIW, Info+ doesn't have this problem.  It deactivates
> the mark only when search moves to another node.

But this doesn't mean that info.el should not be fixed.
Here is the fix:

diff --git a/lisp/info.el b/lisp/info.el
index 62d7b583ff..dec93928b3 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1973,7 +1973,6 @@ Info-search
                        "Regexp search%s" (car Info-search-history)
 		       (if case-fold-search "" " case-sensitively"))
 		      nil 'Info-search-history)))
-  (deactivate-mark)
   (when (equal regexp "")
     (setq regexp (car Info-search-history)))
   (when regexp
@@ -2066,6 +2065,7 @@ Info-search
                (< found opoint-max))
           ;; Search landed in the same node
           (goto-char found)
+        (deactivate-mark)
         (widen)
         (goto-char found)
         (save-match-data (Info-select-node)))