From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: Supporting newer Emacs features in older Emacs versions without warnings? Date: Fri, 24 Sep 2021 17:22:23 -0500 Message-ID: <87fsttbom8.fsf@alphapapa.net> References: <87ee9gjc4p.fsf@alphapapa.net> <87zgs3hdm6.fsf@tcd.ie> <8735pucxou.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8396"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 25 00:23:20 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 1mTtbD-0001x0-23 for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Sep 2021 00:23:19 +0200 Original-Received: from localhost ([::1]:51326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTtbB-00069d-Em for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Sep 2021 18:23:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTtaX-0005To-9h for emacs-devel@gnu.org; Fri, 24 Sep 2021 18:22:37 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:53734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTtaV-0007qn-Gm for emacs-devel@gnu.org; Fri, 24 Sep 2021 18:22:37 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mTtaQ-0000xu-7H for emacs-devel@gnu.org; Sat, 25 Sep 2021 00:22:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:275434 Archived-At: Stefan Monnier writes: > 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. ] Well, I guess we could do something like: (ignore-errors (declare-function shortdoc-add-function ...) (shortdoc-add-function ...)) But that would still produce compilation warnings on pre-shortdoc Emacsen. And what if shortdoc isn't loaded yet? (Is it always loaded by default, before packages are initialized?) ISTM that the general problem is how to support newer Emacs features on older Emacs versions. If we had some kind of optional-compilation form, I guess it would help with that (e.g. we can already use (when...) in a top-level form, but that doesn't prevent compilation of the code, and `cl-eval-when' only has three choices, not user-defined ones). So some kind of `compile-when' or `eval-and-compile-when', in which the user could specify a test form, might be helpful (or maybe that idea's too crazy, I don't know). It might also help with supporting optional packages, e.g. in some packages of mine that support Helm, I have to break out just a few forms into a separate package to avoid warnings and errors (even a small mistake can cause errors at init time, which greatly confuse users). That's not a big deal, but every extra package is more work for maintainers, and for users (who have to discover that it even exists before they can use it).