Function: center-line-mode

center-line-mode is an interactive and byte-compiled function defined in text-mode.el.gz.

Signature

(center-line-mode &optional ARG)

Documentation

Minor mode for keeping modified lines centered horizontally.

Calls center-line on each line of the modified region to center the text within the width specified by fill-column.

This is a minor mode. If called interactively, toggle the Center-Line mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate the variable center-line-mode(var)/center-line-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

Probably introduced at or before Emacs version 31.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/text-mode.el.gz
(define-minor-mode center-line-mode
  "Minor mode for keeping modified lines centered horizontally.
Calls `center-line' on each line of the modified region to center the
text within the width specified by `fill-column'."
  :lighter " Center-Line"
  (require 'track-changes)
  (if center-line-mode
      (setq center-line-mode--track-changes
            (track-changes-register
             #'center-line-mode--track-changes-signal
             :nobefore t))
    (when center-line-mode--track-changes
      (track-changes-unregister center-line-mode--track-changes))))