Mercurial > emacs
comparison src/syntax.c @ 13218:d2fc560c7740
(Qsyntax_table): New variable.
(init_syntax_once): Call Fmake_char_table the new way.
Set up Qsyntax_table.
(Fsyntax_table_p): Check the `purpose' field.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Sat, 14 Oct 1995 05:52:39 +0000 |
| parents | fd14ccddb85a |
| children | 907544cb2c7d |
comparison
equal
deleted
inserted
replaced
| 13217:c3f879af05db | 13218:d2fc560c7740 |
|---|---|
| 23 #include "lisp.h" | 23 #include "lisp.h" |
| 24 #include "commands.h" | 24 #include "commands.h" |
| 25 #include "buffer.h" | 25 #include "buffer.h" |
| 26 #include "syntax.h" | 26 #include "syntax.h" |
| 27 | 27 |
| 28 Lisp_Object Qsyntax_table_p; | 28 Lisp_Object Qsyntax_table_p, Qsyntax_table; |
| 29 | 29 |
| 30 static void scan_sexps_forward (); | 30 static void scan_sexps_forward (); |
| 31 static int char_quoted (); | 31 static int char_quoted (); |
| 32 | 32 |
| 33 int words_include_escapes; | 33 int words_include_escapes; |
| 114 "Return t if ARG is a syntax table.\n\ | 114 "Return t if ARG is a syntax table.\n\ |
| 115 Currently, any char-table counts as a syntax table.") | 115 Currently, any char-table counts as a syntax table.") |
| 116 (obj) | 116 (obj) |
| 117 Lisp_Object obj; | 117 Lisp_Object obj; |
| 118 { | 118 { |
| 119 if (CHAR_TABLE_P (obj)) | 119 if (CHAR_TABLE_P (obj) |
| 120 && XCHAR_TABLE (obj)->purpose == Qsyntax_table) | |
| 120 return Qt; | 121 return Qt; |
| 121 return Qnil; | 122 return Qnil; |
| 122 } | 123 } |
| 123 | 124 |
| 124 static void | 125 static void |
| 1718 init_syntax_once () | 1719 init_syntax_once () |
| 1719 { | 1720 { |
| 1720 register int i; | 1721 register int i; |
| 1721 Lisp_Object temp; | 1722 Lisp_Object temp; |
| 1722 | 1723 |
| 1724 /* This has to be done here, before we call Fmake_char_table. */ | |
| 1725 Qsyntax_table = intern ("syntax-table"); | |
| 1726 staticpro (&Qsyntax_table); | |
| 1727 | |
| 1728 /* Intern this now in case it isn't already done. | |
| 1729 Setting this variable twice is harmless. | |
| 1730 But don't staticpro it here--that is done in alloc.c. */ | |
| 1731 Qchar_table_extra_slots = intern ("char-table-extra-slots"); | |
| 1732 | |
| 1733 /* Now we are ready to set up this property, so we can | |
| 1734 create syntax tables. */ | |
| 1735 Fput (Qsyntax_table, Qchar_table_extra_slots, make_number (0)); | |
| 1736 | |
| 1723 temp = Fcons (make_number ((int) Swhitespace), Qnil); | 1737 temp = Fcons (make_number ((int) Swhitespace), Qnil); |
| 1724 | 1738 |
| 1725 Vstandard_syntax_table = Fmake_char_table (make_number (0), temp); | 1739 Vstandard_syntax_table = Fmake_char_table (Qsyntax_table, temp); |
| 1726 | 1740 |
| 1727 temp = Fcons (make_number ((int) Sword), Qnil); | 1741 temp = Fcons (make_number ((int) Sword), Qnil); |
| 1728 for (i = 'a'; i <= 'z'; i++) | 1742 for (i = 'a'; i <= 'z'; i++) |
| 1729 SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, i, temp); | 1743 SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, i, temp); |
| 1730 for (i = 'A'; i <= 'Z'; i++) | 1744 for (i = 'A'; i <= 'Z'; i++) |
