emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 4ef153b: Improve doc strings of 'forward/backward


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 4ef153b: Improve doc strings of 'forward/backward-word-strictly'
Date: Wed, 10 Feb 2016 18:32:04 +0000

branch: emacs-25
commit 4ef153b55a543e67dec280accb1b2a3543089060
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Improve doc strings of 'forward/backward-word-strictly'
    
    * lisp/simple.el (backward-word): Refer to 'backward-word-strictly'
    in the doc string.  Suggested by Glenn Morris <address@hidden>.
    * lisp/subr.el (forward-word-strictly, backward-word-strictly):
    Mention 'subword-mode' in the doc strings.
    
    * src/syntax.c (Fforward_word): Refer to 'forward-word-strictly'
    in the doc string.  (Bug#22560)
---
 lisp/simple.el |    8 +++++++-
 lisp/subr.el   |    6 ++++--
 src/syntax.c   |   12 +++++++++---
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index e39c864..0b04b80 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6736,7 +6736,13 @@ current object."
 (defun backward-word (&optional arg)
   "Move backward until encountering the beginning of a word.
 With argument ARG, do this that many times.
-If ARG is omitted or nil, move point backward one word."
+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."
   (interactive "^p")
   (forward-word (- (or arg 1))))
 
diff --git a/lisp/subr.el b/lisp/subr.el
index 3113481..cf26fe3 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4137,7 +4137,8 @@ and the function returns nil.  Field boundaries are not 
noticed if
 `inhibit-field-text-motion' is non-nil.
 
 This function is like `forward-word', but it is not affected
-by `find-word-boundary-function-table'.  It is also not interactive."
+by `find-word-boundary-function-table' (as set up by
+e.g. `subword-mode').  It is also not interactive."
   (let ((find-word-boundary-function-table
          (if (char-table-p word-move-empty-char-table)
              word-move-empty-char-table
@@ -4150,7 +4151,8 @@ With argument ARG, do this that many times.
 If ARG is omitted or nil, move point backward one word.
 
 This function is like `forward-word', but it is not affected
-by `find-word-boundary-function-table'.  It is also not interactive."
+by `find-word-boundary-function-table' (as set up by
+e.g. `subword-mode').  It is also not interactive."
   (let ((find-word-boundary-function-table
          (if (char-table-p word-move-empty-char-table)
              word-move-empty-char-table
diff --git a/src/syntax.c b/src/syntax.c
index 8b5cc1d..7e98854 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1536,9 +1536,15 @@ DEFUN ("forward-word", Fforward_word, Sforward_word, 0, 
1, "^p",
        doc: /* Move point forward ARG words (backward if ARG is negative).
 If ARG is omitted or nil, move point forward one word.
 Normally returns t.
-If an edge of the buffer or a field boundary is reached, point is left there
-and the function returns nil.  Field boundaries are not noticed if
-`inhibit-field-text-motion' is non-nil.  */)
+If an edge of the buffer or a field boundary is reached, point is
+left there and the function returns nil.  Field boundaries are not
+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.  */)
   (Lisp_Object arg)
 {
   Lisp_Object tmp;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]