Function: log-edit-mode

log-edit-mode is an interactive and byte-compiled function defined in log-edit.el.gz.

Signature

(log-edit-mode)

Documentation

Major mode for editing version-control (VC) commit log messages.

When done editing the log entry, type M-x log-edit-done (log-edit-done), which will trigger the actual commit of the file(s). Several other handy support commands are provided, and the package from which this is used might also provide additional commands (under the C-x v (vc-prefix-map) prefix for VC commands, for example).

C-a log-edit-beginning-of-line
C-c ? log-edit-mode-help
C-c C-a log-edit-insert-changelog
C-c C-c log-edit-done
C-c C-d log-edit-show-diff
C-c C-f log-edit-show-files
C-c C-k log-edit-kill-buffer
C-c C-w log-edit-generate-changelog-from-diff
M-n log-edit-next-comment
M-p log-edit-previous-comment
M-r log-edit-comment-search-backward
M-s log-edit-comment-search-forward

In addition to any hooks its parent mode text-mode might have run, this mode runs the hook log-edit-mode-hook, as the final or penultimate step during initialization.

Probably introduced at or before Emacs version 21.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/log-edit.el.gz
(define-derived-mode log-edit-mode text-mode "Log-Edit"
  "Major mode for editing version-control (VC) commit log messages.
When done editing the log entry, type \\[log-edit-done], which will
trigger the actual commit of the file(s).
Several other handy support commands are provided, and the package
from which this is used might also provide additional commands (under
the \\[vc-prefix-map] prefix for VC commands, for example).

\\{log-edit-mode-map}"
  (setq-local font-lock-defaults '(log-edit-font-lock-keywords t))
  (make-local-variable 'font-lock-extra-managed-props)
  (cl-pushnew 'rear-nonsticky font-lock-extra-managed-props)
  (cl-pushnew 'display-line-numbers-disable font-lock-extra-managed-props)
  (setq-local jit-lock-contextually t)  ;For the "first line is summary".
  (setq-local fill-paragraph-function #'log-edit-fill-entry)
  (make-local-variable 'log-edit-comment-ring-index)
  (add-hook 'kill-buffer-hook 'log-edit-remember-comment nil t)
  (hack-dir-local-variables-non-file-buffer))