[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 9bcc02a8ef 05/14: Make some compat-macs function
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 9bcc02a8ef 05/14: Make some compat-macs functions private |
Date: |
Tue, 3 Jan 2023 10:57:28 -0500 (EST) |
branch: externals/compat
commit 9bcc02a8ef4cf1078a85607856733d2a86458865
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Make some compat-macs functions private
---
compat-macs.el | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/compat-macs.el b/compat-macs.el
index 9a74c87e51..63f71e0cec 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -138,16 +138,7 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
`(eval-after-load ,feature `(funcall ',(lambda () ,body)))
body))))))
-(defun compat-generate-common (name def-fn install-fn check-fn attr type)
- "Common code for generating compatibility definitions.
-See `compat-generate-function' for details on the arguments NAME,
-DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
- (when (and (plist-get attr :cond) (plist-get attr :prefix))
- (error "A prefixed function %s cannot have a condition" name))
- (funcall compat--generate-function
- name def-fn install-fn check-fn attr type))
-
-(defun compat-common-fdefine (type name arglist docstring rest)
+(defun compat--define-function (type name arglist docstring rest)
"Generate compatibility code for a function NAME.
TYPE is one of `func', for functions and `macro' for macros, and
`advice' ARGLIST is passed on directly to the definition, and
@@ -166,7 +157,7 @@ attributes (see `compat-generate-common')."
;; Check if we want an explicitly prefixed function
(when (plist-get rest :prefix)
(setq name (intern (format "compat-%s" name))))
- (compat-generate-common
+ (funcall compat--generate-function
name
(lambda (realname version)
`(,(cond
@@ -237,7 +228,7 @@ attribute, is greater than the current Emacs version."
[&rest keywordp sexp]
def-body))
(doc-string 3) (indent 2))
- (compat-common-fdefine 'func name arglist docstring rest))
+ (compat--define-function 'func name arglist docstring rest))
(defmacro compat-defmacro (name arglist docstring &rest rest)
"Define NAME with arguments ARGLIST as a compatibility macro.
@@ -250,7 +241,7 @@ The definition will only be installed, if the version this
function was defined in, as indicated by the `:version'
attribute, is greater than the current Emacs version."
(declare (debug compat-defun) (doc-string 3) (indent 2))
- (compat-common-fdefine 'macro name arglist docstring rest))
+ (compat--define-function 'macro name arglist docstring rest))
(defmacro compat-advise (name arglist docstring &rest rest)
"Define NAME with arguments ARGLIST as a compatibility advice.
@@ -265,7 +256,7 @@ The advice will only be installed, if the version this
function
was defined in, as indicated by the `:version' attribute, is
greater than the current Emacs version."
(declare (debug compat-defun) (doc-string 3) (indent 2))
- (compat-common-fdefine 'advice name (cons 'oldfun arglist) docstring rest))
+ (compat--define-function 'advice name (cons 'oldfun arglist) docstring rest))
(defmacro compat-defvar (name initval docstring &rest attr)
"Declare compatibility variable NAME with initial value INITVAL.
@@ -283,7 +274,7 @@ non-nil value."
(let ((oldname name))
(when (plist-get attr :prefix)
(setq name (intern (format "compat-%s" name))))
- (compat-generate-common
+ (funcall compat--generate-function
name
(lambda (realname version)
(let ((localp (plist-get attr :local)))
- [elpa] externals/compat updated (d4624d9aed -> b1d8a7f77d), ELPA Syncer, 2023/01/03
- [elpa] externals/compat 9842d683d8 01/14: Declare version only at compile time, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 8e17e784de 04/14: Avoid duplicating the package information in the header, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 9bcc02a8ef 05/14: Make some compat-macs functions private,
ELPA Syncer <=
- [elpa] externals/compat 68de8de839 08/14: compact-macs: Remove the advice mechanism, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 6b32c2058b 02/14: Rename compat-current-version to compat--current-version, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 38e0066caf 07/14: Drop support for 24.3, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 42710e3e67 06/14: Remove compat--ignore, ELPA Syncer, 2023/01/03
- [elpa] externals/compat e332b6a6b0 10/14: Update NEWS, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 7e797daa30 13/14: Test json-insert, ELPA Syncer, 2023/01/03
- [elpa] externals/compat b1d8a7f77d 14/14: Minor simplification, remove advice remnants, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 6b37982680 11/14: Deprecate compat-help and compat-font-lock, ELPA Syncer, 2023/01/03
- [elpa] externals/compat 3dba9cd612 03/14: Revert "Declare version only at compile time", ELPA Syncer, 2023/01/03
- [elpa] externals/compat da9d92c288 12/14: Remove :note support, ELPA Syncer, 2023/01/03