Function: left-word

left-word is an interactive and byte-compiled function defined in bindings.el.gz.

Signature

(left-word &optional N)

Documentation

Move point N words to the left (to the right if N is negative).

Depending on the bidirectional context, this may move either backward or forward in the buffer. This is in contrast with M-b (backward-word) and M-f (forward-word), which see.

Value is normally t.

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(var)/subword-mode(fun), 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.

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.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/bindings.el.gz
(defun left-word (&optional n)
  "Move point N words to the left (to the right if N is negative).

Depending on the bidirectional context, this may move either backward
or forward in the buffer.  This is in contrast with \\[backward-word]
and \\[forward-word], which see.

Value is normally t.

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 `forward-word-strictly'
instead.  See Info node `(elisp) Word Motion' for details.

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."
  (interactive "^p")
  (if (eq (current-bidi-paragraph-direction) 'left-to-right)
      (backward-word n)
    (forward-word n)))