Subject: bug#74027: closed (Re: bug#74027: [PATCH] ; Insert "Stealing lock" at the beginning of a message)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 08 Nov 2024 16:31:02 +0000

Your bug report

#74027: [PATCH] ; Insert "Stealing lock" at the beginning of a message

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74027: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74027
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#74027: [PATCH] ; Insert "Stealing lock" at the beginning of a message
From: Philip Kaludercic <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked]
Date: Fri, 08 Nov 2024 16:30:40 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Eli Zaretskii <[email-masked]> writes:

>> From: Philip Kaludercic <[email-masked]>
>> Cc: [email-masked]
>> Date: Fri, 08 Nov 2024 16:10:22 +0000
>> 
>> >> In that case it seems better/simpler to just use 'message-goto-body'.
>> >
>> > I'm not sure.  I use sendmail, and I don't really like the idea of
>> > having message.el loaded into my sessions.
>> >
>> > It shouldn't be hard to dispatch, is it?
>> 
>> Technically no, just if we want to be exhaustive then I don't have a
>> good overview of all clients.  Or should we just fall-back onto message:
>
> Yes, falling back to message should be okay, IMO.
>
> Thanks.

OK, I have pushed the change to master!  Closing the report.

-- 
	Philip Kaludercic on siskin

Subject: [PATCH] ; Insert "Stealing lock" at the beginning of a message
From: Philip Kaludercic <[email-masked]>
To: [email-masked]
Date: Sat, 26 Oct 2024 07:41:49 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

It appears "vc-steal-lock" is not compatible with automatic signatures,
as the "I stole the lock on ..." is inserted at the end of the message,
which can appear behind the signature.  This should fix it:

>From b5539a1924bbcbb1ee68fcbb21310856fcd437a9 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <[email-masked]>
Date: Sat, 26 Oct 2024 09:39:00 +0200
Subject: [PATCH] ; Insert "Stealing lock" at the beginning of a message

* lisp/vc/vc.el (vc-steal-lock): Use 'mail-text' instead of
jumping to 'point-max', to avoid inserting the message after
signatures.
---
 lisp/vc/vc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index a30ba06aec3..0d72b169e41 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1661,6 +1661,7 @@ vc-mark-resolved
 	 (format "%d files" (length files))
        "this file"))))
 
+(declare-function mail-text "sendmail" ())
 (defun vc-steal-lock (file rev owner)
   "Steal the lock on FILE."
   (let (file-description)
@@ -1681,7 +1682,7 @@ vc-steal-lock
     ;; 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))
+    (mail-text)
     (insert
      (format "I stole the lock on %s, " file-description)
      (current-time-string)
-- 
2.45.2

-- 
	Philip Kaludercic on siskin