From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Dealing with obsoletion warnings in non-core code Date: Mon, 28 Sep 2020 22:00:22 +0300 Message-ID: <83h7rhloah.fsf@gnu.org> References: <20200928143540.GB1002@odonien.localdomain> <83imbxlqc6.fsf@gnu.org> <20200928183457.GC1002@odonien.localdomain> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17959"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Vasilij Schneidermann Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 28 21:01:42 2020 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 1kMyP8-0004Yh-6I for ged-emacs-devel@m.gmane-mx.org; Mon, 28 Sep 2020 21:01:42 +0200 Original-Received: from localhost ([::1]:59470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMyP7-0007lY-55 for ged-emacs-devel@m.gmane-mx.org; Mon, 28 Sep 2020 15:01:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMyO6-0007Fe-FP for emacs-devel@gnu.org; Mon, 28 Sep 2020 15:00:38 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50361) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMyO4-0005oa-JR; Mon, 28 Sep 2020 15:00:36 -0400 Original-Received: from [176.228.60.248] (port=3412 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kMyO3-0002Id-1X; Mon, 28 Sep 2020 15:00:35 -0400 In-Reply-To: <20200928183457.GC1002@odonien.localdomain> (message from Vasilij Schneidermann on Mon, 28 Sep 2020 20:34:57 +0200) 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:256635 Archived-At: > Date: Mon, 28 Sep 2020 20:34:57 +0200 > From: Vasilij Schneidermann > Cc: Stefan Monnier , emacs-devel@gnu.org > > > (if (> emacs-major-version NN) > > (defun recommended-function (...) > > ...)) > > You don't want a third-party package defining a potentially > non-conformant version of future built-in functionality We've been using such shims in packages that supported both Emacs and XEmacs, for eons. I don't see how it's suddenly so wrong. > (for example if they take the definition from a specific Emacs > version and it changes in another one) That's a separate problem, and will happen even if you only support versions where the function is available. It's why we try very hard not to make backward-incompatible changes in public APIs. > Besides, isn't the logic the wrong way around? The recommended function > is something available in a newer Emacs version, so you'd test for an > older one and if the check is positive, define the shim. You assume that the older one is removed? That usually doesn't happen. > Assuming you can even, some functionality cannot be backported that > easily. If the functionality cannot be had at all, there's no problem: just provide a no-op function by that name. Anyway, you asked how to avoid warning messages, and I suggested a way which should do that. If that's not what you want, fine; I tried to help you.