[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 68de8de839 08/14: compact-macs: Remove the advic
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 68de8de839 08/14: compact-macs: Remove the advice mechanism |
Date: |
Tue, 3 Jan 2023 10:57:28 -0500 (EST) |
branch: externals/compat
commit 68de8de839146db1843eef04d904219f96c5f7ca
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
compact-macs: Remove the advice mechanism
---
compat-macs.el | 46 ++++++----------------------------------------
1 file changed, 6 insertions(+), 40 deletions(-)
diff --git a/compat-macs.el b/compat-macs.el
index ff02d1b567..7943847255 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -127,11 +127,7 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
`(eval-after-load ,feature `(funcall ',(lambda ()
,body)))
body))))))
(check
- (let* ((body (if (eq type 'advice)
- `(,@check
- ,(funcall def-fn realname version)
- ,(funcall install-fn realname version))
- `(,@check ,(funcall def-fn name version)))))
+ (let ((body `(,@check ,(funcall def-fn name version))))
(if feature
;; See https://nullprogram.com/blog/2018/02/22/:
`(eval-after-load ,feature `(funcall ',(lambda () ,body)))
@@ -169,7 +165,6 @@ attributes (see `compat-generate-common')."
,(let ((type (cond
((eq type 'func) "function")
((eq type 'macro) "macro")
- ((eq type 'advice) "advice")
((error "Unknown type")))))
(with-temp-buffer
(insert docstring)
@@ -189,27 +184,13 @@ If this is not documented on your system, you can check \
(let ((fill-column 80))
(fill-region (point-min) (point-max)))
(buffer-string)))
- ;; Advice may use the implicit variable `oldfun', but
- ;; to avoid triggering the byte compiler, we make
- ;; sure the argument is used at least once.
- ,@(if (eq type 'advice)
- (cons '(ignore oldfun) body)
- body)))
+ ,@body))
(lambda (realname _version)
- (cond
- ((memq type '(func macro))
- ;; Functions and macros are installed by
- ;; aliasing the name of the compatible
- ;; function to the name of the compatibility
- ;; function.
- `(defalias ',name #',realname))
- ((eq type 'advice)
- `(advice-add ',name :around #',realname))))
+ ;; Functions and macros are installed by aliasing the name of the
+ ;; compatible function to the name of the compatibility function.
+ `(defalias ',name #',realname))
(lambda ()
- (cond
- ((memq type '(func macro))
- `(not (fboundp ',name)))
- ((eq type 'advice) t)))
+ `(not (fboundp ',name)))
rest type)))
(defmacro compat-defun (name arglist docstring &rest rest)
@@ -242,21 +223,6 @@ attribute, is greater than the current Emacs version."
(declare (debug compat-defun) (doc-string 3) (indent 2))
(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.
-The advice function must be documented in DOCSTRING. REST may
-begin with a plist, that is interpreted by this macro but not
-passed on to the actual advice function. See
-`compat-generate-common' for a listing of attributes. The advice
-wraps the old definition, that is accessible via using the symbol
-`oldfun'.
-
-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--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.
The obligatory documentation string DOCSTRING must be given.
- [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, 2023/01/03
- [elpa] externals/compat 68de8de839 08/14: compact-macs: Remove the advice mechanism,
ELPA Syncer <=
- [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
- [elpa] externals/compat 3d436c9e81 09/14: Quiet tests, ELPA Syncer, 2023/01/03