mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-05 22:20:24 -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:
parent
5b07a81bed
commit
5e98195e84
2 changed files with 23 additions and 15 deletions
|
|
@ -314,7 +314,6 @@ as a list of strings."
|
|||
",[[:blank:]]*" t)
|
||||
finally do (skip-chars-backward "\n[:blank:]")))
|
||||
|
||||
(declare-function log-edit-fill-entry "log-edit")
|
||||
(defun change-log-insert-entries (changelogs)
|
||||
"Format and insert CHANGELOGS into current buffer.
|
||||
CHANGELOGS is a list in the form returned by
|
||||
|
|
|
|||
|
|
@ -1057,20 +1057,29 @@ 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
|
||||
in the \"*vc-diff*\" buffer produced by this command."
|
||||
(interactive)
|
||||
(change-log-insert-entries
|
||||
(with-current-buffer
|
||||
(let* ((diff-buf nil)
|
||||
;; Unfortunately, `log-edit-show-diff' doesn't have a
|
||||
;; NO-SHOW option, so we try to work around it via
|
||||
;; display-buffer machinery.
|
||||
(display-buffer-overriding-action
|
||||
`(,(lambda (buf alist)
|
||||
(setq diff-buf buf)
|
||||
(display-buffer-no-window buf alist))
|
||||
. ((allow-no-window . t)))))
|
||||
(log-edit-show-diff)
|
||||
diff-buf)
|
||||
(diff-add-log-current-defuns))))
|
||||
(let* ((entries
|
||||
(with-current-buffer
|
||||
(let* ((diff-buf nil)
|
||||
;; Unfortunately, `log-edit-show-diff' doesn't have a
|
||||
;; NO-SHOW option, so we try to work around it via
|
||||
;; display-buffer machinery.
|
||||
(display-buffer-overriding-action
|
||||
`(,(lambda (buf alist)
|
||||
(setq diff-buf buf)
|
||||
(display-buffer-no-window buf alist))
|
||||
. ((allow-no-window . t)))))
|
||||
(log-edit-show-diff)
|
||||
diff-buf)
|
||||
(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)
|
||||
"Insert a VC commit log message by looking at the ChangeLog.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue