~pkal/compat

29dc297357cceceefe4a73a1d18f1d430d02ad59 — Philip Kaludercic a month ago 0a72e60
Ensure that compat-maxargs-/= is visible at compile time
1 files changed, 6 insertions(+), 5 deletions(-)

M compat.el
M compat.el => compat.el +6 -5
@@ 134,11 134,12 @@ advice."
    (compat-func-arity func))
   ((signal 'invalid-function func))))

(defun compat-maxargs-/= (func n)
  "Non-nil when FUNC doesn't accept at most N arguments."
  (condition-case nil
      (not (eq (cdr (compat-func-arity func t)) n))
    (void-function t)))
(eval-and-compile
  (defun compat-maxargs-/= (func n)
    "Non-nil when FUNC doesn't accept at most N arguments."
    (condition-case nil
        (not (eq (cdr (compat-func-arity func t)) n))
      (void-function t))))

;; Suppress errors triggered by requiring non-existent libraries in
;; older versions of Emacs (e.g. subr-x).