all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#66554: [PATCH] Add the public API of Compat to the core
@ 2023-10-15  9:35 Philip Kaludercic
  2024-01-10 22:02 ` Stefan Kangas
  0 siblings, 1 reply; 75+ messages in thread
From: Philip Kaludercic @ 2023-10-15  9:35 UTC (permalink / raw)
  To: 66554

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

Tags: patch


See https://lists.gnu.org/archive/html/emacs-devel/2023-10/msg00260.html
for the background behind this proposal.


In GNU Emacs 30.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.16.0) of 2023-10-13 built on quetzal
Repository revision: 97959349651a8fb170c1c754e73a4d86ed24d018
Repository branch: master
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --with-pgtk --with-imagemagick --with-tree-sitter'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-the-public-API-of-Compat-to-the-core.patch --]
[-- Type: text/patch, Size: 3834 bytes --]

From 9ab5748d0e93c84c36c5559a4cda2087b3a24560 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Wed, 13 Sep 2023 12:26:22 +0200
Subject: [PATCH] Add the public API of Compat to the core

* lisp/emacs-lisp/compat.el: Add stub file with minimal definitions,
so that core packages, that haven't been installed from ELPA, can make
use of the public API and use more recent function signatures.
* lisp/progmodes/python.el (compat): Remove 'noerror flag, because
Compat can now be required without the real package being available.
---
 lisp/emacs-lisp/compat.el | 61 +++++++++++++++++++++++++++++++++++++++
 lisp/progmodes/python.el  |  2 +-
 2 files changed, 62 insertions(+), 1 deletion(-)
 create mode 100644 lisp/emacs-lisp/compat.el

diff --git a/lisp/emacs-lisp/compat.el b/lisp/emacs-lisp/compat.el
new file mode 100644
index 00000000000..4c60093b6be
--- /dev/null
+++ b/lisp/emacs-lisp/compat.el
@@ -0,0 +1,61 @@
+;;; compat.el --- Pseudo-Compatibility for Elisp -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021-2023 Free Software Foundation, Inc.
+
+;; Author:								\
+;;   Philip Kaludercic <philipk@posteo.net>,				\
+;;   Daniel Mendler <mail@daniel-mendler.de>
+;; Maintainer:								\
+;;   Daniel Mendler <mail@daniel-mendler.de>,				\
+;;   Compat Development <~pkal/compat-devel@lists.sr.ht>,
+;;   emacs-devel@gnu.org
+;; URL: https://github.com/emacs-compat/compat
+;; Version: 1.0
+;; Keywords: lisp, maint
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; The Compat package on ELPA provides forward-compatibility
+;; definitions for other packages.  While mostly transparent, a
+;; minimal API is necessary whenever core definitions change calling
+;; conventions (e.g. `plist-get' can be invoked with a predicate from
+;; Emacs 29.1 onward).  For core packages on ELPA to be able to take
+;; advantage of this functionality, the macros `compat-function' and
+;; `compat-call' have to be available in the core, usable even if
+;; users do not have the Compat package installed, which this file
+;; ensures.
+
+;; Note that Compat is not a core package and this file is not
+;; available on GNU ELPA.
+
+;;; Code:
+
+(defmacro compat-function (fun)
+  "Return compatibility function symbol for FUN.
+This is a pseudo-compatibility stub for core packages on ELPA,
+that depend on the Compat package, whenever the user doesn't have
+the package installed on their current system."
+  `#',fun)
+
+(defmacro compat-call (fun &rest args)
+  "Call compatibility function or macro FUN with ARGS.
+This is a pseudo-compatibility stub for core packages on ELPA,
+that depend on the Compat package, whenever the user doesn't have
+the package installed on their current system."
+  (cons fun args))
+
+(provide 'compat)
+;;; compat.el ends here
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 4b940b3f13b..bf0e27bc786 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -264,7 +264,7 @@
 (eval-when-compile (require 'subr-x))   ;For `string-empty-p' and `string-join'.
 (require 'treesit)
 (require 'pcase)
-(require 'compat nil 'noerror)
+(require 'compat)
 (require 'project nil 'noerror)
 (require 'seq)
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 75+ messages in thread

end of thread, other threads:[~2024-02-11 21:52 UTC | newest]

Thread overview: 75+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-15  9:35 bug#66554: [PATCH] Add the public API of Compat to the core Philip Kaludercic
2024-01-10 22:02 ` Stefan Kangas
2024-01-11  5:27   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11  7:54     ` Philip Kaludercic
2024-01-11  8:06       ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11 17:35         ` Philip Kaludercic
2024-01-11 17:58           ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11 19:24             ` Philip Kaludercic
2024-01-11 20:11               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11 20:24                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11 20:43                   ` Philip Kaludercic
2024-01-11 21:01                     ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12 16:29                       ` Philip Kaludercic
2024-01-12 18:05                         ` Eli Zaretskii
2024-01-12 18:17                           ` Philip Kaludercic
2024-01-12 18:29                             ` Eli Zaretskii
2024-01-12 18:40                               ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12 20:05                                 ` Eli Zaretskii
2024-01-12 22:27                                   ` Philip Kaludercic
2024-01-13  6:44                                     ` Eli Zaretskii
2024-01-13 12:23                                       ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-18 19:51                                         ` Philip Kaludercic
2024-01-18 20:17                                           ` Eli Zaretskii
2024-01-18 20:33                                             ` Stefan Kangas
2024-01-19  6:40                                               ` Eli Zaretskii
2024-01-19  6:52                                                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-18 20:35                                             ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-19  6:43                                               ` Eli Zaretskii
2024-01-19  6:57                                                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-19 16:44                                                 ` Philip Kaludercic
2024-01-19 18:50                                                   ` Eli Zaretskii
2024-01-24  6:23                                                   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-26  7:58                                                     ` Philip Kaludercic
2024-01-26 10:42                                                       ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-26 12:35                                                         ` Eli Zaretskii
2024-02-01 15:53                                                           ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-02  8:11                                                         ` Philip Kaludercic
2024-02-02 12:36                                                           ` Eli Zaretskii
2024-02-06 19:10                                                             ` Philip Kaludercic
2024-02-06 19:37                                                               ` Eli Zaretskii
2024-02-06 19:59                                                                 ` Philip Kaludercic
2024-02-07 17:15                                                                   ` Philip Kaludercic
2024-02-07 17:31                                                                     ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-07 17:43                                                                     ` Eli Zaretskii
2024-02-08  7:40                                                                       ` Philip Kaludercic
2024-02-08  8:21                                                                         ` Eli Zaretskii
2024-02-08 10:47                                                                           ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10 16:29                                                                           ` Philip Kaludercic
2024-02-10 16:36                                                                             ` Eli Zaretskii
2024-02-10 16:46                                                                               ` Philip Kaludercic
2024-02-10 17:20                                                                                 ` Eli Zaretskii
2024-02-10 17:40                                                                                   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10 17:47                                                                                     ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10 18:03                                                                                       ` Eli Zaretskii
2024-02-10 18:00                                                                                     ` Eli Zaretskii
2024-02-10 18:14                                                                                       ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10 19:12                                                                                         ` Eli Zaretskii
2024-02-11 21:52                                                                                 ` Philip Kaludercic
2024-01-18 20:47                                             ` Philip Kaludercic
2024-01-19  6:47                                               ` Eli Zaretskii
2024-01-18 20:18                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-18 20:41                                             ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-18 23:34                                               ` Stefan Kangas
2024-01-19  5:49                                                 ` Philip Kaludercic
2024-01-19  6:42                                                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12  8:10                     ` Eli Zaretskii
2024-01-11 20:24                 ` Philip Kaludercic
2024-01-11 20:40                   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12  7:32                   ` Eli Zaretskii
2024-01-12  7:38                     ` Philip Kaludercic
2024-01-12 11:54                       ` Eli Zaretskii
2024-01-11 10:32   ` Eli Zaretskii
2024-01-11 19:35     ` Stefan Kangas
2024-01-11 20:07       ` Philip Kaludercic
2024-01-12  7:12         ` Eli Zaretskii

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.