Subject: bug#71314: closed (Re: bug#71314: [PATCH] info-lookup-symbol does not work in python-mode)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 08 Jun 2024 12:26:02 +0000

Your bug report

#71314: [PATCH] info-lookup-symbol does not work in python-mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
71314: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71314
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#71314: [PATCH] info-lookup-symbol does not work in python-mode
From: Eli Zaretskii <[email-masked]>
To: James Thomas <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 08 Jun 2024 15:24:43 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Cc: [email-masked]
> Date: Sun, 02 Jun 2024 06:15:48 +0530
> From:  James Thomas via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> - Make sure python info docs are installed (in Debian-derivatives, 'sudo
>   apt install python3-doc')
> - emacs -Q
> - Open a buffer test.py and type: print
> - C-h S fails, even after typing RET, but...
> 
> - Then do info-lookup-reset, and the previous step works.
> 
> Here's a possible patch, which hasn't been tested as much as needed:

Thanks, installed on master, and closing the bug.

Subject: [PATCH] info-lookup-symbol does not work in python-mode
From: James Thomas <[email-masked]>
To: [email-masked]
Date: Sun, 02 Jun 2024 06:15:48 +0530
List-Id: <debbugs-submit.debbugs.gnu.org>

- Make sure python info docs are installed (in Debian-derivatives, 'sudo
  apt install python3-doc')
- emacs -Q
- Open a buffer test.py and type: print
- C-h S fails, even after typing RET, but...

- Then do info-lookup-reset, and the previous step works.

Here's a possible patch, which hasn't been tested as much as needed:

From 81b3a7b0c2be3c974729d1a4ffc44351d5393a45 Mon Sep 17 00:00:00 2001
From: James Thomas <[email-masked]>
Date: Sun, 2 Jun 2024 05:59:35 +0530
Subject: [PATCH] Check for doc-spec-function early, in interactive

* lisp/info-look.el (info-lookup-interactive-arguments):
Move here.
(info-lookup): From here.
---
 lisp/info-look.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/info-look.el b/lisp/info-look.el
index cd59fdf17d7..2baf133c7d3 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -327,8 +327,11 @@ info-lookup-interactive-arguments
 If optional argument QUERY is non-nil, query for the help mode."
   (let* ((mode (cond (query
 		      (info-lookup-change-mode topic))
-		     ((info-lookup->mode-value topic (info-lookup-select-mode))
-		      info-lookup-mode)
+		     ((when-let
+                          ((info (info-lookup->mode-value
+                                  topic (info-lookup-select-mode))))
+                        (info-lookup--expand-info info))
+                      info-lookup-mode)
 		     ((info-lookup-change-mode topic))))
 	 (completions (info-lookup->completions topic mode))
 	 (default (info-lookup-guess-default topic mode))
@@ -404,9 +407,6 @@ info-lookup
 different window."
   (or mode (setq mode (info-lookup-select-mode)))
   (setq mode (info-lookup--item-to-mode item mode))
-  (if-let ((info (info-lookup->mode-value topic mode)))
-      (info-lookup--expand-info info)
-    (error "No %s help available for `%s'" topic mode))
   (let* ((completions (info-lookup->completions topic mode))
          (ignore-case (info-lookup->ignore-case topic mode))
          (entry (or (assoc (if ignore-case (downcase item) item) completions)
--
2.40.1

--