emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r112932: * lisp/subr.el (function-arity): Remove (mi


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r112932: * lisp/subr.el (function-arity): Remove (mistakenly added).
Date: Tue, 11 Jun 2013 21:53:50 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112932
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14590
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2013-06-11 17:53:40 -0400
message:
  * lisp/subr.el (function-arity): Remove (mistakenly added).
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/subr.el                   subr.el-20091113204419-o5vbwnq5f7feedwu-151
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-06-11 21:38:35 +0000
+++ b/lisp/ChangeLog    2013-06-11 21:53:40 +0000
@@ -1,5 +1,7 @@
 2013-06-11  Stefan Monnier  <address@hidden>
 
+       * subr.el (function-arity): Remove (mistakenly added) (bug#14590).
+
        * progmodes/prolog.el (prolog-make-keywords-regexp): Remove.
        (prolog-font-lock-keywords): Use regexp-opt instead.
        Don't manually highlight strings.

=== modified file 'lisp/subr.el'
--- a/lisp/subr.el      2013-06-11 16:51:12 +0000
+++ b/lisp/subr.el      2013-06-11 21:53:40 +0000
@@ -4234,32 +4234,6 @@
   (declare (obsolete called-interactively-p "23.2"))
   (called-interactively-p 'interactive))
 
-(defun function-arity (f &optional num)
-  "Return the (MIN . MAX) arity of F.
-If the maximum arity is infinite, MAX is `many'.
-F can be a function or a macro.
-If NUM is non-nil, return non-nil iff F can be called with NUM args."
-  (if (symbolp f) (setq f (indirect-function f)))
-  (if (eq (car-safe f) 'macro) (setq f (cdr f)))
-  (let ((res
-        (if (subrp f)
-            (let ((x (subr-arity f)))
-              (if (eq (cdr x) 'unevalled) (cons (car x) 'many)))
-          (let* ((args (if (consp f) (cadr f) (aref f 0)))
-                 (max (length args))
-                 (opt (memq '&optional args))
-                 (rest (memq '&rest args))
-                 (min (- max (length opt))))
-            (if opt
-                (cons min (if rest 'many (1- max)))
-              (if rest
-                  (cons (- max (length rest)) 'many)
-                (cons min max)))))))
-    (if (not num)
-       res
-      (and (>= num (car res))
-          (or (eq 'many (cdr res)) (<= num (cdr res)))))))
-
 (defun set-temporary-overlay-map (map &optional keep-pred)
   "Set MAP as a temporary keymap taking precedence over most other keymaps.
 Note that this does NOT take precedence over the \"overriding\" maps


reply via email to

[Prev in Thread] Current Thread [Next in Thread]