Function: message-beginning-of-line

message-beginning-of-line is an interactive and byte-compiled function defined in message.el.gz.

Signature

(message-beginning-of-line &optional N)

Documentation

Move point to beginning of header value or to beginning of line.

The prefix argument N is passed directly to beginning-of-line.

This command is identical to beginning-of-line if point is outside the message header or if the option message-beginning-of-line(var)/message-beginning-of-line(fun) is nil.

If point is in the message header and on a header line, move point to the beginning of the header value or the beginning of line, whichever is closer. If point is already at beginning of line, move point to beginning of header value. Therefore, repeated calls will toggle point between beginning of field and beginning of line.

When called without a prefix argument, header value spanning multiple lines is treated as a single line. Otherwise, even if N is 1, when point is on a continuation header line, it will be moved to the beginning.

Probably introduced at or before Emacs version 26.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/message.el.gz
(defun message-beginning-of-line (&optional n)
  "Move point to beginning of header value or to beginning of line.
The prefix argument N is passed directly to `beginning-of-line'.

This command is identical to `beginning-of-line' if point is
outside the message header or if the option
`message-beginning-of-line' is nil.

If point is in the message header and on a header line, move
point to the beginning of the header value or the beginning of
line, whichever is closer.  If point is already at beginning of
line, move point to beginning of header value.  Therefore,
repeated calls will toggle point between beginning of field and
beginning of line.

When called without a prefix argument, header value spanning
multiple lines is treated as a single line.  Otherwise, even if
N is 1, when point is on a continuation header line, it will be
moved to the beginning."
  (interactive "^p" message-mode)
  (cond
   ;; Go to beginning of header or beginning of line.
   ((and message-beginning-of-line (message-point-in-header-p))
    (let* ((point (point))
           (bol (progn (beginning-of-line n) (point)))
           (boh (message-beginning-of-header visual-line-mode)))
      (goto-char (if (and boh (or (< boh point) (= bol point))) boh bol))))
   ;; Go to beginning of visual line
   (visual-line-mode
    (beginning-of-visual-line n))
   ;; Go to beginning of line.
   ((beginning-of-line n))))