]> git.eshelyaron.com Git - emacs.git/commitdiff
; Insert "Stealing lock" at the beginning of a message
authorPhilip Kaludercic <philipk@posteo.net>
Sat, 26 Oct 2024 07:39:00 +0000 (09:39 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 9 Nov 2024 15:47:34 +0000 (16:47 +0100)
* lisp/vc/vc.el (vc-steal-lock): Use 'mail-text' instead of
jumping to 'point-max', to avoid inserting the message after
signatures.  (Bug#74027)

(cherry picked from commit 551d1a2cd73bb3df2cad0f1f5b5d1628bb138483)

lisp/vc/vc.el

index 40d4f418a7e752161356153d8bb1a90c8bd4b1ad..773796b0fc8dde6c72c7c093b160048aa8604675 100644 (file)
@@ -1738,6 +1738,8 @@ Type \\[vc-next-action] to check in changes.")
         (format "%d files" (length files))
        "this file"))))
 
+(declare-function mail-text "sendmail" ())
+(declare-function message-goto-body "message" (&optional interactive))
 (defun vc-steal-lock (file rev owner)
   "Steal the lock on FILE."
   (let (file-description)
@@ -1758,7 +1760,10 @@ Type \\[vc-next-action] to check in changes.")
     ;; goes wrong, we don't want to send any mail.
     (compose-mail owner (format "Stolen lock on %s" file-description))
     (setq default-directory (expand-file-name "~/"))
-    (goto-char (point-max))
+    (cond
+     ((eq mail-user-agent 'sendmail-user-agent)
+      (mail-text))
+     ((message-goto-body)))
     (insert
      (format "I stole the lock on %s, " file-description)
      (current-time-string)