(defmacro noreturn (form)
"Evaluates FORM, with the expectation that the evaluation will signal an error
instead of returning to its caller. If FORM does return, an error is
-signalled."
+signalled."
`(prog1 ,form
(error "Form marked with `noreturn' did return")))
(setq ,(car spec) (1+ ,(car spec))))
,@(cdr (cdr spec)))))
+(defmacro declare (&rest specs)
+ "Do not evaluate any arguments and return nil.
+Treated as a declaration when used at the right place in a
+`defmacro' form. \(See Info anchor `(elisp)Definition of declare'."
+ nil)
+
(defsubst caar (x)
"Return the car of the car of X."
(car (car x)))
(defsubst posn-window (position)
"Return the window in POSITION.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(nth 0 position))
(defsubst posn-area (position)
"Return the window area recorded in POSITION, or nil for the text area.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(let ((area (if (consp (nth 1 position))
(car (nth 1 position))
(nth 1 position))))
(defsubst posn-point (position)
"Return the buffer location in POSITION.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(or (nth 5 position)
(if (consp (nth 1 position))
(car (nth 1 position))
(defsubst posn-x-y (position)
"Return the x and y coordinates in POSITION.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(nth 2 position))
(defun posn-col-row (position)
"Return the nominal column and row in POSITION, measured in characters.
The column and row values are approximations calculated from the x
and y coordinates in POSITION and the frame's default character width
-and height.
+and height.
For a scroll-bar event, the result column is 0, and the row
corresponds to the vertical position of the click in the scroll bar.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(let* ((pair (posn-x-y position))
(window (posn-window position))
(area (posn-area position)))
Return nil if POSITION does not contain the actual position; in that case
`posn-col-row' can be used to get approximate values.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(nth 6 position))
(defsubst posn-timestamp (position)
"Return the timestamp of POSITION.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(nth 3 position))
(defsubst posn-string (position)
"Return the string object of POSITION, or nil if a buffer position.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(nth 4 position))
(defsubst posn-image (position)
"Return the image object of POSITION, or nil if a not an image.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(nth 7 position))
(defsubst posn-object (position)
"Return the object (image or string) of POSITION.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(or (posn-image position) (posn-string position)))
(defsubst posn-object-x-y (position)
"Return the x and y coordinates relative to the object of POSITION.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(nth 8 position))
(defsubst posn-object-width-height (position)
"Return the pixel width and height of the object of POSITION.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions."
(nth 9 position))
\f