GNU bug report logs - #74027
[PATCH] ; Insert "Stealing lock" at the beginning of a message

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Sat, 26 Oct 2024 07:43:02 UTC

Severity: normal

Tags: patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 74027 in the body.
You can then email your comments to 74027 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#74027; Package emacs. (Sat, 26 Oct 2024 07:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philip Kaludercic <philipk <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 26 Oct 2024 07:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] ; Insert "Stealing lock" at the beginning of a message
Date: Sat, 26 Oct 2024 07:41:49 +0000
[Message part 1 (text/plain, inline)]
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:

[0001-Insert--Stealing-lock--at-the-beginning-of-a-mes.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
	Philip Kaludercic on siskin

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74027; Package emacs. (Sat, 02 Nov 2024 11:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 74027 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 74027 <at> debbugs.gnu.org
Subject: Re: bug#74027: [PATCH] ;
 Insert "Stealing lock" at the beginning of a message
Date: Sat, 02 Nov 2024 13:27:42 +0200
> From: Philip Kaludercic <philipk <at> posteo.net>
> Date: Sat, 26 Oct 2024 07:41:49 +0000
> 
> 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 <philipk <at> posteo.net>
> 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)

I guess you are using sendmail.el as your mail-user-agent?  But the
default is message.el, so I think we should either use
message-goto-body here, or perhaps dispatch to either to message.el or
sendmail.el based on the value of mail-user-agent.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74027; Package emacs. (Fri, 08 Nov 2024 14:17:02 GMT) Full text and rfc822 format available.

Message #11 received at 74027 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 74027 <at> debbugs.gnu.org
Subject: Re: bug#74027: [PATCH] ; Insert "Stealing lock" at the beginning of
 a message
Date: Fri, 08 Nov 2024 14:15:53 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Philip Kaludercic <philipk <at> posteo.net>
>> Date: Sat, 26 Oct 2024 07:41:49 +0000
>> 
>> 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 <philipk <at> posteo.net>
>> 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)
>
> I guess you are using sendmail.el as your mail-user-agent?  But the
> default is message.el, so I think we should either use
> message-goto-body here, 

Ok, I falsely assumed that using 'mail-text' would be more compatible.

>                         
>                         or perhaps dispatch to either to message.el or
> sendmail.el based on the value of mail-user-agent.

So a `cond' expression checking mail-user-agent and then invoking the
right function, or is there some more generic way to do that?

-- 
	Philip Kaludercic on siskin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74027; Package emacs. (Fri, 08 Nov 2024 15:26:02 GMT) Full text and rfc822 format available.

Message #14 received at 74027 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 74027 <at> debbugs.gnu.org
Subject: Re: bug#74027: [PATCH] ; Insert "Stealing lock" at the beginning of
 a message
Date: Fri, 08 Nov 2024 17:22:36 +0200
> From: Philip Kaludercic <philipk <at> posteo.net>
> Cc: 74027 <at> debbugs.gnu.org
> Date: Fri, 08 Nov 2024 14:15:53 +0000
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> -    (goto-char (point-max))
> >> +    (mail-text)
> >
> > I guess you are using sendmail.el as your mail-user-agent?  But the
> > default is message.el, so I think we should either use
> > message-goto-body here, 
> 
> Ok, I falsely assumed that using 'mail-text' would be more compatible.
> 
> >                         
> >                         or perhaps dispatch to either to message.el or
> > sendmail.el based on the value of mail-user-agent.
> 
> So a `cond' expression checking mail-user-agent and then invoking the
> right function, or is there some more generic way to do that?

The former, I think.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74027; Package emacs. (Fri, 08 Nov 2024 15:27:03 GMT) Full text and rfc822 format available.

Message #17 received at 74027 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 74027 <at> debbugs.gnu.org
Subject: Re: bug#74027: [PATCH] ; Insert "Stealing lock" at the beginning of
 a message
