Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* summary buffer format for archives
@ 2008-03-22  1:41 Richard G Riley
  2008-03-22  2:15 ` Richard G Riley
  0 siblings, 1 reply; 13+ messages in thread
From: Richard G Riley @ 2008-03-22  1:41 UTC (permalink / raw)
  To: info-gnus-english


How can I change the summary buffer format for only my archive groups?
e.g I want to see the "to" address rather than the "from address" for
all outgoing emails I have archived.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
  2008-03-22  1:41 summary buffer format for archives Richard G Riley
@ 2008-03-22  2:15 ` Richard G Riley
  2008-03-22  9:09   ` Adam Sjøgren
                     ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Richard G Riley @ 2008-03-22  2:15 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

> How can I change the summary buffer format for only my archive groups?
> e.g I want to see the "to" address rather than the "from address" for
> all outgoing emails I have archived.

To answer my own question:

(setq
 gnus-parameters
 '(("^\\(nnimap\\|nnfolder\\|nnml\\)"
    (gnus-summary-line-format "%-23,23~(form (gnus-extra-header 'To))@  %S\n"))))

I'm not sure I understand the manual when it says %f is the "from" or
the "to" field.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
  2008-03-22  2:15 ` Richard G Riley
@ 2008-03-22  9:09   ` Adam Sjøgren
  2008-03-22 11:35     ` Richard G Riley
  2008-03-22 10:14   ` Tassilo Horn
       [not found]   ` <mailman.9333.1206180897.18990.info-gnus-english@gnu.org>
  2 siblings, 1 reply; 13+ messages in thread
From: Adam Sjøgren @ 2008-03-22  9:09 UTC (permalink / raw)
  To: info-gnus-english

On Sat, 22 Mar 2008 03:15:14 +0100, Richard wrote:

> Richard G Riley <rileyrgdev@gmail.com> writes:
>> How can I change the summary buffer format for only my archive groups?
>> e.g I want to see the "to" address rather than the "from address" for
>> all outgoing emails I have archived.

> To answer my own question:

> (setq
>  gnus-parameters
>  '(("^\\(nnimap\\|nnfolder\\|nnml\\)"
>     (gnus-summary-line-format "%-23,23~(form (gnus-extra-header 'To))@  %S\n"))))

> I'm not sure I understand the manual when it says %f is the "from" or
> the "to" field.

Another possibility is to set gnus-ignored-from-addresses to something
that matches your own addresses:

,----[ C-h v gnus-ignored-from-addresses RET ]
| `gnus-ignored-from-addresses' is a variable declared in Lisp.
|   -- loaded from "gnus-sum"
| 
| Value: "\\(asjo\\|adam\\)@\\(koldfront.dk\\|asjo.org\\)"
| 
| Documentation:
| *From headers that may be suppressed in favor of To headers.
| This can be a regexp or a list of regexps.
`----

(This functionality perhaps also accounts for the description of %f that
was confusing to you?)


  Best regards,

-- 
 "You know, if the sun was an oboe, what would you do?"       Adam Sjøgren
                                                         asjo@koldfront.dk

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
  2008-03-22  2:15 ` Richard G Riley
  2008-03-22  9:09   ` Adam Sjøgren
@ 2008-03-22 10:14   ` Tassilo Horn
       [not found]   ` <mailman.9333.1206180897.18990.info-gnus-english@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: Tassilo Horn @ 2008-03-22 10:14 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

Hi Richard,

> I'm not sure I understand the manual when it says %f is the "from" or
> the "to" field.

It means that it's normally the from unless it's a message sent by you.
In that case it's something like

    -> to@foobar.invalid

or

    => news.group.you.posted.in

