Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

This commit is contained in:
Michael Albinus 2025-09-12 16:49:40 +02:00
commit bfeffc4436
3 changed files with 36 additions and 43 deletions

View file

@ -32,7 +32,7 @@
(require 'add-log) ; for all the ChangeLog goodies
(require 'pcvs-util)
(require 'ring)
(require 'message)
(require 'cl-lib)
;;;;
;;;; Global Variables
@ -65,8 +65,7 @@
"M-p" #'log-edit-previous-comment
"M-r" #'log-edit-comment-search-backward
"M-s" #'log-edit-comment-search-forward
"C-c ?" #'log-edit-mode-help
"<remap> <move-beginning-of-line>" #'log-edit-beginning-of-line)
"C-c ?" #'log-edit-mode-help)
(easy-menu-define log-edit-menu log-edit-mode-map
"Menu used for `log-edit-mode'."
@ -898,7 +897,7 @@ visible when the *vc-log* buffer pops up."
(save-selected-window
(let ((display-buffer-overriding-action '(nil
. ((inhibit-same-window . t)))))
(funcall log-edit-diff-function)))))
(funcall log-edit-diff-function)))))
(defun log-edit-show-files ()
"Show the list of files to be committed."
@ -918,15 +917,6 @@ visible when the *vc-log* buffer pops up."
(set-window-dedicated-p (selected-window) t)
(selected-window)))))
(defun log-edit-beginning-of-line (&optional n)
"Move point to beginning of header value or to beginning of line.
It works the same as `message-beginning-of-line', but it uses a
different header separator appropriate for `log-edit-mode'."
(interactive "p")
(let ((mail-header-separator ""))
(message-beginning-of-line n)))
(defun log-edit-empty-buffer-p ()
"Return non-nil if the buffer is \"empty\"."
(or (= (point-min) (point-max))

View file

@ -1083,21 +1083,21 @@ If toggling on, also insert its message into the buffer."
"C-c C-e" #'vc-git-log-edit-toggle-amend)
(defun vc-git--log-edit-summary-check (limit)
(and (re-search-forward "^Summary: " limit t)
(when-let* ((regex
(cond ((and (natnump vc-git-log-edit-summary-max-len)
(natnump vc-git-log-edit-summary-target-len))
(format ".\\{,%d\\}\\(.\\{,%d\\}\\)\\(.*\\)"
vc-git-log-edit-summary-target-len
(- vc-git-log-edit-summary-max-len
vc-git-log-edit-summary-target-len)))
((natnump vc-git-log-edit-summary-max-len)
(format ".\\{,%d\\}\\(?2:.*\\)"
vc-git-log-edit-summary-max-len))
((natnump vc-git-log-edit-summary-target-len)
(format ".\\{,%d\\}\\(.*\\)"
vc-git-log-edit-summary-target-len)))))
(re-search-forward regex limit t))))
(and-let* (((re-search-forward "^Summary: " limit t))
(regex
(cond ((and (natnump vc-git-log-edit-summary-max-len)
(natnump vc-git-log-edit-summary-target-len))
(format ".\\{,%d\\}\\(.\\{,%d\\}\\)\\(.*\\)"
vc-git-log-edit-summary-target-len
(- vc-git-log-edit-summary-max-len
vc-git-log-edit-summary-target-len)))
((natnump vc-git-log-edit-summary-max-len)
(format ".\\{,%d\\}\\(?2:.*\\)"
vc-git-log-edit-summary-max-len))
((natnump vc-git-log-edit-summary-target-len)
(format ".\\{,%d\\}\\(.*\\)"
vc-git-log-edit-summary-target-len)))))
(re-search-forward regex limit t)))
(define-derived-mode vc-git-log-edit-mode log-edit-mode "Log-Edit/git"
"Major mode for editing Git log messages.

View file

@ -2652,9 +2652,9 @@ global binding."
;; 'repository)
;; (ignore-errors
;; (vc-call-backend backend 'working-revision
;; (car fileset)))
;; (caadr fileset)))
(vc-call-backend backend 'working-revision
(car fileset))
(caadr fileset))
(called-interactively-p 'interactive))))
;; For the following two commands, the default meaning for
@ -4257,19 +4257,22 @@ marked revisions, use those."
'prepare-patch rev))
revisions)))
(if vc-prepare-patches-separately
(dolist (patch (reverse patches)
(message "Prepared %d patch%s..." (length patches)
(if (length> patches 1) "es" "")))
(compose-mail addressee
(plist-get patch :subject)
nil nil nil nil
`((kill-buffer ,(plist-get patch :buffer))))
(rfc822-goto-eoh) (forward-line)
(save-excursion ;don't jump to the end
(insert-buffer-substring
(plist-get patch :buffer)
(plist-get patch :body-start)
(plist-get patch :body-end))))
(cl-loop with l = (length patches)
for patch in (reverse patches) do
(compose-mail addressee
(plist-get patch :subject)
nil nil nil nil
`((kill-buffer ,(plist-get patch :buffer))))
(rfc822-goto-eoh) (forward-line)
(save-excursion ;don't jump to the end
(insert-buffer-substring
(plist-get patch :buffer)
(plist-get patch :body-start)
(plist-get patch :body-end)))
finally (message (ngettext "Prepared %d patch..."
"Prepared %d patches..."
l)
l))
(compose-mail addressee subject nil nil nil nil
(mapcar
(lambda (p)