Date: Fri, 08 Nov 2024 15:26:40 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Philip Kaludercic <philipk <at> posteo.net>
>> Cc: 74027 <at> debbugs.gnu.org
>> Date: Fri, 08 Nov 2024 14:15:53 +0000
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> -    (goto-char (point-max))
>> >> +    (mail-text)
>> >
>> > I guess you are using sendmail.el as your mail-user-agent?  But the
>> > default is message.el, so I think we should either use
>> > message-goto-body here, 
>> 
>> Ok, I falsely assumed that using 'mail-text' would be more compatible.
>> 
>> >                         
>> >                         or perhaps dispatch to either to message.el or
>> > sendmail.el based on the value of mail-user-agent.
>> 
>> So a `cond' expression checking mail-user-agent and then invoking the
>> right function, or is there some more generic way to do that?
>
> The former, I think.

In that case it seems better/simpler to just use 'message-goto-body'.

-- 
	Philip Kaludercic on siskin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74027; Package emacs. (Fri, 08 Nov 2024 15:51:01 GMT) Full text and rfc822 format available.

Message #20 received at 74027 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 74027 <at> debbugs.gnu.org
Subject: Re: bug#74027: [PATCH] ; Insert "Stealing lock" at the beginning of
 a message
Date: Fri, 08 Nov 2024 17:50:02 +0200
> From: Philip Kaludercic <philipk <at> posteo.net>
> Cc: 74027 <at> debbugs.gnu.org
> Date: Fri, 08 Nov 2024 15:26:40 +0000
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Philip Kaludercic <philipk <at> posteo.net>
> >> Cc: 74027 <at> debbugs.gnu.org
> >> Date: Fri, 08 Nov 2024 14:15:53 +0000
> >> 
> >> Eli Zaretskii <eliz <at> gnu.org> writes:
> >> 
> >> >> -    (goto-char (point-max))
> >> >> +    (mail-text)
> >> >
> >> > I guess you are using sendmail.el as your mail-user-agent?  But the
> >> > default is message.el, so I think we should either use
> >> > message-goto-body here, 
> >> 
> >> Ok, I falsely assumed that using 'mail-text' would be more compatible.
> >> 
> >> >                         
> >> >                         or perhaps dispatch to either to message.el or
> >> > sendmail.el based on the value of mail-user-agent.
> >> 
> >> So a `cond' expression checking mail-user-agent and then invoking the
> >> right function, or is there some more generic way to do that?
> >
> > The former, I think.
> 
> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74027; Package emacs. (Fri, 08 Nov 2024 16:11:01 GMT) Full text and rfc822 format available.

Message #23 received at 74027 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 74027 <at> debbugs.gnu.org
Subject: Re: bug#74027: [PATCH] ; Insert "Stealing lock" at the beginning of
 a message
Date: Fri, 08 Nov 2024 16:10:22 +0000
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Philip Kaludercic <philipk <at> posteo.net>
>> Cc: 74027 <at> debbugs.gnu.org
>> Date: Fri, 08 Nov 2024 15:26:40 +0000
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> From: Philip Kaludercic <philipk <at> posteo.net>
>> >> Cc: 74027 <at> debbugs.gnu.org
>> >> Date: Fri, 08 Nov 2024 14:15:53 +0000
>> >> 
>> >> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >> 
>> >> >> -    (goto-char (point-max))
>> >> >> +    (mail-text)
>> >> >
>> >> > I guess you are using sendmail.el as your mail-user-agent?  But the
>> >> > default is message.el, so I think we should either use
>> >> > message-goto-body here, 
>> >> 
>> >> Ok, I falsely assumed that using 'mail-text' would be more compatible.
>> >> 
>> >> >                         
>> >> >                         or perhaps dispatch to either to message.el or
>> >> > sendmail.el based on the value of mail-user-agent.
>> >> 
>> >> So a `cond' expression checking mail-user-agent and then invoking the
>> >> right function, or is there some more generic way to do that?
>> >
>> > The former, I think.
>> 
>> 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:

[0001-Insert-Stealing-lock-at-the-beginning-of-a-message.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
-- 
	Philip Kaludercic on siskin

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74027; Package emacs. (Fri, 08 Nov 2024 16:27:02 GMT) Full text and rfc822 format available.

Message #26 received at 74027 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 74027 <at> debbugs.gnu.org
Subject: Re: bug#74027: [PATCH] ; Insert "Stealing lock" at the beginning of
 a message
Date: Fri, 08 Nov 2024 18:25:17 +0200
> From: Philip Kaludercic <philipk <at> posteo.net>
> Cc: 74027 <at> debbugs.gnu.org
> 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.




Reply sent to Philip Kaludercic <philipk <at> posteo.net>:
You have taken responsibility. (Fri, 08 Nov 2024 16:31:02 GMT) Full text and rfc822 format available.

Notification sent to Philip Kaludercic <philipk <at> posteo.net>:
bug acknowledged by developer. (Fri, 08 Nov 2024 16:31:02 GMT) Full text and rfc822 format available.

Message #31 received at 74027-done <at> debbugs.gnu.org (full text, mbox):

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

>> From: Philip Kaludercic <philipk <at> posteo.net>
>> Cc: 74027 <at> debbugs.gnu.org
>> 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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 07 Dec 2024 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 272 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.