From: Uwe Brauer <oub@mat.ucm.es>
To: ding@gnus.org
Subject: Re: message-beginning-of-line behaves a bit strange
Date: Fri, 28 Jan 2022 09:00:14 +0100 [thread overview]
Message-ID: <871r0s1e9d.fsf@mat.ucm.es> (raw)
In-Reply-To: <87v8y5h0iv.fsf@zoho.eu>
[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]
>>> "EB" == Emanuel Berg <moasenwood@zoho.eu> writes:
> Uwe Brauer wrote:
>>> Uwe Brauer <oub@mat.ucm.es> writes:
>>
>>> Try `message-beginning-of-header' instead. Alternately,
>>> fooling with the value of (variable)
>>> `message-beginning-of-line' while calling (function)
>>> `message-beginning-of-line'.
>>
>> Great, I did
>>
>> (defun my-add-subject-test ()
>> (interactive)
>> (message-goto-subject)
>> ; (message-beginning-of-line)
>> (message-beginning-of-header 'subject)
>> (insert "[Test] "))
>>
>> And this work nicely for both, empty and non empty
>> subject lines!
> ?! Subject twice?
> What kind of code is that? I mean
> (message-goto-subject)
> (message-beginning-of-header 'subject)
> Much better:
> `message-goto-subject' could have an optional formal parameter
> BEG so when the argument is non-nil it does
> (message-beginning-of-header 'subject) last.
That is a proposal?
> But at the very least (message-beginning-of-header 'subject)
> should imply (message-goto-subject) first.
> Or one could make HANDLE-FOLDED optional and when nil, go to
> the current line's header beginning.
> Subject should appear one time!
So the correct code is
(defun my-add-subject-test ()
(interactive)
(message-goto-subject)
(message-beginning-of-header t)
(insert "[Test] "))
Ok!
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
prev parent reply other threads:[~2022-01-28 8:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 21:17 Uwe Brauer
2022-01-26 21:27 ` Emanuel Berg
2022-01-27 4:53 ` Emanuel Berg
2022-01-27 7:47 ` Uwe Brauer
2022-01-27 11:29 ` Emanuel Berg
2022-01-28 7:58 ` Uwe Brauer
2022-01-26 21:30 ` Eric Abrahamsen
2022-01-27 7:48 ` Uwe Brauer
2022-01-27 8:31 ` Robert Pluim
2022-01-27 11:38 ` Emanuel Berg
2022-01-27 16:31 ` Eric Abrahamsen
2022-01-28 8:00 ` Uwe Brauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871r0s1e9d.fsf@mat.ucm.es \
--to=oub@mat.ucm.es \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).