diff options
| author | Richard M. Stallman | 1994-06-19 18:20:52 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-06-19 18:20:52 +0000 |
| commit | beefa22e7ba66ae2ba49e996f45b9d63b674c73a (patch) | |
| tree | 4603e2f407c6489a4f6a396b25abbbb4debe2f48 /src/syntax.c | |
| parent | c5ac35c10e4f54ab4805bd4e10602039636e92ec (diff) | |
| download | emacs-beefa22e7ba66ae2ba49e996f45b9d63b674c73a.tar.gz emacs-beefa22e7ba66ae2ba49e996f45b9d63b674c73a.zip | |
(Fmatching_paren): New function.
(Fchar_syntax): Pass arg directly to SYNTAX, no masking.
Diffstat (limited to 'src/syntax.c')
| -rw-r--r-- | src/syntax.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/syntax.c b/src/syntax.c index d1dd2931236..26511a23b29 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -223,7 +223,20 @@ are listed in the documentation of `modify-syntax-entry'.") | |||
| 223 | Lisp_Object ch; | 223 | Lisp_Object ch; |
| 224 | { | 224 | { |
| 225 | CHECK_NUMBER (ch, 0); | 225 | CHECK_NUMBER (ch, 0); |
| 226 | return make_number (syntax_code_spec[(int) SYNTAX (0xFF & XINT (ch))]); | 226 | return make_number (syntax_code_spec[(int) SYNTAX (XINT (ch))]); |
| 227 | } | ||
| 228 | |||
| 229 | DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0, | ||
| 230 | "Return the matching parenthesis of CHAR, or nil if none.") | ||
| 231 | (ch) | ||
| 232 | Lisp_Object ch; | ||
| 233 | { | ||
| 234 | int code; | ||
| 235 | CHECK_NUMBER (ch, 0); | ||
| 236 | code = SYNTAX (XINT (ch)); | ||
| 237 | if (code == Sopen && code == Sclose) | ||
| 238 | return make_number (SYNTAX_MATCH (XINT (ch))); | ||
| 239 | return Qnil; | ||
| 227 | } | 240 | } |
| 228 | 241 | ||
| 229 | /* This comment supplies the doc string for modify-syntax-entry, | 242 | /* This comment supplies the doc string for modify-syntax-entry, |
| @@ -1719,6 +1732,7 @@ syms_of_syntax () | |||
| 1719 | defsubr (&Scopy_syntax_table); | 1732 | defsubr (&Scopy_syntax_table); |
| 1720 | defsubr (&Sset_syntax_table); | 1733 | defsubr (&Sset_syntax_table); |
| 1721 | defsubr (&Schar_syntax); | 1734 | defsubr (&Schar_syntax); |
| 1735 | defsubr (&Smatching_paren); | ||
| 1722 | defsubr (&Smodify_syntax_entry); | 1736 | defsubr (&Smodify_syntax_entry); |
| 1723 | defsubr (&Sdescribe_syntax); | 1737 | defsubr (&Sdescribe_syntax); |
| 1724 | 1738 | ||