From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: master 4e4b76b: Make info-look try to use more recent Python manual
Date: Fri, 13 Aug 2021 13:46:36 +0200 [thread overview]
Message-ID: <87h7ftftyb.fsf@gnus.org> (raw)
In-Reply-To: <jwv35rey57d.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 12 Aug 2021 12:56:23 -0400")
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
next prev parent reply other threads:[~2021-08-13 11:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210812152043.24248.62809@vcs0.savannah.gnu.org>
[not found] ` <20210812152044.4811020997@vcs0.savannah.gnu.org>
2021-08-12 16:20 ` master 4e4b76b: Make info-look try to use more recent Python manual Stefan Monnier
2021-08-12 16:24 ` Lars Ingebrigtsen
2021-08-12 16:56 ` Stefan Monnier
2021-08-13 11:46 ` Lars Ingebrigtsen [this message]
2021-08-21 14:02 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h7ftftyb.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.