unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
blob 2882974cf2d2e2c46df46d1d55b36bc82e02be68 4076 bytes (raw)
name: lisp/emacs-lisp/compat.el 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
 
;;; compat.el --- Pseudo-Compatibility for Elisp -*- lexical-binding: t; -*-

;; Copyright (C) 2021-2024 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
;; 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.

;; A basic introduction to Compat is given in the Info node `(elisp)
;; Forwards Compatibility'.  Further details on Compat are documented
;; in the Info node `(compat) Top' (installed along with the Compat
;; package) or read the same manual online:
;; https://elpa.gnu.org/packages/doc/compat.html.

;; 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))

;;;; Clever trick to avoid installing Compat if not necessary

;; The versioning scheme of the Compat package follows that of Emacs,
;; to indicate what version of Emacs is being supported.  For example,
;; the Compat version number 29.2.3.9 would attempt to provide
;; compatibility definitions up to Emacs 29.2, while also designating
;; that this is the third major release and ninth minor release of
;; Compat, for the specific Emacs release.

;; The package version of this file is specified programmatically,
;; instead of giving a fixed version in the header of this file.  This
;; is done to ensure that the version of compat.el provided by Emacs
;; is always corresponds to the current version of Emacs.  In addition
;; to the major-minor version, a large "major release" makes sure that
;; the built-in version of Compat is always preferred over an external
;; installation.  This means that if a package specifies a dependency
;; on Compat which matches the current version of Emacs that is being
;; used, no additional dependencies have to be downloaded.
;;
;; Further details and background on this file can be found in the
;; bug#66554 discussion.

;;;###autoload (push (list 'compat
;;;###autoload             emacs-major-version
;;;###autoload             emacs-minor-version
;;;###autoload             1.0e+INF)
;;;###autoload       package--builtin-versions)

(provide 'compat)
;;; compat.el ends here

debug log:

solving 2882974cf2d ...
found 2882974cf2d in https://yhetil.org/emacs-bugs/871qa47ch1.fsf@posteo.net/

applying [1/1] https://yhetil.org/emacs-bugs/871qa47ch1.fsf@posteo.net/
diff --git a/lisp/emacs-lisp/compat.el b/lisp/emacs-lisp/compat.el
new file mode 100644
index 00000000000..2882974cf2d

Checking patch lisp/emacs-lisp/compat.el...
Applied patch lisp/emacs-lisp/compat.el cleanly.

index at:
100644 2882974cf2d2e2c46df46d1d55b36bc82e02be68	lisp/emacs-lisp/compat.el

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).