Function: compat-function
compat-function is a macro defined in compat.el.gz.
Signature
(compat-function FUN)
Documentation
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.
Aliases
erc-compat-function (obsolete since 30.1)
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/compat.el.gz
;;; compat.el --- Stub of the Compatibility Library -*- lexical-binding: t; -*-
;; Copyright (C) 2021-2025 Free Software Foundation, Inc.
;; Author: Philip Kaludercic <philipk@posteo.net>,
;; Daniel Mendler <mail@daniel-mendler.de>
;; Maintainers: 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.
;;; 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)