aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorStefan Monnier2001-11-02 23:27:02 +0000
committerStefan Monnier2001-11-02 23:27:02 +0000
commit62abe9cbe014bd3e7f1b880a499848247d0e152f (patch)
treec6cde1cb6c0f66c600b1d23152d80a06a7176521 /src/syntax.c
parent1b1acc13ab403a53fd9b9d93046091331e1d590f (diff)
downloademacs-62abe9cbe014bd3e7f1b880a499848247d0e152f.tar.gz
emacs-62abe9cbe014bd3e7f1b880a499848247d0e152f.zip
(describe_syntax): New wrapper.
(Finternal_describe_syntax_value): Rename from describe_syntax. Don't insert space at front and \n at the end. (syms_of_syntax): Defsubr Sinternal_describe_syntax_value.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 4c5bb546755..96ff69084f0 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1025,33 +1025,33 @@ usage: (modify-syntax-entry CHAR NEWENTRY &optional SYNTAX-TABLE) */)
1025 1025
1026/* Dump syntax table to buffer in human-readable format */ 1026/* Dump syntax table to buffer in human-readable format */
1027 1027
1028static void 1028DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
1029describe_syntax (value) 1029 Sinternal_describe_syntax_value, 1, 1, 0,
1030 Lisp_Object value; 1030 doc: /* Insert a description of the internal syntax description SYNTAX at point. */)
1031 (syntax)
1032 Lisp_Object syntax;
1031{ 1033{
1032 register enum syntaxcode code; 1034 register enum syntaxcode code;
1033 char desc, start1, start2, end1, end2, prefix, comstyle, comnested; 1035 char desc, start1, start2, end1, end2, prefix, comstyle, comnested;
1034 char str[2]; 1036 char str[2];
1035 Lisp_Object first, match_lisp; 1037 Lisp_Object first, match_lisp, value = syntax;
1036
1037 Findent_to (make_number (16), make_number (1));
1038 1038
1039 if (NILP (value)) 1039 if (NILP (value))
1040 { 1040 {
1041 insert_string ("default\n"); 1041 insert_string ("default");
1042 return; 1042 return syntax;
1043 } 1043 }
1044 1044
1045 if (CHAR_TABLE_P (value)) 1045 if (CHAR_TABLE_P (value))
1046 { 1046 {
1047 insert_string ("deeper char-table ...\n"); 1047 insert_string ("deeper char-table ...");
1048 return; 1048 return syntax;
1049 } 1049 }
1050 1050
1051 if (!CONSP (value)) 1051 if (!CONSP (value))
1052 { 1052 {
1053 insert_string ("invalid\n"); 1053 insert_string ("invalid");
1054 return; 1054 return syntax;
1055 } 1055 }
1056 1056
1057 first = XCAR (value); 1057 first = XCAR (value);
@@ -1059,8 +1059,8 @@ describe_syntax (value)
1059 1059
1060 if (!INTEGERP (first) || !(NILP (match_lisp) || INTEGERP (match_lisp))) 1060 if (!INTEGERP (first) || !(NILP (match_lisp) || INTEGERP (match_lisp)))
1061 { 1061 {
1062 insert_string ("invalid\n"); 1062 insert_string ("invalid");
1063 return; 1063 return syntax;
1064 } 1064 }
1065 1065
1066 code = (enum syntaxcode) (XINT (first) & 0377); 1066 code = (enum syntaxcode) (XINT (first) & 0377);
@@ -1075,7 +1075,7 @@ describe_syntax (value)
1075 if ((int) code < 0 || (int) code >= (int) Smax) 1075 if ((int) code < 0 || (int) code >= (int) Smax)
1076 { 1076 {
1077 insert_string ("invalid"); 1077 insert_string ("invalid");
1078 return; 1078 return syntax;
1079 } 1079 }
1080 desc = syntax_code_spec[(int) code]; 1080 desc = syntax_code_spec[(int) code];
1081 1081
@@ -1142,7 +1142,7 @@ describe_syntax (value)
1142 insert_string ("string fence"); break; 1142 insert_string ("string fence"); break;
1143 default: 1143 default:
1144 insert_string ("invalid"); 1144 insert_string ("invalid");
1145 return; 1145 return syntax;
1146 } 1146 }
1147 1147
1148 if (!NILP (match_lisp)) 1148 if (!NILP (match_lisp))
@@ -1168,9 +1168,20 @@ describe_syntax (value)
1168 if (prefix) 1168 if (prefix)
1169 insert_string (",\n\t is a prefix character for `backward-prefix-chars'"); 1169 insert_string (",\n\t is a prefix character for `backward-prefix-chars'");
1170 1170
1171 return syntax;
1172}
1173
1174
1175static void
1176describe_syntax (value)
1177 Lisp_Object value;
1178{
1179 Findent_to (make_number (16), make_number (1));
1180 Finternal_describe_syntax_value (value);
1171 insert_string ("\n"); 1181 insert_string ("\n");
1172} 1182}
1173 1183
1184
1174static Lisp_Object 1185static Lisp_Object
1175describe_syntax_1 (vector) 1186describe_syntax_1 (vector)
1176 Lisp_Object vector; 1187 Lisp_Object vector;
@@ -3027,6 +3038,7 @@ See the info node `(elisp)Syntax Properties' for a description of the
3027 defsubr (&Sstring_to_syntax); 3038 defsubr (&Sstring_to_syntax);
3028 defsubr (&Smodify_syntax_entry); 3039 defsubr (&Smodify_syntax_entry);
3029 defsubr (&Sdescribe_syntax); 3040 defsubr (&Sdescribe_syntax);
3041 defsubr (&Sinternal_describe_syntax_value);
3030 3042
3031 defsubr (&Sforward_word); 3043 defsubr (&Sforward_word);
3032 3044