From a37a09873b962e4fc273c690b34ed9aa43d17dd6 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 13 Mar 2018 22:17:43 -0400 Subject: [PATCH] Improve word motion docs (Bug#30815) * doc/lispref/positions.texi (Word Motion): Fix reference to `char-script-table'. * lisp/simple.el (backward-word): * src/syntax.c (forward-word): Mention `char-script-table' and add link to the 'Word Motion' manual section. --- doc/lispref/positions.texi | 2 +- lisp/simple.el | 12 +++++++----- src/syntax.c | 9 +++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index 0a03e246c0..fdc8bb96ae 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -210,7 +210,7 @@ Word Motion modes can override that by setting up a suitable @code{find-word-boundary-function-table}, described below. Characters that belong to different scripts (as defined by -@code{char-syntax-table}), also define a word boundary +@code{char-script-table}), also define a word boundary (@pxref{Character Properties}). In any case, this function cannot move point past the boundary of the accessible portion of the buffer, or across a field boundary (@pxref{Fields}). The most common case of diff --git a/lisp/simple.el b/lisp/simple.el index b7ad6ebd79..d8abeb3000 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7027,11 +7027,13 @@ backward-word With argument ARG, do this that many times. If ARG is omitted or nil, move point backward one word. -The word boundaries are normally determined by the buffer's syntax -table, but `find-word-boundary-function-table', such as set up -by `subword-mode', can change that. If a Lisp program needs to -move by words determined strictly by the syntax table, it should -use `backward-word-strictly' instead." +The word boundaries are normally determined by the buffer's +syntax table and character script (according to +`char-script-table'), but `find-word-boundary-function-table', +such as set up by `subword-mode', can change that. If a Lisp +program needs to move by words determined strictly by the syntax +table, it should use `backward-word-strictly' instead. See Info +node `(elisp) Word Motion' for details." (interactive "^p") (forward-word (- (or arg 1)))) diff --git a/src/syntax.c b/src/syntax.c index 378064611c..e54325589f 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -1552,10 +1552,11 @@ DEFUN ("forward-word", Fforward_word, Sforward_word, 0, 1, "^p", noticed if `inhibit-field-text-motion' is non-nil. The word boundaries are normally determined by the buffer's syntax -table, but `find-word-boundary-function-table', such as set up -by `subword-mode', can change that. If a Lisp program needs to -move by words determined strictly by the syntax table, it should -use `forward-word-strictly' instead. */) +table and character script (according to `char-script-table'), but +`find-word-boundary-function-table', such as set up by `subword-mode', +can change that. If a Lisp program needs to move by words determined +strictly by the syntax table, it should use `forward-word-strictly' +instead. See Info node `(elisp) Word Motion' for details. */) (Lisp_Object arg) { Lisp_Object tmp; -- 2.11.0