Mercurial > emacs
diff src/syntax.c @ 7968:a6372621abd9
(Fmatching_paren): New function.
(Fchar_syntax): Pass arg directly to SYNTAX, no masking.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 19 Jun 1994 18:20:52 +0000 |
parents | 63a2327f0783 |
children | 49dc4ea976a0 |
line wrap: on
line diff
--- a/src/syntax.c Sun Jun 19 18:18:20 1994 +0000 +++ b/src/syntax.c Sun Jun 19 18:20:52 1994 +0000 @@ -223,7 +223,20 @@ Lisp_Object ch; { CHECK_NUMBER (ch, 0); - return make_number (syntax_code_spec[(int) SYNTAX (0xFF & XINT (ch))]); + return make_number (syntax_code_spec[(int) SYNTAX (XINT (ch))]); +} + +DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0, + "Return the matching parenthesis of CHAR, or nil if none.") + (ch) + Lisp_Object ch; +{ + int code; + CHECK_NUMBER (ch, 0); + code = SYNTAX (XINT (ch)); + if (code == Sopen && code == Sclose) + return make_number (SYNTAX_MATCH (XINT (ch))); + return Qnil; } /* This comment supplies the doc string for modify-syntax-entry, @@ -1719,6 +1732,7 @@ defsubr (&Scopy_syntax_table); defsubr (&Sset_syntax_table); defsubr (&Schar_syntax); + defsubr (&Smatching_paren); defsubr (&Smodify_syntax_entry); defsubr (&Sdescribe_syntax);