diff options
| author | Stefan Monnier | 2009-09-17 15:58:35 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-09-17 15:58:35 +0000 |
| commit | 354f0faf616d6d7cdf43932c90a0304474bf0ac5 (patch) | |
| tree | ce5a9eb2abedb94f2fca65c96e6ee3ba52d0a302 | |
| parent | 98b9bf4076a53c7301e1395eb94fae771c4ba658 (diff) | |
| download | emacs-354f0faf616d6d7cdf43932c90a0304474bf0ac5.tar.gz emacs-354f0faf616d6d7cdf43932c90a0304474bf0ac5.zip | |
(push, pop, dolist, dotimes, declare): Don't overwrite CL's
extended definitions, in case we reload subr.el after having
loaded CL.
(eval-next-after-load): Mark as obsolete.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/subr.el | 21 |
2 files changed, 22 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 127486a16eb..4cf3ed85457 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2009-09-17 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * subr.el (push, pop, dolist, dotimes, declare): Don't overwrite CL's | ||
| 4 | extended definitions, in case we reload subr.el after having | ||
| 5 | loaded CL. | ||
| 6 | (eval-next-after-load): Mark as obsolete. | ||
| 7 | |||
| 1 | 2009-09-17 Juri Linkov <juri@jurta.org> | 8 | 2009-09-17 Juri Linkov <juri@jurta.org> |
| 2 | 9 | ||
| 3 | * menu-bar.el (menu-bar-search-menu, menu-bar-edit-menu) | 10 | * menu-bar.el (menu-bar-search-menu, menu-bar-edit-menu) |
diff --git a/lisp/subr.el b/lisp/subr.el index 560ab5695bd..00b41752528 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -119,13 +119,17 @@ BODY should be a list of Lisp expressions. | |||
| 119 | ;; depend on backquote.el. | 119 | ;; depend on backquote.el. |
| 120 | (list 'function (cons 'lambda cdr))) | 120 | (list 'function (cons 'lambda cdr))) |
| 121 | 121 | ||
| 122 | (unless (featurep 'cl) | ||
| 123 | ;; If we reload subr.el after having loaded CL, be careful not to | ||
| 124 | ;; overwrite CL's extended definition of `dolist', `dotimes', | ||
| 125 | ;; `declare', `push' and `pop'. | ||
| 122 | (defmacro push (newelt listname) | 126 | (defmacro push (newelt listname) |
| 123 | "Add NEWELT to the list stored in the symbol LISTNAME. | 127 | "Add NEWELT to the list stored in the symbol LISTNAME. |
| 124 | This is equivalent to (setq LISTNAME (cons NEWELT LISTNAME)). | 128 | This is equivalent to (setq LISTNAME (cons NEWELT LISTNAME)). |
| 125 | LISTNAME must be a symbol." | 129 | LISTNAME must be a symbol." |
| 126 | (declare (debug (form sexp))) | 130 | (declare (debug (form sexp))) |
| 127 | (list 'setq listname | 131 | (list 'setq listname |
| 128 | (list 'cons newelt listname))) | 132 | (list 'cons newelt listname))) |
| 129 | 133 | ||
| 130 | (defmacro pop (listname) | 134 | (defmacro pop (listname) |
| 131 | "Return the first element of LISTNAME's value, and remove it from the list. | 135 | "Return the first element of LISTNAME's value, and remove it from the list. |
| @@ -134,8 +138,8 @@ If the value is nil, `pop' returns nil but does not actually | |||
| 134 | change the list." | 138 | change the list." |
| 135 | (declare (debug (sexp))) | 139 | (declare (debug (sexp))) |
| 136 | (list 'car | 140 | (list 'car |
| 137 | (list 'prog1 listname | 141 | (list 'prog1 listname |
| 138 | (list 'setq listname (list 'cdr listname))))) | 142 | (list 'setq listname (list 'cdr listname)))))) |
| 139 | 143 | ||
| 140 | (defmacro when (cond &rest body) | 144 | (defmacro when (cond &rest body) |
| 141 | "If COND yields non-nil, do BODY, else return nil. | 145 | "If COND yields non-nil, do BODY, else return nil. |
| @@ -155,6 +159,10 @@ value of last one, or nil if there are none. | |||
| 155 | (declare (indent 1) (debug t)) | 159 | (declare (indent 1) (debug t)) |
| 156 | (cons 'if (cons cond (cons nil body)))) | 160 | (cons 'if (cons cond (cons nil body)))) |
| 157 | 161 | ||
| 162 | (unless (featurep 'cl) | ||
| 163 | ;; If we reload subr.el after having loaded CL, be careful not to | ||
| 164 | ;; overwrite CL's extended definition of `dolist', `dotimes', | ||
| 165 | ;; `declare', `push' and `pop'. | ||
| 158 | (defvar --dolist-tail-- nil | 166 | (defvar --dolist-tail-- nil |
| 159 | "Temporary variable used in `dolist' expansion.") | 167 | "Temporary variable used in `dolist' expansion.") |
| 160 | 168 | ||
| @@ -206,7 +214,7 @@ the return value (nil if RESULT is omitted). | |||
| 206 | "Do not evaluate any arguments and return nil. | 214 | "Do not evaluate any arguments and return nil. |
| 207 | Treated as a declaration when used at the right place in a | 215 | Treated as a declaration when used at the right place in a |
| 208 | `defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)" | 216 | `defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)" |
| 209 | nil) | 217 | nil)) |
| 210 | 218 | ||
| 211 | (defmacro ignore-errors (&rest body) | 219 | (defmacro ignore-errors (&rest body) |
| 212 | "Execute BODY; if an error occurs, return nil. | 220 | "Execute BODY; if an error occurs, return nil. |
| @@ -726,8 +734,8 @@ in a cleaner way with command remapping, like this: | |||
| 726 | 734 | ||
| 727 | ;;;; The global keymap tree. | 735 | ;;;; The global keymap tree. |
| 728 | 736 | ||
| 729 | ;;; global-map, esc-map, and ctl-x-map have their values set up in | 737 | ;; global-map, esc-map, and ctl-x-map have their values set up in |
| 730 | ;;; keymap.c; we just give them docstrings here. | 738 | ;; keymap.c; we just give them docstrings here. |
| 731 | 739 | ||
| 732 | (defvar global-map nil | 740 | (defvar global-map nil |
| 733 | "Default global keymap mapping Emacs keyboard input into commands. | 741 | "Default global keymap mapping Emacs keyboard input into commands. |
| @@ -1702,6 +1710,7 @@ This function is called directly from the C code." | |||
| 1702 | This makes or adds to an entry on `after-load-alist'. | 1710 | This makes or adds to an entry on `after-load-alist'. |
| 1703 | FILE should be the name of a library, with no directory name." | 1711 | FILE should be the name of a library, with no directory name." |
| 1704 | (eval-after-load file (read))) | 1712 | (eval-after-load file (read))) |
| 1713 | (make-obsolete 'eval-next-after-load `eval-after-load "23.2") | ||
| 1705 | 1714 | ||
| 1706 | ;;;; Process stuff. | 1715 | ;;;; Process stuff. |
| 1707 | 1716 | ||