1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

log-edit-generate-changelog-from-diff: Special-case Summary field

* lisp/vc/add-log.el (log-edit-fill-entry): Delete unused
declaration.
* lisp/vc/log-edit.el (log-edit-generate-changelog-from-diff):
Special-case inserting a single line into the Summary field.
This commit is contained in:
Sean Whitton 2025-12-01 11:14:55 +00:00
parent 5b07a81bed
commit 5e98195e84
2 changed files with 23 additions and 15 deletions

View file

@ -314,7 +314,6 @@ as a list of strings."
",[[:blank:]]*" t) ",[[:blank:]]*" t)
finally do (skip-chars-backward "\n[:blank:]"))) finally do (skip-chars-backward "\n[:blank:]")))
(declare-function log-edit-fill-entry "log-edit")
(defun change-log-insert-entries (changelogs) (defun change-log-insert-entries (changelogs)
"Format and insert CHANGELOGS into current buffer. "Format and insert CHANGELOGS into current buffer.
CHANGELOGS is a list in the form returned by CHANGELOGS is a list in the form returned by

View file

@ -1057,7 +1057,7 @@ names into a single entry where they all share the same description.
Should you need to look at the diffs themselves, they can be found Should you need to look at the diffs themselves, they can be found
in the \"*vc-diff*\" buffer produced by this command." in the \"*vc-diff*\" buffer produced by this command."
(interactive) (interactive)
(change-log-insert-entries (let* ((entries
(with-current-buffer (with-current-buffer
(let* ((diff-buf nil) (let* ((diff-buf nil)
;; Unfortunately, `log-edit-show-diff' doesn't have a ;; Unfortunately, `log-edit-show-diff' doesn't have a
@ -1070,7 +1070,16 @@ in the \"*vc-diff*\" buffer produced by this command."
. ((allow-no-window . t))))) . ((allow-no-window . t)))))
(log-edit-show-diff) (log-edit-show-diff)
diff-buf) diff-buf)
(diff-add-log-current-defuns)))) (diff-add-log-current-defuns)))
(single-line-summary
(and (length= entries 1)
(length< (cdar entries) 2)
(< (point) (save-excursion (rfc822-goto-eoh) (point)))
(save-excursion (forward-line 0) (looking-at "Summary:")))))
(change-log-insert-entries entries)
(when single-line-summary
(delete-char -1)
(insert " "))))
(defun log-edit-insert-changelog (&optional use-first) (defun log-edit-insert-changelog (&optional use-first)
"Insert a VC commit log message by looking at the ChangeLog. "Insert a VC commit log message by looking at the ChangeLog.