/* XEmacs routines to deal with syntax tables; also word and list parsing.
Copyright (C) 1985-1994 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
/* XEmacs routines to deal with syntax tables; also word and list parsing.
Copyright (C) 1985-1994 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
/* Use previous finding, if it's valid and applies to this inquiry. */
if (buf == find_start_buffer
/* Use previous finding, if it's valid and applies to this inquiry. */
if (buf == find_start_buffer
struct buffer *buf = decode_buffer (buffer, 0);
syntax_table = check_syntax_table (syntax_table, Qnil);
buf->syntax_table = syntax_table;
struct buffer *buf = decode_buffer (buffer, 0);
syntax_table = check_syntax_table (syntax_table, Qnil);
buf->syntax_table = syntax_table;
/* Indicate that this buffer now has a specified syntax table. */
buf->local_var_flags |= XINT (buffer_local_flags.syntax_table);
return syntax_table;
/* Indicate that this buffer now has a specified syntax table. */
buf->local_var_flags |= XINT (buffer_local_flags.syntax_table);
return syntax_table;
}
CHECK_CHAR_COERCE_INT (character);
syntax_table = check_syntax_table (syntax_table, current_buffer->syntax_table);
}
CHECK_CHAR_COERCE_INT (character);
syntax_table = check_syntax_table (syntax_table, current_buffer->syntax_table);
mirrortab = XCHAR_TABLE (XCHAR_TABLE (syntax_table)->mirror_table);
return make_char (syntax_code_spec[(int) SYNTAX (mirrortab, XCHAR (character))]);
mirrortab = XCHAR_TABLE (XCHAR_TABLE (syntax_table)->mirror_table);
return make_char (syntax_code_spec[(int) SYNTAX (mirrortab, XCHAR (character))]);
int code;
CHECK_CHAR_COERCE_INT (character);
syntax_table = check_syntax_table (syntax_table, current_buffer->syntax_table);
int code;
CHECK_CHAR_COERCE_INT (character);
syntax_table = check_syntax_table (syntax_table, current_buffer->syntax_table);
mirrortab = XCHAR_TABLE (XCHAR_TABLE (syntax_table)->mirror_table);
code = SYNTAX (mirrortab, XCHAR (character));
mirrortab = XCHAR_TABLE (XCHAR_TABLE (syntax_table)->mirror_table);
code = SYNTAX (mirrortab, XCHAR (character));
if (code == Sopen || code == Sclose || code == Sstring)
return syntax_match (syntax_table, XCHAR (character));
return Qnil;
if (code == Sopen || code == Sclose || code == Sstring)
return syntax_match (syntax_table, XCHAR (character));
return Qnil;
scan_words (struct buffer *buf, Bufpos from, int count)
{
Bufpos limit = count > 0 ? BUF_ZV (buf) : BUF_BEGV (buf);
scan_words (struct buffer *buf, Bufpos from, int count)
{
Bufpos limit = count > 0 ? BUF_ZV (buf) : BUF_BEGV (buf);
-DEFUN ("forward-word", Fforward_word, 1, 2, "_p", /*
+DEFUN ("forward-word", Fforward_word, 0, 2, "_p", /*
-Normally returns t.
-If an edge of the buffer is reached, point is left there
-and nil is returned.
+Normally t is returned, but if an edge of the buffer is reached,
+point is left there and nil is returned.
- BUF_SET_PT (buf, XINT (count) > 0 ? BUF_ZV (buf) : BUF_BEGV (buf));
+ CHECK_INT (count);
+ n = XINT (count);
+ }
+
+ val = scan_words (buf, BUF_PT (buf), n);
+ if (val)
+ {
+ BUF_SET_PT (buf, val);
+ return Qt;
+ }
+ else
+ {
+ BUF_SET_PT (buf, n > 0 ? BUF_ZV (buf) : BUF_BEGV (buf));
/* Look back, counting the parity of string-quotes,
and recording the comment-starters seen.
/* Look back, counting the parity of string-quotes,
and recording the comment-starters seen.
find_end_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int mask)
{
int c;
find_end_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int mask)
{
int c;
ever complains about this function not working properly, take a look
at those changes. --ben */
ever complains about this function not working properly, take a look
at those changes. --ben */
-DEFUN ("forward-comment", Fforward_comment, 1, 2, 0, /*
+DEFUN ("forward-comment", Fforward_comment, 0, 2, 0, /*
Move forward across up to COUNT comments, or backwards if COUNT is negative.
Stop scanning if we find something other than a comment or whitespace.
Set point to where scanning stops.
If COUNT comments are found as expected, with nothing except whitespace
between them, return t; otherwise return nil.
Point is set in either case.
Move forward across up to COUNT comments, or backwards if COUNT is negative.
Stop scanning if we find something other than a comment or whitespace.
Set point to where scanning stops.
If COUNT comments are found as expected, with nothing except whitespace
between them, return t; otherwise return nil.
Point is set in either case.
enum syntaxcode code;
int min_depth = depth; /* Err out if depth gets less than this. */
Lisp_Object syntaxtab = buf->syntax_table;
enum syntaxcode code;
int min_depth = depth; /* Err out if depth gets less than this. */
Lisp_Object syntaxtab = buf->syntax_table;
struct buffer *buf = decode_buffer (buffer, 0);
Bufpos beg = BUF_BEGV (buf);
Bufpos pos = BUF_PT (buf);
struct buffer *buf = decode_buffer (buffer, 0);
Bufpos beg = BUF_BEGV (buf);
Bufpos pos = BUF_PT (buf);
while (pos > beg && !char_quoted (buf, pos - 1)
&& (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1)) == Squote
while (pos > beg && !char_quoted (buf, pos - 1)
&& (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1)) == Squote