Mercurial > emacs
comparison lisp/emacs-lisp/cl.el @ 28824:add63b27c709
Doc fixes; mainly avoid duplicating arg
list in doc string. Don't quote keyword symbols.
author | Dave Love <fx@gnu.org> |
---|---|
date | Fri, 05 May 2000 20:00:35 +0000 |
parents | 5ef76039360b |
children | a262f769fc3d |
comparison
equal
deleted
inserted
replaced
28823:72c6f8275e0b | 28824:add63b27c709 |
---|---|
121 | 121 |
122 ;;; Generalized variables. These macros are defined here so that they | 122 ;;; Generalized variables. These macros are defined here so that they |
123 ;;; can safely be used in .emacs files. | 123 ;;; can safely be used in .emacs files. |
124 | 124 |
125 (defmacro incf (place &optional x) | 125 (defmacro incf (place &optional x) |
126 "(incf PLACE [X]): increment PLACE by X (1 by default). | 126 "Increment PLACE by X (1 by default). |
127 PLACE may be a symbol, or any generalized variable allowed by `setf'. | 127 PLACE may be a symbol, or any generalized variable allowed by `setf'. |
128 The return value is the incremented value of PLACE." | 128 The return value is the incremented value of PLACE." |
129 (if (symbolp place) | 129 (if (symbolp place) |
130 (list 'setq place (if x (list '+ place x) (list '1+ place))) | 130 (list 'setq place (if x (list '+ place x) (list '1+ place))) |
131 (list 'callf '+ place (or x 1)))) | 131 (list 'callf '+ place (or x 1)))) |
132 | 132 |
133 (defmacro decf (place &optional x) | 133 (defmacro decf (place &optional x) |
134 "(decf PLACE [X]): decrement PLACE by X (1 by default). | 134 "Decrement PLACE by X (1 by default). |
135 PLACE may be a symbol, or any generalized variable allowed by `setf'. | 135 PLACE may be a symbol, or any generalized variable allowed by `setf'. |
136 The return value is the decremented value of PLACE." | 136 The return value is the decremented value of PLACE." |
137 (if (symbolp place) | 137 (if (symbolp place) |
138 (list 'setq place (if x (list '- place x) (list '1- place))) | 138 (list 'setq place (if x (list '- place x) (list '1- place))) |
139 (list 'callf '- place (or x 1)))) | 139 (list 'callf '- place (or x 1)))) |
140 | 140 |
141 (defmacro pop (place) | 141 (defmacro pop (place) |
142 "(pop PLACE): remove and return the head of the list stored in PLACE. | 142 "Remove and return the head of the list stored in PLACE. |
143 Analogous to (prog1 (car PLACE) (setf PLACE (cdr PLACE))), though more | 143 Analogous to (prog1 (car PLACE) (setf PLACE (cdr PLACE))), though more |
144 careful about evaluating each argument only once and in the right order. | 144 careful about evaluating each argument only once and in the right order. |
145 PLACE may be a symbol, or any generalized variable allowed by `setf'." | 145 PLACE may be a symbol, or any generalized variable allowed by `setf'." |
146 (if (symbolp place) | 146 (if (symbolp place) |
147 (list 'car (list 'prog1 place (list 'setq place (list 'cdr place)))) | 147 (list 'car (list 'prog1 place (list 'setq place (list 'cdr place)))) |
148 (cl-do-pop place))) | 148 (cl-do-pop place))) |
149 | 149 |
150 (defmacro push (x place) | 150 (defmacro push (x place) |
151 "(push X PLACE): insert X at the head of the list stored in PLACE. | 151 "Insert X at the head of the list stored in PLACE. |
152 Analogous to (setf PLACE (cons X PLACE)), though more careful about | 152 Analogous to (setf PLACE (cons X PLACE)), though more careful about |
153 evaluating each argument only once and in the right order. PLACE may | 153 evaluating each argument only once and in the right order. PLACE may |
154 be a symbol, or any generalized variable allowed by `setf'." | 154 be a symbol, or any generalized variable allowed by `setf'." |
155 (if (symbolp place) (list 'setq place (list 'cons x place)) | 155 (if (symbolp place) (list 'setq place (list 'cons x place)) |
156 (list 'callf2 'cons x place))) | 156 (list 'callf2 'cons x place))) |