From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: [ELPA] Add compat.el Date: Mon, 04 Oct 2021 23:00:38 +0000 Message-ID: <87y278ieeh.fsf@posteo.net> References: <877dfavmzw.fsf@posteo.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="18356"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 05 01:06:11 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 1mXX2A-0004YK-PR for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Oct 2021 01:06:10 +0200 Original-Received: from localhost ([::1]:34046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXX29-0003Wc-IX for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Oct 2021 19:06:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXWwx-0000sx-1s for emacs-devel@gnu.org; Mon, 04 Oct 2021 19:00:48 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:42837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXWwt-0002E0-W5 for emacs-devel@gnu.org; Mon, 04 Oct 2021 19:00:46 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 1ED02240026 for ; Tue, 5 Oct 2021 01:00:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1633388441; bh=eKbC5m3PTOiHipDynNfy5580fyJ+FP+qUqRRxzDuUAE=; h=From:To:Subject:Autocrypt:Date:From; b=RyfdJmWSoL4CmFPNWbk6zioDBsIKjIiRAN7rOjGwfUgoA4uo+YwfKgSgiJ1yIuKF4 2qO+WmjdNRETtDdaniXFi1HET2viCCWZb4GciMjz6lNQ/JsMfv0NmbfwjjcLM2FUG5 ip/t6qc2VkX2YanQfPN7qWgWQw9NpMeIGEqTgyuA+ErHTdNVQI1nJRIjCx0+4lYuAk IaxI/Lns+VHTTFTG1PX1FB+tyW8zVGaH2kPJFtwoPzZ6y67/8SRNc7iPF+mBUpmWc9 6Zki5I7pMhO/zJ2rC8NDWz5MkeisLK6xlG3Qp6OktIbrhJ+Xfoi+w5j23xnd+Oda2q tWdCiA4SlIZ/w== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HNbm83hJjz6tm6 for ; Tue, 5 Oct 2021 01:00:39 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: <877dfavmzw.fsf@posteo.net> (Philip Kaludercic's message of "Tue, 21 Sep 2021 01:35:47 +0200") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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:276285 Archived-At: Hello again, I have been working on compat.el over the last week, and have written a number of tests. The source code has been uploaded here: https://git.sr.ht/~pkal/compat The library should be usable in it's current state, but I'd be interested to hear from other people and developers too. There might be missing functions or macros, edge cases that could be added to the tests, etc. that could be improved. Finally, compat.el now ends with these lines: --8<---------------cut here---------------start------------->8--- ;; ;;;; Ensure NonGNU ELPA is in `package-archives' ;; (with-eval-after-load 'package ;; (unless (or (rassoc "https://elpa.nongnu.org/nongnu/" package-archives) ;; (rassoc "http://elpa.nongnu.org/nongnu/" package-archives) ;; (rassoc "https://elpa.nongnu.org/nongnu-devel/" package-archives) ;; (rassoc "http://elpa.nongnu.org/nongnu-devel/" package-archives)) ;; (add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/")))) ;; To ensure that compat.el is loaded as soon as possible, a require ;; call is inserted directly into the autoload file: ;;;###autoload (require 'compat) --8<---------------cut here---------------end--------------->8--- The first block ensures that NonGNU ELPA is added to package-archives, in the hope that if ELPA packages were to use compat.el, older versions would automatically be configured to use NonGNU ELPA. The upside is wider adoption, the downside is that this is pretty invasive (an alternative would be to check if package-archives is unmodified, and only update it in that case). The second block would automatically require compat.el in the autoload file, so as to avoid manual (require 'compat) statements in packages that use the library. I haven't tested this part extensively yet, but could there be something that this might break? Philip Kaludercic writes: > Hi, > > over the last few days I have been working on a forwards-compatibility > library for Emacs, here is a first iteration: > > The idea is to allow developers who don't want to break backwards > compatibility to use newer functionality that wasn't provided in older > versions of Emacs. This version tries to implement as much as possible > from Emacs 24.2 onwards. > > [...] -- Philip Kaludercic