emacs-devel
[Top][All Lists]
Advanced

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

Re: master 4e4b76b: Make info-look try to use more recent Python manual


From: Lars Ingebrigtsen
Subject: Re: master 4e4b76b: Make info-look try to use more recent Python manual
Date: Fri, 13 Aug 2021 13:46:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> That's what I mean by "could": provide some way for python.el to give
> the needed info to `info-look` but without eagerly loading `info-look`.
> E.g. by adding the info to a buffer-local var later consulted by `info-look`.

Yup; that'd work.  The stuff that info-look requires, though, is
pretty...  er...  convoluted.  Example:

(info-lookup-maybe-add-help
 :mode 'perl-mode
 :regexp "[$@%][^a-zA-Z]\\|\\$\\^[A-Z]\\|[$@%]?[a-zA-Z][_a-zA-Z0-9]*"
 :doc-spec '(("(perl5)Function Index"
              (lambda (item)
                (if (string-match "^\\([a-zA-Z0-9]+\\)" item)
                    (match-string 1 item)))
              "^" "\\b")
             ("(perl5)Variable Index"
              (lambda (item)
                ;; Work around bad formatted array variables.
                (let ((sym (cond ((or (string-match "^\\$\\(.\\|@@\\)$" item)
                                      (string-match "^\\$\\^[A-Z]$" item))
                                  item)
                                 ((string-match
                                   "^\\([$%@]\\|@@\\)?[_a-zA-Z0-9]+" item)
                                  (match-string 0 item))
                                 (t ""))))
                  (if (string-match "@@" sym)
                      (setq sym (concat (substring sym 0 (match-beginning 0))
                                        (substring sym (1- (match-end 0))))))
                  (if (string-equal sym "") nil sym)))
              "^" "\\b"))
 :parse-rule "[$@%]?\\([_a-zA-Z0-9]+\\|[^a-zA-Z]\\)")

I'm not sure the maintainer for foo-mode can be expected to understand
any of this stuff (so it's an info-look.el internal thing), but on the
other hand, these days that doesn't make much difference.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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