all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Basil L. Contovounesios" <contovob@tcd.ie>
Cc: Adam Porter <adam@alphapapa.net>,  emacs-devel@gnu.org
Subject: Re: Supporting newer Emacs features in older Emacs versions without warnings?
Date: Mon, 27 Sep 2021 14:38:24 -0400	[thread overview]
Message-ID: <jwvr1d9sw9o.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ilynxowy.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 26 Sep 2021 17:49:33 +0100")

Basil L. Contovounesios [2021-09-26 17:49:33] wrote:
> Stefan Monnier [2021-09-24 09:14 -0400] wrote:
>> Can you guys come up with an idea of how to change shortdoc.el so that
>> your package can do its job more easily and cleanly?
>> [ Ideally without having to use eval-after-load nor having to require
>> shortdoc.  ]
>
> Apart from eval-after-load, what other mechanisms do we have that can
> register information before a package is loaded?  There's obarray and
> there are hooks, is there something else?

For buffer-local info, the standard way is for the amjor mode to do

    (setq-local <foo> <bar>)

Example of <foo> include `font-lock-defaults` (back when font-lock was
not enabled by default), `outline-regexp`, `imenu-generic-expression`, ...

Here I think we want something that's not buffer-local, so we'd need
something else.  Not sure what's the best option.  Maybe

    (add-hook 'shortdoc-foo-functions #'...)

?

> The entrypoint command shortdoc-display-group could, every time it is
> invoked, scan obarray for certain symbol properties, or run a hook, to
> accumulate auxiliary shortdoc forms, in addition to those that were
> already permanently stored in shortdoc--groups.

That's also an option, yes (scanning `obarray` is fairly quick).


        Stefan




  reply	other threads:[~2021-09-27 18:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  1:48 Supporting newer Emacs features in older Emacs versions without warnings? Adam Porter
2021-09-23  8:58 ` Basil L. Contovounesios
2021-09-24  6:08   ` Adam Porter
2021-09-24 13:14     ` Stefan Monnier
2021-09-24 22:22       ` Adam Porter
2021-09-26 16:49       ` Basil L. Contovounesios
2021-09-27 18:38         ` Stefan Monnier [this message]
2021-09-28 10:26           ` Basil L. Contovounesios
2021-09-28 12:51             ` Stefan Monnier
2021-09-28 17:07               ` Basil L. Contovounesios

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=jwvr1d9sw9o.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=adam@alphapapa.net \
    --cc=contovob@tcd.ie \
    --cc=emacs-devel@gnu.org \
    /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.