emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 711eb40: Make info-look search harder for the Python info file


From: Lars Ingebrigtsen
Subject: master 711eb40: Make info-look search harder for the Python info file
Date: Fri, 13 Aug 2021 07:38:47 -0400 (EDT)

branch: master
commit 711eb40b9b9e2aabd0e23ec264e8e8f913329d33
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make info-look search harder for the Python info file
    
    * lisp/info-look.el (python-mode): Try harder to find the correct
    info file (bug#31405).
---
 lisp/info-look.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/info-look.el b/lisp/info-look.el
index 19c5537..33f15a3 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -43,6 +43,7 @@
 
 (require 'info)
 (eval-when-compile (require 'subr-x))
+(eval-when-compile (require 'cl-lib))
 
 (defgroup info-lookup nil
   "Major mode sensitive help agent."
@@ -902,9 +903,13 @@ Return nil if there is nothing appropriate in the buffer 
near point."
 
 (info-lookup-maybe-add-help
  :mode 'python-mode
- :doc-spec `((,(if (Info-find-file "python3.9" t)
-                   "(python3.9)Index"
-                 "(python)Index"))))
+ ;; Debian includes Python info files, but they're version-named
+ ;; instead of having a symlink.
+ :doc-spec `((,(cl-loop for version from 20 downto 7
+                        for name = (format "python3.%d" version)
+                        if (Info-find-file name t)
+                        return (format "(%s)Index" name)
+                        finally return "(python)Index"))))
 
 (info-lookup-maybe-add-help
  :mode 'cperl-mode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]