Function: log-edit-changelog-insert-entries

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

Signature

(log-edit-changelog-insert-entries BUFFER BEG END &rest FILES)

Documentation

Insert the text from ChangeLog BUFFER between BEG and END.

Rename relative filenames in the ChangeLog entry with FILES. FILES are supposed to name the same files whose relative filenames are to be replaced, and their names relative to the directory of BUFFER are expected to match the relative file names in the ChangeLog entry.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/log-edit.el.gz
(defun log-edit-changelog-insert-entries (buffer beg end &rest files)
  "Insert the text from ChangeLog BUFFER between BEG and END.
Rename relative filenames in the ChangeLog entry with FILES.
FILES are supposed to name the same files whose relative filenames
are to be replaced, and their names relative to the directory of
BUFFER are expected to match the relative file names in the ChangeLog
entry."
  (let ((opoint (point))
	(log-name (buffer-file-name buffer))
	(case-fold-search nil)
	bound)
    (insert-buffer-substring buffer beg end)
    (setq bound (point-marker))
    (when log-name
      (dolist (f files)
        ;; FIXME: f can be a directory, a (possibly indirect) parent
        ;; of the ChangeLog file.
	(save-excursion
	  (goto-char opoint)
	  (when (re-search-forward
		 (concat "\\(^\\|[ \t]\\)\\("
			 (file-relative-name f (file-name-directory log-name))
			 "\\)[, :\n]")
		 bound t)
	    (replace-match f t t nil 2)))))
    ;; Eliminate tabs at the beginning of the line.
    (save-excursion
      (goto-char opoint)
      (while (re-search-forward "^\\(\t+\\)" bound t)
	(replace-match "")))))