From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Supporting newer Emacs features in older Emacs versions without warnings? Date: Mon, 27 Sep 2021 14:38:24 -0400 Message-ID: References: <87ee9gjc4p.fsf@alphapapa.net> <87zgs3hdm6.fsf@tcd.ie> <8735pucxou.fsf@alphapapa.net> <87ilynxowy.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37103"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Adam Porter , emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 27 20:40:57 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mUvYf-0009Pr-He for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Sep 2021 20:40:57 +0200 Original-Received: from localhost ([::1]:35364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUvYd-0006rr-M9 for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Sep 2021 14:40:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUvWt-0005p6-FY for emacs-devel@gnu.org; Mon, 27 Sep 2021 14:39:07 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43157) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUvWq-0007mU-O2 for emacs-devel@gnu.org; Mon, 27 Sep 2021 14:39:06 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 30539441501; Mon, 27 Sep 2021 14:39:03 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C447E441071; Mon, 27 Sep 2021 14:39:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1632767941; bh=IQjKEBq9nBsYXx0L2jBkiQzjTFI5f4aeEufBsdv8tUw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ai/9MVCxkEPDTqZ9w2dQKSaulMrFGpUS3b2QGs3sXxVn0HN9ulxSJcyv2cZmLskY8 sue+oOf9mZbKMxXF72WujrVRcro2gHS01M9GJTyzgi+lU8FlWzOI4/SIbOK9LLrOpX BpN13XKPiqRwFuA2NPpvn+RmuKWzu5XaZjhGmDBeTsJc6hWl50imwxS82gUzRKakrv iLX2dFHItrKEVJUkc7CDJ9Se28rTDgA+HyOQf0R+CNjXa6ZIRifWKFrJni0/9VVVMJ zFmnlWfVIJZfMO4/8VRdpeUIYylM4ZnjxsEjxDLoOT11V1fr+LShFveFxsUxRdVwI5 mcyjlwKeuiCkQ== Original-Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9A13C1202F4; Mon, 27 Sep 2021 14:39:01 -0400 (EDT) In-Reply-To: <87ilynxowy.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 26 Sep 2021 17:49:33 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275604 Archived-At: 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 ) Example of 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