# HG changeset patch # User Richard M. Stallman # Date 772050052 0 # Node ID a6372621abd91cccfb7806de1aaf37c7c79c401f # Parent 82a5362b244f9f64b08ddcbcb3c01cc9b2ab3113 (Fmatching_paren): New function. (Fchar_syntax): Pass arg directly to SYNTAX, no masking. diff -r 82a5362b244f -r a6372621abd9 src/syntax.c --- 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);