summaryrefslogtreecommitdiff
path: root/src/syntax.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.h')
-rw-r--r--src/syntax.h36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/syntax.h b/src/syntax.h
index 1350d87162b..73fbb153338 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -83,35 +83,49 @@ struct gl_state_s
extern struct gl_state_s gl_state;
/* Fetch the information from the entry for character C
- in syntax table TABLE, or from globally kept data (gl_state).
+ in the current buffer's syntax table,
+ or (if VIA_PROPERTY) from globally kept data (gl_state).
Does inheritance. */
INLINE Lisp_Object
-SYNTAX_ENTRY (int c)
+syntax_property_entry (int c, bool via_property)
{
-#ifdef SYNTAX_ENTRY_VIA_PROPERTY
- return (gl_state.use_global
- ? gl_state.global_code
- : CHAR_TABLE_REF (gl_state.current_syntax_table, c));
-#else
+ if (via_property)
+ return (gl_state.use_global
+ ? gl_state.global_code
+ : CHAR_TABLE_REF (gl_state.current_syntax_table, c));
return CHAR_TABLE_REF (BVAR (current_buffer, syntax_table), c);
-#endif
+}
+INLINE Lisp_Object
+SYNTAX_ENTRY (int c)
+{
+ return syntax_property_entry (c, 0);
}
/* Extract the information from the entry for character C
in the current syntax table. */
INLINE int
-SYNTAX_WITH_FLAGS (int c)
+syntax_property_with_flags (int c, bool via_property)
{
- Lisp_Object ent = SYNTAX_ENTRY (c);
+ Lisp_Object ent = syntax_property_entry (c, via_property);
return CONSP (ent) ? XINT (XCAR (ent)) : Swhitespace;
}
+INLINE int
+SYNTAX_WITH_FLAGS (int c)
+{
+ return syntax_property_with_flags (c, 0);
+}
INLINE enum syntaxcode
+syntax_property (int c, bool via_property)
+{
+ return syntax_property_with_flags (c, via_property) & 0xff;
+}
+INLINE enum syntaxcode
SYNTAX (int c)
{
- return SYNTAX_WITH_FLAGS (c) & 0xff;
+ return syntax_property (c, 0);
}