branch: externals-release/org
commit eb8c1fff8f016d6eb93416aed462ac9de65df31a
Author: Catsup4 <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    ol-man: restore `::STRING' searching
    
    * ol-man.el (org-man-open): The optional `::STRING' portion of man
    page links was not being used.  This change restores that
    functionality.
    
    The issue is that the capture groups from the `string-match' call are
    being reset before `search' is saved to a variable, resulting in
    search always being nil.
    
    TINYCHANGE
---
 lisp/ol-man.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ol-man.el b/lisp/ol-man.el
index facc3e2ee1..d8a4a7c230 100644
--- a/lisp/ol-man.el
+++ b/lisp/ol-man.el
@@ -52,7 +52,8 @@ If PATH contains extra ::STRING which will use `occur' to 
search
 matched strings in man buffer."
   (require 'man) ; For `Man-translate-references'
   (string-match "\\(.*?\\)\\(?:::\\(.*\\)\\)?$" path)
-  (let* ((command (match-string 1 path))
+  (let* ((search (match-string 2 path))
+         (command (match-string 1 path))
          ;; FIXME: Remove after we drop Emacs 29 support.
          ;; Working around security bug #66390.
          (command (if (not (equal (Man-translate-references ";id") ";id"))
@@ -65,7 +66,6 @@ matched strings in man buffer."
                                (mapcar #'shell-quote-argument
                                        (split-string command "\\s-+"))
                                " ")))
-         (search (match-string 2 path))
          (buffer (funcall org-man-command command)))
     (when search
       (with-current-buffer buffer

Reply via email to