From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/elisp/skipping-characters.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 devdocs/elisp/skipping-characters.html (limited to 'devdocs/elisp/skipping-characters.html') diff --git a/devdocs/elisp/skipping-characters.html b/devdocs/elisp/skipping-characters.html new file mode 100644 index 00000000..af77c1e3 --- /dev/null +++ b/devdocs/elisp/skipping-characters.html @@ -0,0 +1,27 @@ +

Skipping Characters

The following two functions move point over a specified set of characters. For example, they are often used to skip whitespace. For related functions, see Motion and Syntax.

These functions convert the set string to multibyte if the buffer is multibyte, and they convert it to unibyte if the buffer is unibyte, as the search functions do (see Searching and Matching).

Function: skip-chars-forward character-set &optional limit +
+

This function moves point in the current buffer forward, skipping over a given set of characters. It examines the character following point, then advances point if the character matches character-set. This continues until it reaches a character that does not match. The function returns the number of characters moved over.

The argument character-set is a string, like the inside of a ‘[…]’ in a regular expression except that ‘]’ does not terminate it, and ‘\’ quotes ‘^’, ‘-’ or ‘\’. Thus, "a-zA-Z" skips over all letters, stopping before the first nonletter, and "^a-zA-Z" skips nonletters stopping before the first letter (see Regular Expressions). Character classes can also be used, e.g., "[:alnum:]" (see Char Classes).

If limit is supplied (it must be a number or a marker), it specifies the maximum position in the buffer that point can be skipped to. Point will stop at or before limit.

In the following example, point is initially located directly before the ‘T’. After the form is evaluated, point is located at the end of that line (between the ‘t’ of ‘hat’ and the newline). The function skips all letters and spaces, but not newlines.

---------- Buffer: foo ----------
+I read "∗The cat in the hat
+comes back" twice.
+---------- Buffer: foo ----------
+
+ +
(skip-chars-forward "a-zA-Z ")
+     ⇒ 18
+
+---------- Buffer: foo ----------
+I read "The cat in the hat∗
+comes back" twice.
+---------- Buffer: foo ----------
+
+
+
Function: skip-chars-backward character-set &optional limit +
+

This function moves point backward, skipping characters that match character-set, until limit. It is just like skip-chars-forward except for the direction of motion.

The return value indicates the distance traveled. It is an integer that is zero or less.

+
+
+

+ Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
+ https://www.gnu.org/software/emacs/manual/html_node/elisp/Skipping-Characters.html +

+
-- cgit v1.2.3