Mercurial > hg > xemacs-beta
comparison lisp/subr.el @ 5420:b9167d522a9a
Rebase with 21.5 trunk.
author | Mats Lidell <matsl@xemacs.org> |
---|---|
date | Thu, 28 Oct 2010 23:53:24 +0200 |
parents | 308d34e9f07d d27c1ee1943b |
children | 6506fcb40fcf |
comparison
equal
deleted
inserted
replaced
5419:eaf01113cd42 | 5420:b9167d522a9a |
---|---|
35 ;; of commentary just to give diff(1) something to synch itself with to | 35 ;; of commentary just to give diff(1) something to synch itself with to |
36 ;; provide useful context diffs. -sb | 36 ;; provide useful context diffs. -sb |
37 | 37 |
38 ;; BEGIN SYNCHED WITH FSF 21.2 | 38 ;; BEGIN SYNCHED WITH FSF 21.2 |
39 | 39 |
40 ;;; Code: | 40 ;; XEmacs; no need for custom-declare-variable-list, preloaded-file-list is |
41 (defvar custom-declare-variable-list nil | 41 ;; ordered to make it unnecessary. |
42 "Record `defcustom' calls made before `custom.el' is loaded to handle them. | 42 |
43 Each element of this list holds the arguments to one call to `defcustom'.") | |
44 | |
45 ;; Use this, rather than defcustom, in subr.el and other files loaded | |
46 ;; before custom.el. See dumped-lisp.el. | |
47 (defun custom-declare-variable-early (&rest arguments) | |
48 (setq custom-declare-variable-list | |
49 (cons arguments custom-declare-variable-list))) | |
50 | |
51 | |
52 (defun macro-declaration-function (macro decl) | 43 (defun macro-declaration-function (macro decl) |
53 "Process a declaration found in a macro definition. | 44 "Process a declaration found in a macro definition. |
54 This is set as the value of the variable `macro-declaration-function'. | 45 This is set as the value of the variable `macro-declaration-function'. |
55 MACRO is the name of the macro being defined. | 46 MACRO is the name of the macro being defined. |
56 DECL is a list `(declare ...)' containing the declarations. | 47 DECL is a list `(declare ...)' containing the declarations. |
62 (put macro 'edebug-form-spec (cadr d))) | 53 (put macro 'edebug-form-spec (cadr d))) |
63 (t | 54 (t |
64 (message "Unknown declaration %s" d))))) | 55 (message "Unknown declaration %s" d))))) |
65 | 56 |
66 (setq macro-declaration-function 'macro-declaration-function) | 57 (setq macro-declaration-function 'macro-declaration-function) |
67 | 58 |
59 ;; XEmacs; this is here because we use it in backquote.el, so it needs to be | |
60 ;; available the first time a `(...) form is expanded. | |
61 (defun list* (first &rest rest) ; See compiler macro in cl-macs.el | |
62 "Return a new list with specified args as elements, cons'd to last arg. | |
63 Thus, `(list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to | |
64 `(cons A (cons B (cons C D)))'." | |
65 (cond ((not rest) first) | |
66 ((not (cdr rest)) (cons first (car rest))) | |
67 (t (let* ((n (length rest)) | |
68 (copy (copy-sequence rest)) | |
69 (last (nthcdr (- n 2) copy))) | |
70 (setcdr last (car (cdr last))) | |
71 (cons first copy))))) | |
68 | 72 |
69 ;;;; Lisp language features. | 73 ;;;; Lisp language features. |
70 | 74 |
71 (defmacro lambda (&rest cdr) | 75 (defmacro lambda (&rest cdr) |
72 "Return a lambda expression. | 76 "Return a lambda expression. |
1569 region)) | 1573 region)) |
1570 | 1574 |
1571 (define-function 'eval-in-buffer 'with-current-buffer) | 1575 (define-function 'eval-in-buffer 'with-current-buffer) |
1572 (make-obsolete 'eval-in-buffer 'with-current-buffer) | 1576 (make-obsolete 'eval-in-buffer 'with-current-buffer) |
1573 | 1577 |
1574 ;;; The real defn is in abbrev.el but some early callers | |
1575 ;;; (eg lisp-mode-abbrev-table) want this before abbrev.el is loaded... | |
1576 | |
1577 (if (not (fboundp 'define-abbrev-table)) | |
1578 (progn | |
1579 (setq abbrev-table-name-list '()) | |
1580 (fset 'define-abbrev-table | |
1581 (function (lambda (name defs) | |
1582 ;; These are fixed-up when abbrev.el loads. | |
1583 (setq abbrev-table-name-list | |
1584 (cons (cons name defs) | |
1585 abbrev-table-name-list))))))) | |
1586 | |
1587 ;;; `functionp' has been moved into C. | 1578 ;;; `functionp' has been moved into C. |
1588 | 1579 |
1589 ;;(defun functionp (object) | 1580 ;;(defun functionp (object) |
1590 ;; "Non-nil if OBJECT can be called as a function." | 1581 ;; "Non-nil if OBJECT can be called as a function." |
1591 ;; (or (and (symbolp object) (fboundp object)) | 1582 ;; (or (and (symbolp object) (fboundp object)) |