Function: log-edit-fill-entry

log-edit-fill-entry is a byte-compiled function defined in log-edit.el.gz.

Signature

(log-edit-fill-entry &optional JUSTIFY)

Documentation

Like M-q (fill-paragraph), but for filling ChangeLog-formatted entries.

Consecutive function entries without prose (i.e., lines of the form "(FUNCTION):") will be combined into "(FUNC1, FUNC2):" according to fill-column.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/log-edit.el.gz
(defun log-edit-fill-entry (&optional justify)
  "Like \\[fill-paragraph], but for filling ChangeLog-formatted entries.
Consecutive function entries without prose (i.e., lines of the
form \"(FUNCTION):\") will be combined into \"(FUNC1, FUNC2):\"
according to `fill-column'."
  (save-excursion
    (pcase-let ((`(,beg ,end) (log-edit-changelog-paragraph)))
      (if (= beg end)
          ;; Not a ChangeLog entry, fill as normal.
          nil
        (cl-callf copy-marker end)
        (goto-char beg)
        (cl-loop
         for defuns-beg =
         (and (< beg end)
              (re-search-forward
               (concat "\\(?1:" change-log-unindented-file-names-re
                       "\\)\\|^\\(?1:\\)[[:blank:]]*(")
               end t)
              (copy-marker (match-end 1)))
         ;; Fill prose between log entries.
         do (let ((fill-indent-according-to-mode t)
                  (end (if defuns-beg (match-beginning 0) end))
                  (beg (progn (goto-char beg) (line-beginning-position))))
              (when (<= (line-end-position) end)
                (fill-region beg end justify)))
         while defuns-beg
         for defuns = (progn (goto-char defuns-beg)
                             (change-log-read-defuns end))
         do (progn (delete-region defuns-beg (point))
                   (log-edit--insert-filled-defuns defuns)
                   (setq beg (point))))
        t))))