HTH,
Tassilo
-- 
A morning without coffee is like something without something else.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
       [not found]   ` <mailman.9333.1206180897.18990.info-gnus-english@gnu.org>
@ 2008-03-22 11:23     ` Richard G Riley
  2008-03-22 18:14       ` Tassilo Horn
  0 siblings, 1 reply; 13+ messages in thread
From: Richard G Riley @ 2008-03-22 11:23 UTC (permalink / raw)
  To: info-gnus-english

Tassilo Horn <tassilo@member.fsf.org> writes:

> Richard G Riley <rileyrgdev@gmail.com> writes:
>
> Hi Richard,
>
>> I'm not sure I understand the manual when it says %f is the "from" or
>> the "to" field.
>
> It means that it's normally the from unless it's a message sent by you.
> In that case it's something like
>
>     -> to@foobar.invalid
>
> or
>
>     => news.group.you.posted.in
>
> HTH,
> Tassilo

Hmm, that was not my observation. Possibly something not right as a
result of posting-styles? I should look into it.

Adam's points clarified it for me though:

,----
| Another possibility is to set gnus-ignored-from-addresses to something
| that matches your own addresses:
| 
| ,----[ C-h v gnus-ignored-from-addresses RET ]
| | `gnus-ignored-from-addresses' is a variable declared in Lisp.
| |   -- loaded from "gnus-sum"
| | 
| | Value: "\\(asjo\\|adam\\)@\\(koldfront.dk\\|asjo.org\\)"
| | 
| | Documentation:
| | *From headers that may be suppressed in favor of To headers.
| | This can be a regexp or a list of regexps.
| `----
| 
| (This functionality perhaps also accounts for the description of %f that
| was confusing to you?)
`----

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
  2008-03-22  9:09   ` Adam Sjøgren
@ 2008-03-22 11:35     ` Richard G Riley
  2008-03-24  3:54       ` Richard G Riley
  0 siblings, 1 reply; 13+ messages in thread
From: Richard G Riley @ 2008-03-22 11:35 UTC (permalink / raw)
  To: info-gnus-english

asjo@koldfront.dk (Adam Sjøgren) writes:

> On Sat, 22 Mar 2008 03:15:14 +0100, Richard wrote:
>
>> Richard G Riley <rileyrgdev@gmail.com> writes:
>>> How can I change the summary buffer format for only my archive groups?
>>> e.g I want to see the "to" address rather than the "from address" for
>>> all outgoing emails I have archived.
>
>> To answer my own question:
>
>> (setq
>>  gnus-parameters
>>  '(("^\\(nnimap\\|nnfolder\\|nnml\\)"
>>     (gnus-summary-line-format "%-23,23~(form (gnus-extra-header 'To))@  %S\n"))))
>
>> I'm not sure I understand the manual when it says %f is the "from" or
>> the "to" field.
>
> Another possibility is to set gnus-ignored-from-addresses to something
> that matches your own addresses:
>
> ,----[ C-h v gnus-ignored-from-addresses RET ]
> | `gnus-ignored-from-addresses' is a variable declared in Lisp.
> |   -- loaded from "gnus-sum"
> | 
> | Value: "\\(asjo\\|adam\\)@\\(koldfront.dk\\|asjo.org\\)"
> | 
> | Documentation:
> | *From headers that may be suppressed in favor of To headers.
> | This can be a regexp or a list of regexps.
> `----
>
> (This functionality perhaps also accounts for the description of %f that
> was confusing to you?)
>
>
>   Best regards,

It did indeed! Thanks.

And combining the two It's much better as the default summary line is
good to go then:

,----
| (setq
|   gnus-parameters
|   '(("^\\(nnimap\\|nnfolder\\|nnml\\)"
|     (gnus-ignored-from-addresses ".*riley.*"))))
`----

This I still see my own name in threads in nntp groups but the "to" in
the archived folders - perfect!

Many thanks to you and Tassilo.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
  2008-03-22 11:23     ` Richard G Riley
@ 2008-03-22 18:14       ` Tassilo Horn
  0 siblings, 0 replies; 13+ messages in thread
From: Tassilo Horn @ 2008-03-22 18:14 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

Hi Richard,

>> It means that it's normally the from unless it's a message sent by
>> you.  In that case it's something like
>>
>>     -> to@foobar.invalid
>>
>> or
>>
>>     => news.group.you.posted.in
>
> Hmm, that was not my observation. Possibly something not right as a
> result of posting-styles? I should look into it.

This plays together with ignored from addresses.  See the manual:

,----[ (info "(gnus)To From Newsgroups") ]
|   3. The `gnus-ignored-from-addresses' variable says when the `%f'
|      summary line spec returns the `To', `Newsreader' or `From' header.
|      If this regexp matches the contents of the `From' header, the
|      value of the `To' or `Newsreader' headers are used instead.
| 
|      To distinguish regular articles from those where the `From' field
|      has been swapped, a string is prefixed to the `To' or `Newsgroups'
|      header in the summary line.  By default the string is `-> ' for
|      `To' and `=> ' for `Newsgroups', you can customize these strings
|      with `gnus-summary-to-prefix' and `gnus-summary-newsgroup-prefix'.
`----

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
  2008-03-22 11:35     ` Richard G Riley
@ 2008-03-24  3:54       ` Richard G Riley
  2008-03-24  4:33         ` Richard G Riley
  2008-03-24  9:52         ` Tassilo Horn
  0 siblings, 2 replies; 13+ messages in thread
From: Richard G Riley @ 2008-03-24  3:54 UTC (permalink / raw)
  To: info-gnus-english


Richard G Riley <rileyrgdev@gmail.com> writes:
>
> It did indeed! Thanks.
>
> And combining the two It's much better as the default summary line is
> good to go then:
>
> ,----
> | (setq
> |   gnus-parameters
> |   '(("^\\(nnimap\\|nnfolder\\|nnml\\)"
> |     (gnus-ignored-from-addresses ".*riley.*"))))
> `----
>
> This I still see my own name in threads in nntp groups but the "to" in
> the archived folders - perfect!
>
> Many thanks to you and Tassilo.

