info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make `r` and `F` behave as `S L` when replying to a message from a m


From: Emanuel Berg
Subject: Re: Make `r` and `F` behave as `S L` when replying to a message from a mailing list
Date: Mon, 17 Nov 2014 23:09:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Denis Bitouzé <dbitouze@wanadoo.fr> writes:

>> Again, Elisp doesn't have to be your mother tongue
>> for this. However, if you are a perfectionist (as I
>> am, so I'm not criticizing) perhaps you should make
>> it your mother tongue...
>
> Well, in another life, maybe ;)

I'm saying, if you get bugged by details, it is a good
idea to start working on how to fix them, because if
you cannot there are a zillion details to bug you.

> With which keybinding?

gnus-article-reply-dwim is what you want to use. It is
the one defun interactive so the only one that can be
called with a keybinding or from the M-x prompt.

If you want to play with it, here is how to set it to
"R" (note: capital) in `gnus-article-mode-map' - if it
works, perhaps should be made available from
`gnus-summary-mode' (`gnus-summary-mode-map') as
well...

(define-key gnus-article-mode-map "R" 'gnus-article-reply-dwim)

> - for mailing lists, `F` doesn't work (ML address in
> CC only) and `R` does work, - for newsgroups, `F`
> does work and `R` doesn't work (I'm asked if I
> really want to reply by mail to article author), -
> for love letters, I cannot test (I receive too much
> of them, hence considered as spam and automatically
> deleted), - for break-off letters, `F` and `R` do
> work but behave differently: the sender's address is
> in TO but `F` adds my address in CC.

Yes, that all the base functionality is already there
makes this a good case to do a DWIM command, the only
thing that command will do is to determine the state
and then use another command that is already
implemented and tested and documented (well, almost).

>> However I'm not sure if all mailing lists respect
>> the X-Mailing-List header...? (Could be a place to
>> add more such tests and OR them.)
>
> Maybe that's the point.

Feel free to add more test (or test1 test1 ... testn)
if the X-Mailing-List header isn't always there
(perhaps it is, even). The gnus-article-header-value I
also provided can be used to extract header values, or
nil if the header isn't there.

>> Also, I don't know what the 1 argument to
>> `gnus-summary-reply-to-list-with-original' means
>> because that isn't in the documentation, and I
>> didn't feel like tracing it. It probably (?) has to
>> do with doing things to several messages. I don't
>> know if that should be 0 or 1 in this case.
>
> Unfortunately, I cannot help.

Yes you can, start using it and report back if it
doesn't work. But I know this it should be a 0, not a
1, so change that. I.e.:

(defun gnus-article-reply-dwim ()
  (interactive)
  (if (gnus-article-header-value "X-Mailing-List")
      (gnus-summary-reply-to-list-with-original 0)
    (gnus-article-followup-with-original) ))

>> Last, `gnus-summary-reply-to-list-with-original' is
>> in gnus-msg, and not gnus-sum. Just mentioning it
>> as it looks a bit confusing :)
>
> Not more confusing than the rest ;)

The confusing this is that
`gnus-summary-reply-to-list-with-original' has the
gnus-summary prefix, but it is in the gnus-msg Elisp
file (the "require" stuff in the code). Emacs has a
single namespace, which is why people insist on long
prefixes to avoid collisions. Like if all package
coders named their stuff get-data, that would be a
mess instantly. But gnus-whatever-get-data,
gnus-something-else-get-data,
something-completely-different-get-data, in the
beginning it feels funky especially if you come from a
language like C with very short names, but if you do
it enough you start to like it. So it doesn't only
make sense, it is deceitful as well...

-- 
underground experts united


reply via email to

[Prev in Thread] Current Thread [Next in Thread]