diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
commit | 07fcbb558d797272b9f43547da60beda485873a3 (patch) | |
tree | 77d5da14e9f9d9d8b1d877c70c01296fd3893796 /src/syntax.c | |
parent | c9bdeff3e45a7ac84a74a81bb048046f82dddc91 (diff) | |
parent | fb81c8c3adf8633f2f617c82f6019aef630860c7 (diff) | |
download | emacs-07fcbb558d797272b9f43547da60beda485873a3.tar.gz |
Merge remote-tracking branch 'origin/master' into athena/unstable
Diffstat (limited to 'src/syntax.c')
-rw-r--r-- | src/syntax.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/syntax.c b/src/syntax.c index 9fbf88535f3..7bba336744a 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -1109,6 +1109,23 @@ this is probably the wrong function to use, because it can't take return make_fixnum (syntax_code_spec[SYNTAX (char_int)]); } +DEFUN ("syntax-class-to-char", Fsyntax_class_to_char, + Ssyntax_class_to_char, 1, 1, 0, + doc: /* Return the syntax char of CLASS, described by an integer. +For example, if SYNTAX is word constituent (the integer 2), the +character `w' (119) is returned. */) + (Lisp_Object syntax) +{ + int syn; + CHECK_FIXNUM (syntax); + syn = XFIXNUM (syntax); + + if (syn < 0 || syn >= sizeof syntax_code_spec) + args_out_of_range (make_fixnum (sizeof syntax_code_spec - 1), + syntax); + return make_fixnum (syntax_code_spec[syn]); +} + DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0, doc: /* Return the matching parenthesis of CHARACTER, or nil if none. */) (Lisp_Object character) @@ -3782,6 +3799,7 @@ In both cases, LIMIT bounds the search. */); defsubr (&Scopy_syntax_table); defsubr (&Sset_syntax_table); defsubr (&Schar_syntax); + defsubr (&Ssyntax_class_to_char); defsubr (&Smatching_paren); defsubr (&Sstring_to_syntax); defsubr (&Smodify_syntax_entry); |