Function: log-edit-narrow-changelog

log-edit-narrow-changelog is a byte-compiled function defined in log-edit.el.gz.

Signature

(log-edit-narrow-changelog)

Documentation

Narrow to the top page of the current buffer, which visits a ChangeLog file.

Actually, the narrowed region doesn't include the date line. A "page" in a ChangeLog file is the area between two dates.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/log-edit.el.gz
;;;;
;;;; functions for getting commit message from ChangeLog a file...
;;;; Courtesy Jim Blandy
;;;;

(defun log-edit-narrow-changelog ()
  "Narrow to the top page of the current buffer, which visits a ChangeLog file.
Actually, the narrowed region doesn't include the date line.
A \"page\" in a ChangeLog file is the area between two dates."
  (or (eq major-mode 'change-log-mode)
      (error "log-edit-narrow-changelog: Current buffer isn't a ChangeLog"))

  (goto-char (point-min))

  ;; Skip date line and subsequent blank lines.
  (forward-line 1)
  (if (looking-at "[ \t\n]*\n")
      (goto-char (match-end 0)))

  (let ((start (point)))
    (forward-page 1)
    (narrow-to-region start (point))
    (goto-char (point-min))))