Function: move-beginning-of-line
move-beginning-of-line is an interactive and byte-compiled function
defined in simple.el.gz.
Signature
(move-beginning-of-line ARG)
Documentation
Move point to visible beginning of current logical line.
This disregards any invisible newline characters.
When moving from position that has no field property, this
command doesn't enter text which has non-nil field property.
In particular, when invoked in the minibuffer, the command will
stop short of entering the text of the minibuffer prompt.
See inhibit-field-text-motion for how to inhibit this.
With argument ARG not nil or 1, move forward ARG - 1 lines first.
If point reaches the beginning or end of buffer, it stops there.
(But if the buffer doesn't end in a newline, it stops at the
beginning of the last line.)
To ignore intangibility, bind inhibit-point-motion-hooks to t.
For motion by visual lines, see beginning-of-visual-line.
Probably introduced at or before Emacs version 28.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defun move-beginning-of-line (arg)
"Move point to visible beginning of current logical line.
This disregards any invisible newline characters.
When moving from position that has no `field' property, this
command doesn't enter text which has non-nil `field' property.
In particular, when invoked in the minibuffer, the command will
stop short of entering the text of the minibuffer prompt.
See `inhibit-field-text-motion' for how to inhibit this.
With argument ARG not nil or 1, move forward ARG - 1 lines first.
If point reaches the beginning or end of buffer, it stops there.
\(But if the buffer doesn't end in a newline, it stops at the
beginning of the last line.)
To ignore intangibility, bind `inhibit-point-motion-hooks' to t.
For motion by visual lines, see `beginning-of-visual-line'."
(interactive "^p")
(or arg (setq arg 1))
(let ((orig (point))
first-vis first-vis-field-value)
;; Move by lines, if ARG is not 1 (the default).
(if (/= arg 1)
(let ((line-move-visual nil))
(line-move (1- arg) t)))
;; Move to beginning-of-line, ignoring fields and invisible text.
(skip-chars-backward "^\n")
(while (and (not (bobp)) (invisible-p (1- (point))))
(goto-char (previous-char-property-change (point)))
(skip-chars-backward "^\n"))
;; Now find first visible char in the line.
(while (and (< (point) orig) (invisible-p (point)))
(goto-char (next-char-property-change (point) orig)))
(setq first-vis (point))
;; See if fields would stop us from reaching FIRST-VIS.
(setq first-vis-field-value
(constrain-to-field first-vis orig (/= arg 1) t nil))
(goto-char (if (/= first-vis-field-value first-vis)
;; If yes, obey them.
first-vis-field-value
;; Otherwise, move to START with attention to fields.
;; (It is possible that fields never matter in this case.)
(constrain-to-field (point) orig
(/= arg 1) t nil)))))