[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 70ed788d8d 2/2: compat: Improve docstrings
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 70ed788d8d 2/2: compat: Improve docstrings |
Date: |
Wed, 18 Jan 2023 03:57:29 -0500 (EST) |
branch: externals/compat
commit 70ed788d8dd4ee1fcb7e73193c5016ea81edf24e
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
compat: Improve docstrings
---
compat.el | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/compat.el b/compat.el
index 6c591588b4..730604c870 100644
--- a/compat.el
+++ b/compat.el
@@ -56,14 +56,23 @@ returns the symbol of a compatibility function which
supports the
behavior and calling convention of the current stable Emacs
version. For example Compat 29.1 will provide compatibility
functions which implement the behavior and calling convention of
-Emacs 29.1."
+Emacs 29.1.
+
+An example is the function `plist-get' which got an additional
+predicate argument in Emacs 29. The compatibility function,
+which supports this additional argument can be obtained
+via (compat-function plist-get) and called with the additional
+predicate argument via (compat-call plist-get plist prop
+predicate). It is not possible to directly call (plist-get plist
+prop predicate), since the function does not yet support the
+predicate argument on older Emacs versions and the Compat library
+does not override existing functions."
(let ((compat (intern (format "compat--%s" fun))))
`#',(if (fboundp compat) compat fun)))
(defmacro compat-call (fun &rest args)
"Call compatibility function or macro FUN with ARGS.
-
-See `compat-function' for the compatibility function resolution."
+See `compat-function' for details."
(let ((compat (intern (format "compat--%s" fun))))
`(,(if (fboundp compat) compat fun) ,@args)))