Function: backward-prefix-chars

backward-prefix-chars is a function defined in syntax.c.

Signature

(backward-prefix-chars)

Documentation

Move point backward over any number of chars with prefix syntax.

This includes chars with expression prefix syntax class (') and those with the prefix syntax flag (p).

View in manual

Source Code

// Defined in /usr/src/emacs/src/syntax.c
{
  ptrdiff_t beg = BEGV;
  ptrdiff_t opoint = PT;
  ptrdiff_t opoint_byte = PT_BYTE;
  ptrdiff_t pos = PT;
  ptrdiff_t pos_byte = PT_BYTE;
  int c;

  if (pos <= beg)
    {
      SET_PT_BOTH (opoint, opoint_byte);

      return Qnil;
    }

  SETUP_SYNTAX_TABLE (pos, -1);

  dec_both (&pos, &pos_byte);

  while (!char_quoted (pos, pos_byte)
	 /* Previous statement updates syntax table.  */
	 && ((c = FETCH_CHAR_AS_MULTIBYTE (pos_byte), SYNTAX (c) == Squote)
	     || syntax_prefix_flag_p (c)))
    {
      opoint = pos;
      opoint_byte = pos_byte;

      if (pos <= beg)
        break;
      dec_both (&pos, &pos_byte);
      rarely_quit (pos);
    }

  SET_PT_BOTH (opoint, opoint_byte);

  return Qnil;
}