Subject: Re: bug#30815: 26.0.91; unicode right single quote mark with syntax entry of w not respected by forward-word

From: Noam Postavsky <[email-masked]>
Date: Wed, 14 Mar 2018 19:19:22 -0400

Eli Zaretskii <[email-masked]> writes:

> I think we should at least mention char-script-table before sending
> the reader to the manual.  Currently we mention the syntax table, but
> keep complete silence regarding the script differences.

But if we give away everything in the doc string, nobody will read the
manual ;)

>From a37a09873b962e4fc273c690b34ed9aa43d17dd6 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <[email-masked]>
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