From: Stefan Kangas Date: Fri, 4 Oct 2024 22:17:58 +0000 (+0200) Subject: Future-proof searching for Python info manual X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f68c3712db729bd0a58a9cfe6097eefff32f06c7;p=emacs.git Future-proof searching for Python info manual * lisp/info-look.el (:mode): Python is released annually (PEP 602), so search for minor version based on the current year. (cherry picked from commit 0cca6146dc8dc2dff648dfeb7b68b56c423d90ec) --- diff --git a/lisp/info-look.el b/lisp/info-look.el index f1f730529cb..9834c6d19ba 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -974,14 +974,17 @@ Return nil if there is nothing appropriate in the buffer near point." :mode 'python-mode ;; Debian includes Python info files, but they're version-named ;; instead of having a symlink. - :doc-spec-function (lambda () - (list - (list - (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"))))) + :doc-spec-function + (lambda () + ;; Python is released annually (PEP 602). + (let ((yy (- (decoded-time-year (decode-time (current-time))) 2000))) + (list + (list + (cl-loop for version from yy 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 'perl-mode