[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 61a1da1 44/99: Remove indirect-function compatib
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 61a1da1 44/99: Remove indirect-function compatibility |
Date: |
Sun, 17 Oct 2021 05:57:54 -0400 (EDT) |
branch: externals/compat
commit 61a1da1d2c1551504059b35e661a3ad0b702dea2
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Remove indirect-function compatibility
---
compat-24.4.el | 8 ++++++--
compat-25.1.el | 11 -----------
compat-26.1.el | 3 ++-
compat-tests.el | 17 -----------------
compat.el | 4 +++-
5 files changed, 11 insertions(+), 32 deletions(-)
diff --git a/compat-24.4.el b/compat-24.4.el
index 6518733..abe76f4 100644
--- a/compat-24.4.el
+++ b/compat-24.4.el
@@ -94,12 +94,16 @@ for more details about the different forms of FILE and
their semantics."
(compat-defun special-form-p (object)
"Non-nil if and only if OBJECT is a special form."
(if (and (symbolp object) (fboundp object))
- (setq object (indirect-function object)))
+ (setq object (condition-case nil
+ (indirect-function object)
+ (void-function nil))))
(and (subrp object) (eq (cdr (subr-arity object)) 'unevalled)))
(compat-defun macrop (object)
"Non-nil if and only if OBJECT is a macro."
- (let ((def (indirect-function object)))
+ (let ((def (condition-case nil
+ (indirect-function object)
+ (void-function nil))))
(when (consp def)
(or (eq 'macro (car def))
(and (autoloadp def) (memq (nth 4 def) '(macro t)))))))
diff --git a/compat-25.1.el b/compat-25.1.el
index 43141ee..63f1d35 100644
--- a/compat-25.1.el
+++ b/compat-25.1.el
@@ -70,17 +70,6 @@ This implementation is equivalent to `format'."
?\\ ?/))
(aref name (1- (length name)))))
-;;;; Defined in data.c
-
-(compat-advise indirect-function (object)
- "Prevent `void-function' from being signalled."
- :cond (condition-case nil
- (ignore (indirect-function nil))
- (void-function t))
- (condition-case nil
- (funcall oldfun object)
- (void-function nil)))
-
;;;; Defined in subr.el
(compat-defun string-greaterp (string1 string2)
diff --git a/compat-26.1.el b/compat-26.1.el
index b38b940..62d7b23 100644
--- a/compat-26.1.el
+++ b/compat-26.1.el
@@ -252,7 +252,8 @@ TRIM-LEFT and TRIM-RIGHT default to \"[ \\t\\n\\r]+\"."
(declare (pure t))
(cdr (cdr (cdr (cdr x)))))
-(defvar compat--gensym-counter 0)
+(compat-defvar compat--gensym-counter 0
+ "Number used to construct the name of the next symbol created by `gensym'.")
(compat-defun gensym (&optional prefix)
"Return a new uninterned symbol.
diff --git a/compat-tests.el b/compat-tests.el
index de7adb9..1b41cbb 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1221,22 +1221,5 @@ the compatibility function."
(compat--should t "dir/subdir/")
(compat--should nil "dir/subdir")))
-(ert-deftest compat-indirect-function ()
- "Check if `indirect-function' was advised properly."
- (compat-test indirect-function
- ;; A symbol with a function alias should return the function it is
- ;; aliasing:
- (compat--should* (indirect-function #'process-send-string)
- 'send-string)
- (compat--should* (indirect-function #'string-equal)
- 'string=)
- ;; A function should return it self when not aliased:
- (compat--should* (indirect-function #'string-equal) 'string-equal)
- ;; A fresh symbol should return nil when no function is associated
- ;; with it:
- (compat--should* nil (make-symbol "foobar"))
- ;; Anything else is return as is:
- (compat--should* "foobar" "foobar")))
-
(provide 'compat-tests)
;;; compat-tests.el ends here
diff --git a/compat.el b/compat.el
index fa50cda..0b022d4 100644
--- a/compat.el
+++ b/compat.el
@@ -51,7 +51,9 @@
((null func)
(signal 'void-function func))
((and (symbolp func) (not (null func)))
- (compat-func-arity (indirect-function func)))
+ (compat-func-arity (condition-case nil
+ (indirect-function func)
+ (void-function nil))))
((eq (car-safe func) 'macro)
(compat-func-arity (cdr func)))
((subrp func)
- [elpa] externals/compat 4513631 70/99: Fix compat-func-arity advice handling, (continued)
- [elpa] externals/compat 4513631 70/99: Fix compat-func-arity advice handling, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 09bf8d8 75/99: Declare nadvice functions for compat-func-arity, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 80ab781 77/99: Use advice.el for advising functions previously to Emacs 24.4, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 20afc89 78/99: Add :cond checks to json-* functions in compat-27.1, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 72c0781 81/99: Mention Chris Wellons' article on lambdas and byte compilation, ELPA Syncer, 2021/10/17
- [elpa] externals/compat ee068f0 82/99: Revert back to manual advising, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 7bef68b 84/99: Mark regexp-opt as part of regexp-opt.el, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 7619f21 89/99: Display version number of manual advice docstring, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 7245918 96/99: Fix handling of file-missing in require advice, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 29dc297 98/99: Ensure that compat-maxargs-/= is visible at compile time, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 61a1da1 44/99: Remove indirect-function compatibility,
ELPA Syncer <=
- [elpa] externals/compat 044acff 58/99: Optionally let compat-func-arity handle advice, ELPA Syncer, 2021/10/17
- [elpa] externals/compat a46ab78 19/99: Add button-buttonize to emacs-28.1, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 9c6818c 20/99: Add directory-name-p compatibility function, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 070384b 24/99: Fix compat-tests for older versions, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 05092cb 25/99: Fix compat-test indentation in compat-tests, ELPA Syncer, 2021/10/17
- [elpa] externals/compat cb339dd 31/99: Add :cond where applicable, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 2d50e5c 32/99: Implement func-arity, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 36ef438 35/99: Implement and use mounted-file-systems, ELPA Syncer, 2021/10/17
- [elpa] externals/compat e5a573f 37/99: Declare mouse-set-point, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 2089c90 41/99: Declare gensym for with-existing-directory, ELPA Syncer, 2021/10/17