aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-03-29 14:08:34 +0000
committerGerd Moellmann2001-03-29 14:08:34 +0000
commitf65fab598e808cec9a3ed5b8be01368ea8e38864 (patch)
tree37f4f5bd737af78ae5032978d60c6dec5e64fa1f
parentcc515226efa8cc9c7827bf3edb940325ee2b13ec (diff)
downloademacs-f65fab598e808cec9a3ed5b8be01368ea8e38864.tar.gz
emacs-f65fab598e808cec9a3ed5b8be01368ea8e38864.zip
(interactive-form): New function.
-rw-r--r--lisp/subr.el40
1 files changed, 21 insertions, 19 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index eb55b416a92..eb476c65753 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1449,25 +1449,27 @@ configuration."
1449 (eq (car-safe object) 'lambda) 1449 (eq (car-safe object) 'lambda)
1450 (and (symbolp object) (fboundp object)))) 1450 (and (symbolp object) (fboundp object))))
1451 1451
1452;; now in fns.c 1452(defun interactive-form (function)
1453;(defun nth (n list) 1453 "Return the interactive form of FUNCTION.
1454; "Returns the Nth element of LIST. 1454If function is a command (see `commandp'), value is a list of the form
1455;N counts from zero. If LIST is not that long, nil is returned." 1455\(interactive SPEC). If function is not a command,return nil."
1456; (car (nthcdr n list))) 1456 (setq function (indirect-function function))
1457; 1457 (when (commandp function)
1458;(defun copy-alist (alist) 1458 (cond ((byte-code-function-p function)
1459; "Return a copy of ALIST. 1459 (when (> (length function) 5)
1460;This is a new alist which represents the same mapping 1460 (let ((spec (aref function 5)))
1461;from objects to objects, but does not share the alist structure with ALIST. 1461 (if spec
1462;The objects mapped (cars and cdrs of elements of the alist) 1462 (list 'interactive spec)
1463;are shared, however." 1463 (list 'interactive)))))
1464; (setq alist (copy-sequence alist)) 1464 ((subrp function)
1465; (let ((tail alist)) 1465 (subr-interactive-form function))
1466; (while tail 1466 ((eq (car-safe function) 'lambda)
1467; (if (consp (car tail)) 1467 (setq function (cddr function))
1468; (setcar tail (cons (car (car tail)) (cdr (car tail))))) 1468 (when (stringp (car function))
1469; (setq tail (cdr tail)))) 1469 (setq function (cdr function)))
1470; alist) 1470 (let ((form (car function)))
1471 (when (eq (car-safe form 'interactive))
1472 (copy-sequence form)))))))
1471 1473
1472(defun assq-delete-all (key alist) 1474(defun assq-delete-all (key alist)
1473 "Delete from ALIST all elements whose car is KEY. 1475 "Delete from ALIST all elements whose car is KEY.