Subject: 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: Tue, 13 Mar 2018 22:24:46 -0400

Aaron Jensen <[email-masked]> writes:

> Thank you for the pointer. FWIW, I checked the docs of forward-word
> which only talks about buffer syntax tables. Perhaps that should
> either reference the Word Motion docs or it should also describe the
> whole picture.

I think leaving the whole picture to the manual makes more sense.

>From 4c0a6f91b72aae7f43a93f2d286731fcd939fecd 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'.
* src/syntax.c (forward-word): Add link to 'Word Motion' manual
section.
---
 doc/lispref/positions.texi | 2 +-
 src/syntax.c               | 3 ++-
 2 files changed, 3 insertions(+), 2 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/src/syntax.c b/src/syntax.c
index 378064611c..d3dd79229a 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1555,7 +1555,8 @@ DEFUN ("forward-word", Fforward_word, Sforward_word, 0, 1, "^p",
 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.  */)
+use `forward-word-strictly' instead.  See Info node `(elisp) Word
+Motion' for details.  */)
   (Lisp_Object arg)
 {
   Lisp_Object tmp;
-- 
2.11.0

> Also, as I understand the thread it seems like this is "by design" and
> there's no good/accepted way to get it to behave as I want without
> risking breaking unknown things.

Well, just taking the syntax entry as the sole source of truth and
ignoring the character script is probably the wrong thing.  

Maybe there is some other way to get the wanted behaviour though.  I
also found Bug#13129 asking about this.