Commit 3331fb06 authored by Ken Raeburn's avatar Ken Raeburn
Browse files

Use XCAR and XCDR.

parent ff287a27
...@@ -248,21 +248,21 @@ extern Lisp_Object item_properties; ...@@ -248,21 +248,21 @@ extern Lisp_Object item_properties;
/* Extract the head from an event. /* Extract the head from an event.
This works on composite and simple events. */ This works on composite and simple events. */
#define EVENT_HEAD(event) \ #define EVENT_HEAD(event) \
(EVENT_HAS_PARAMETERS (event) ? XCONS (event)->car : (event)) (EVENT_HAS_PARAMETERS (event) ? XCAR (event) : (event))
/* Extract the starting and ending positions from a composite event. */ /* Extract the starting and ending positions from a composite event. */
#define EVENT_START(event) (XCONS (XCONS (event)->cdr)->car) #define EVENT_START(event) (XCAR (XCDR (event)))
#define EVENT_END(event) (XCONS (XCONS (XCONS (event)->cdr)->cdr)->car) #define EVENT_END(event) (XCAR (XCDR (XCDR (event))))
/* Extract the click count from a multi-click event. */ /* Extract the click count from a multi-click event. */
#define EVENT_CLICK_COUNT(event) (Fnth ((event), make_number (2))) #define EVENT_CLICK_COUNT(event) (Fnth ((event), make_number (2)))
/* Extract the fields of a position. */ /* Extract the fields of a position. */
#define POSN_WINDOW(posn) (XCONS (posn)->car) #define POSN_WINDOW(posn) (XCAR (posn))
#define POSN_BUFFER_POSN(posn) (XCONS (XCONS (posn)->cdr)->car) #define POSN_BUFFER_POSN(posn) (XCAR (XCDR (posn)))
#define POSN_WINDOW_POSN(posn) (XCONS (XCONS (XCONS (posn)->cdr)->cdr)->car) #define POSN_WINDOW_POSN(posn) (XCAR (XCDR (XCDR (posn))))
#define POSN_TIMESTAMP(posn) \ #define POSN_TIMESTAMP(posn) \
(XCONS (XCONS (XCONS (XCONS (posn)->cdr)->cdr)->cdr)->car) (XCAR (XCDR (XCDR (XCDR (posn)))))
#define POSN_SCROLLBAR_PART(posn) (Fnth ((posn), make_number (4))) #define POSN_SCROLLBAR_PART(posn) (Fnth ((posn), make_number (4)))
/* A cons (STRING . STRING-CHARPOS), or nil in mouse-click events. /* A cons (STRING . STRING-CHARPOS), or nil in mouse-click events.
......
...@@ -122,39 +122,39 @@ extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int)); ...@@ -122,39 +122,39 @@ extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
({ Lisp_Object temp; \ ({ Lisp_Object temp; \
temp = SYNTAX_ENTRY (c); \ temp = SYNTAX_ENTRY (c); \
(CONSP (temp) \ (CONSP (temp) \
? (enum syntaxcode) (XINT (XCONS (temp)->car) & 0xff) \ ? (enum syntaxcode) (XINT (XCAR (temp)) & 0xff) \
: Swhitespace); }) : Swhitespace); })
#define SYNTAX_WITH_FLAGS(c) \ #define SYNTAX_WITH_FLAGS(c) \
({ Lisp_Object temp; \ ({ Lisp_Object temp; \
temp = SYNTAX_ENTRY (c); \ temp = SYNTAX_ENTRY (c); \
(CONSP (temp) \ (CONSP (temp) \
? XINT (XCONS (temp)->car) \ ? XINT (XCAR (temp)) \
: (int) Swhitespace); }) : (int) Swhitespace); })
#define SYNTAX_MATCH(c) \ #define SYNTAX_MATCH(c) \
({ Lisp_Object temp; \ ({ Lisp_Object temp; \
temp = SYNTAX_ENTRY (c); \ temp = SYNTAX_ENTRY (c); \
(CONSP (temp) \ (CONSP (temp) \
? XCONS (temp)->cdr \ ? XCDR (temp) \
: Qnil); }) : Qnil); })
#else #else
#define SYNTAX(c) \ #define SYNTAX(c) \
(syntax_temp = SYNTAX_ENTRY ((c)), \ (syntax_temp = SYNTAX_ENTRY ((c)), \
(CONSP (syntax_temp) \ (CONSP (syntax_temp) \
? (enum syntaxcode) (XINT (XCONS (syntax_temp)->car) & 0xff) \ ? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff) \
: Swhitespace)) : Swhitespace))
#define SYNTAX_WITH_FLAGS(c) \ #define SYNTAX_WITH_FLAGS(c) \
(syntax_temp = SYNTAX_ENTRY ((c)), \ (syntax_temp = SYNTAX_ENTRY ((c)), \
(CONSP (syntax_temp) \ (CONSP (syntax_temp) \
? XINT (XCONS (syntax_temp)->car) \ ? XINT (XCAR (syntax_temp)) \
: (int) Swhitespace)) : (int) Swhitespace))
#define SYNTAX_MATCH(c) \ #define SYNTAX_MATCH(c) \
(syntax_temp = SYNTAX_ENTRY ((c)), \ (syntax_temp = SYNTAX_ENTRY ((c)), \
(CONSP (syntax_temp) \ (CONSP (syntax_temp) \
? XCONS (syntax_temp)->cdr \ ? XCDR (syntax_temp) \
: Qnil)) : Qnil))
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment