Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Cc: bugs@gnus.org (The Gnus Bugfixing Girls + Boys), ding@gnus.org
Subject: Re: Two gnus-posting-styles problems
Date: Mon, 03 Jun 2002 20:23:25 +0200	[thread overview]
Message-ID: <iluptz86x2a.fsf@latte.josefsson.org> (raw)
In-Reply-To: <sxswutg8d71.fsf@florida.munich.redhat.com> (Hrvoje Niksic's message of "Mon, 03 Jun 2002 19:49:38 +0200")

Hrvoje Niksic <hniksic@xemacs.org> writes:

> Simon Josefsson <jas@extundo.com> writes:
>
>> Perhaps
>>
>>       ((header "from" "redhat.com")
>>        (address "hniksic@redhat.com"))
>>
>> is useful?
>
> It's an improvement, but it doesn't solve the #1a problem.

No, the #1a problem is probably a bug and the patch solves it.

> I have yet to try your patch.  Can you explain what it is supposed to
> do?  I'm not sure I understand the intention from reading the patch.

I see now that the patch accidently included an unrelated patch.  The
point of the patch was simply to bind gnus-article-copy to nil in all
places where you aren't following up or replying to an article --
e.g., when pressing `a' or `m'.  If the variable is nil, the posting
styles code won't use the last viewed buffer.

>>> 2. I tried to fix #1 by explicitly matching the stuff from the Message
>>>    buffer, like this:
>>>
>>>      ((and (message-fetch-field "to")
>>>            (string-match "redhat\\.com" (message-fetch-field "to")))
>>>       (address "hniksic@redhat.com"))
>>>
>>>    But that didn't work because `gnus-configure-posting-styles' is
>>>    called from `message-mode-hook', which gets run when the Message
>>>    buffer is still completely empty.  It should be called at a later
>>>    stage, when the buffer has already been set up.
>>
>> There's a dependency problem here, not all functions that use
>> information from the message buffer and modify the contents of the
>> message buffer can be called last.  I think the ordering has changed
>> several times, but it won't ever satisfy everyone.  I think the
>> approach should be that you shouldn't count on information being
>> available in the message buffers unless... err, it is available.
>
> I'm not sure I understand this.  Why can't it satisfy everyone?  What
> is the position opposite to mine?

There are alot of hooks and functions that people use to populate
message buffers: message-mode-hook, message-setup-hook,
gnus-message-setup-hook, gnus-posting-styles, making user-mail-address
context sensitive, defadvice etc.  If we change the ordering the way
you want, the posting style is applied last, which makes it possible
to extract To/From etc from the newly composed message.  But the same
change will affect code added to, say, message-setup-hook, since it no
longer can extract the fields added by the posting styles code.  Some
code need to be called last, and changing the order now means people
will have to use different hooks depending on which Gnus version they
use and how it implements this.

To be concrete: Consider someone using message-setup-hook to extract
from headers and insert something else AND then uses posting styles,
and relies on it being called in that order will be surprised.  (Now I
don't know if message-setup-hook really is called before applying
posting styles, but I'm sure there are such hooks.)

That said, perhaps changing it to apply posting styles last is good,
but it seems difficult to tell what harm to people's customizations it
will generate.  Leaving it as is doesn't hurt anything, it seems, it
only forces you to write your customization in another way.  And since
your proposed customization didn't use anything promised by
documentation (did it?), the conservative approach would be to leave
the call order as is.




  reply	other threads:[~2002-06-03 18:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-03 14:55 Hrvoje Niksic
2002-06-03 15:04 ` Paul Jarc
2002-06-03 15:36 ` David S Goldberg
2002-06-03 17:40 ` Simon Josefsson
2002-06-03 17:49   ` Hrvoje Niksic
2002-06-03 18:23     ` Simon Josefsson [this message]
2002-06-03 19:48       ` Kai Großjohann
2002-06-04 13:48       ` Hrvoje Niksic
2002-06-04 16:07         ` Simon Josefsson
2002-06-03 19:45 ` Kai Großjohann

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=iluptz86x2a.fsf@latte.josefsson.org \
    --to=jas@extundo.com \
    --cc=bugs@gnus.org \
    --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).