Carrying on from this I had hoped

,----
| (setq gnus-group-line-format "%M\%S\%p\%P\%5y: %(%-40,40g%) %ud\n")
| 
| (setq
|   gnus-parameters
|   '(
|     ("^\\(nnimap\\|nnfolder\\|nnml\\)"
|      (gnus-ignored-from-addresses ".*riley.*")
|      (gnus-group-line-format "%G %ud\n")
|      )
|     )
| )
`----

Would give me a group specific gnus-group-line-format.

It doesn't. Any ideas on how I would do that?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
  2008-03-24  3:54       ` Richard G Riley
@ 2008-03-24  4:33         ` Richard G Riley
  2008-03-24  9:56           ` Tassilo Horn
       [not found]           ` <mailman.9378.1206352815.18990.info-gnus-english@gnu.org>
  2008-03-24  9:52         ` Tassilo Horn
  1 sibling, 2 replies; 13+ messages in thread
From: Richard G Riley @ 2008-03-24  4:33 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

> Richard G Riley <rileyrgdev@gmail.com> writes:
>>
>> It did indeed! Thanks.
>>
>> And combining the two It's much better as the default summary line is
>> good to go then:
>>
>> ,----
>> | (setq
>> |   gnus-parameters
>> |   '(("^\\(nnimap\\|nnfolder\\|nnml\\)"
>> |     (gnus-ignored-from-addresses ".*riley.*"))))
>> `----
>>
>> This I still see my own name in threads in nntp groups but the "to" in
>> the archived folders - perfect!
>>
>> Many thanks to you and Tassilo.
>
> Carrying on from this I had hoped
>
> ,----
> | (setq gnus-group-line-format "%M\%S\%p\%P\%5y: %(%-40,40g%) %ud\n")
> | 
> | (setq
> |   gnus-parameters
> |   '(
> |     ("^\\(nnimap\\|nnfolder\\|nnml\\)"
> |      (gnus-ignored-from-addresses ".*riley.*")
> |      (gnus-group-line-format "%G %ud\n")
> |      )
> |     )
> | )
> `----
>
> Would give me a group specific gnus-group-line-format.
>
> It doesn't. Any ideas on how I would do that?

Well, I managed it!

,----
| (setq gnus-group-line-format "%M\%S\%p\%P\%uy%(%-40,40g%) %ud\n")
| 
| 
| (defun gnus-user-format-function-y (headers)
|   (if (string-match "^nnfolder" gnus-tmp-group) 
|       ""
|       (concat gnus-tmp-number-of-unread "-")
|     )
|   )
`----

Where are the parameters available inside the format functions documented?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
  2008-03-24  3:54       ` Richard G Riley
  2008-03-24  4:33         ` Richard G Riley
@ 2008-03-24  9:52         ` Tassilo Horn
  1 sibling, 0 replies; 13+ messages in thread
From: Tassilo Horn @ 2008-03-24  9:52 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

Hi Richard,

> Carrying on from this I had hoped
>
> ,----
> | (setq gnus-group-line-format "%M\%S\%p\%P\%5y: %(%-40,40g%) %ud\n")
                                    ^  ^  ^  ^
For what are those backslashes?  They seem to cause no harm (because
"\%" is no control character, I guess), but they're not needed anyway.

> | (setq
> |   gnus-parameters
> |   '(
> |     ("^\\(nnimap\\|nnfolder\\|nnml\\)"
> |      (gnus-ignored-from-addresses ".*riley.*")
> |      (gnus-group-line-format "%G %ud\n")
> |      )
> |     )
> | )
> `----
>
> Would give me a group specific gnus-group-line-format.
>
> It doesn't.

Gnus parameters take effect when entering a group, so you can set
different summary line formats there.  In the *Group* buffer they don't
have an effect, AFAIK.

> Any ideas on how I would do that?

No, sorry.

Bye,
Tassilo
-- 
Richard Stallman is my shephurd, and I am his GNU.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
  2008-03-24  4:33         ` Richard G Riley
@ 2008-03-24  9:56           ` Tassilo Horn
       [not found]           ` <mailman.9378.1206352815.18990.info-gnus-english@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Tassilo Horn @ 2008-03-24  9:56 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

Hi Richard,

> Where are the parameters available inside the format functions
> documented?

