comparison lispref/positions.texi @ 49553:d51a733d4b6b

(Skipping Characters): Multibyte conversion and char classes in skip-chars-forward.
author Dave Love <fx@gnu.org>
date Fri, 31 Jan 2003 16:28:28 +0000
parents b9d62d4d6921
children 23a1cea22d13
comparison
equal deleted inserted replaced
49552:5fc04772d0bd 49553:d51a733d4b6b
743 743
744 The following two functions move point over a specified set of 744 The following two functions move point over a specified set of
745 characters. For example, they are often used to skip whitespace. For 745 characters. For example, they are often used to skip whitespace. For
746 related functions, see @ref{Motion and Syntax}. 746 related functions, see @ref{Motion and Syntax}.
747 747
748 These functions convert the set string to multibyte if the buffer is
749 multibyte, and they convert it to unibyte if the buffer is unibyte, as
750 the search functions do (@pxref{Searching and Matching}).
751
748 @defun skip-chars-forward character-set &optional limit 752 @defun skip-chars-forward character-set &optional limit
749 This function moves point in the current buffer forward, skipping over a 753 This function moves point in the current buffer forward, skipping over a
750 given set of characters. It examines the character following point, 754 given set of characters. It examines the character following point,
751 then advances point if the character matches @var{character-set}. This 755 then advances point if the character matches @var{character-set}. This
752 continues until it reaches a character that does not match. The 756 continues until it reaches a character that does not match. The
783 ---------- Buffer: foo ---------- 787 ---------- Buffer: foo ----------
784 I read "The cat in the hat@point{} 788 I read "The cat in the hat@point{}
785 comes back" twice. 789 comes back" twice.
786 ---------- Buffer: foo ---------- 790 ---------- Buffer: foo ----------
787 @end group 791 @end group
792 @end example
793
794 Note that char classes are not currently supported in
795 @var{character-set}; they will be treated as literals. Thus you
796 cannot use @code{"[:alpha:]"} instead of @code{"a-zA-Z"} to include
797 non-ASCII letters. A way to skip forward over all letters is:
798
799 @example
800 (re-search-forward "\\=[[:alpha:]]*" nil t)
788 @end example 801 @end example
789 @end defun 802 @end defun
790 803
791 @defun skip-chars-backward character-set &optional limit 804 @defun skip-chars-backward character-set &optional limit
792 This function moves point backward, skipping characters that match 805 This function moves point backward, skipping characters that match