Group Buffer:

  (info "(gnus)Group Line Specification")
  (info "(gnus)Group Mode Line Specification")

Summary Buffer:

  (info "(gnus)Summary Buffer Lines")
  (info "(gnus)Summary Buffer Mode Line")

General:

  (info "(gnus)Formatting Variables")

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
       [not found]           ` <mailman.9378.1206352815.18990.info-gnus-english@gnu.org>
@ 2008-03-24 12:56             ` Richard G Riley
  2008-03-24 20:46               ` Tassilo Horn
  0 siblings, 1 reply; 13+ messages in thread
From: Richard G Riley @ 2008-03-24 12:56 UTC (permalink / raw)
  To: info-gnus-english


Hi Tassilo, 



Tassilo Horn <tassilo@member.fsf.org> writes:

> Richard G Riley <rileyrgdev@gmail.com> writes:
>
> Hi Richard,
>
>> Where are the parameters available inside the format functions
>> documented?
>
> Group Buffer:
>
>   (info "(gnus)Group Line Specification")
>   (info "(gnus)Group Mode Line Specification")
>
> Summary Buffer:
>
>   (info "(gnus)Summary Buffer Lines")
>   (info "(gnus)Summary Buffer Mode Line")
>
> General:
>
>   (info "(gnus)Formatting Variables")
>

I meant inside the format functions (elisp) as in the function I posted
in the article you replied to e.g:

,----
| 
| ,----
| | (setq gnus-group-line-format "%M\%S\%p\%P\%uy%(%-40,40g%) %ud\n")
| | 
| | 
| | (defun gnus-user-format-function-y (headers)
| |   (if (string-match "^nnfolder" gnus-tmp-group) 
| |       ""
| |       (concat gnus-tmp-number-of-unread "-")
| |     )
| |   )
| `----
`----

How does one get to know which functions/variables are available inside
gnus-user-format-function-y? Here in this case I kept googling until I
found sample functions to discover the existence of
gnus-tmp-number-of-unread. Is there some kind of dynymic/info way to
find out all available "locals". (I'm not really an elisp programmer so
anything I do tends to be cobbled together from other examples).

(I was aware of the format specifiers as they were relatively easy to locate in
the info file.)

I guess I'm probably asking for a quick tutorial in how to figure out
what's there for these things from browsing existing elisp on the
running system. And while I'm at it, every example user defined format
function I have seen ignores "headers" or whatever the parameter passed
in to it is named.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: summary buffer format for archives
  2008-03-24 12:56             ` Richard G Riley
@ 2008-03-24 20:46               ` Tassilo Horn
  0 siblings, 0 replies; 13+ messages in thread
From: Tassilo Horn @ 2008-03-24 20:46 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

Hi Richard,

> I meant inside the format functions (elisp) as in the function I
> posted in the article you replied to e.g:

Ah, sorry.  I didn't get you.

,----[ (info "(gnus)Group Line Specification") ]
| `u'
|      User defined specifier.  
[...]
|      The function will be passed a single dummy parameter as
|      argument.
[...]
`----

,----[ (info "(gnus)Summary Buffer Lines") ]
| `u'
|      User defined specifier.
[...]
|      The function will be passed the current header as argument.
[...]
`----

In gnus terminology a header is:

,----[ (info "(gnus)Headers") ]
| And Gnus uses a format internally that it calls "header", which is
| what I'm talking about here.  This is a 9-element vector, basically,
| with each header (ouch) having one slot.
| 
|    These slots are, in order: `number', `subject', `from', `date',
| `id', `references', `chars', `lines', `xref', and `extra'.  There are
| macros for accessing and setting these slots--they all have
| predictable names beginning with `mail-header-' and
| `mail-header-set-', respectively.
`----

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-03-24 20:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-22  1:41 summary buffer format for archives Richard G Riley
2008-03-22  2:15 ` Richard G Riley
2008-03-22  9:09   ` Adam Sjøgren
2008-03-22 11:35     ` Richard G Riley
2008-03-24  3:54       ` Richard G Riley
2008-03-24  4:33         ` Richard G Riley
2008-03-24  9:56           ` Tassilo Horn
     [not found]           ` <mailman.9378.1206352815.18990.info-gnus-english@gnu.org>
2008-03-24 12:56             ` Richard G Riley
2008-03-24 20:46               ` Tassilo Horn
2008-03-24  9:52         ` Tassilo Horn
2008-03-22 10:14   ` Tassilo Horn
     [not found]   ` <mailman.9333.1206180897.18990.info-gnus-english@gnu.org>
2008-03-22 11:23     ` Richard G Riley
2008-03-22 18:14       ` Tassilo Horn

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).