Gnus development mailing list
 help / color / mirror / Atom feed
* nnir summary line formatting
@ 2010-12-02 15:14 Andrew Cohen
  2010-12-02 15:25 ` Tassilo Horn
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Andrew Cohen @ 2010-12-02 15:14 UTC (permalink / raw)
  To: ding

When using nnir for search results there are nnir-specific bits of
information that are of potential interest: the retrieval score (RSV) of the
article (some search engines, such as gmane, report a  match "score";
others, such as imap, just give all results an arbitrary score of
"100"); and the original group the article belongs to. 

Historically (which means "up till now") nnir has done this by mangling
the subject header of each article to incorporate this info; then when
the article subject is displayed in the summary buffer the info shows
up. This is bad for a couple of reasons: some things, notably the
registry, care about the original subject so the mangling has to be
accounted for; and it should really be up to the user what information
is displayed in summary-buffer lines (with a sensible default).

A (mostly) straightforward way to handle this is to use the
gnus-summary-line-format. I would like to add a couple of specs to
gnus-summary-line-format-alist to do this (tentatively %Z for the RSV
and %G for the full group name and %g for the short name). I'd then
introduce nnir-summary-line-format which is used locally in nnir summary
buffers rather than gnus-summary-line-format (set through a hook).

Does this sound OK?






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

* Re: nnir summary line formatting
  2010-12-02 15:14 nnir summary line formatting Andrew Cohen
@ 2010-12-02 15:25 ` Tassilo Horn
  2010-12-02 15:28 ` Julien Danjou
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Tassilo Horn @ 2010-12-02 15:25 UTC (permalink / raw)
  To: Andrew Cohen; +Cc: ding

Andrew Cohen <cohen@andy.bu.edu> writes:

Hi Andrew,

> A (mostly) straightforward way to handle this is to use the
> gnus-summary-line-format. I would like to add a couple of specs to
> gnus-summary-line-format-alist to do this (tentatively %Z for the RSV
> and %G for the full group name and %g for the short name). I'd then
> introduce nnir-summary-line-format which is used locally in nnir
> summary buffers rather than gnus-summary-line-format (set through a
> hook).
>
> Does this sound OK?

Sounds like a very good idea to me. :-)

Bye,
Tassilo



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

* Re: nnir summary line formatting
  2010-12-02 15:14 nnir summary line formatting Andrew Cohen
  2010-12-02 15:25 ` Tassilo Horn
@ 2010-12-02 15:28 ` Julien Danjou
  2010-12-02 20:08 ` Andrew Cohen
  2010-12-03  3:54 ` Katsumi Yamaoka
  3 siblings, 0 replies; 9+ messages in thread
From: Julien Danjou @ 2010-12-02 15:28 UTC (permalink / raw)
  To: Andrew Cohen; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 158 bytes --]

On Thu, Dec 02 2010, Andrew Cohen wrote:

> Does this sound OK?

It does.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: nnir summary line formatting
  2010-12-02 15:14 nnir summary line formatting Andrew Cohen
  2010-12-02 15:25 ` Tassilo Horn
  2010-12-02 15:28 ` Julien Danjou
@ 2010-12-02 20:08 ` Andrew Cohen
  2010-12-03  3:54 ` Katsumi Yamaoka
  3 siblings, 0 replies; 9+ messages in thread
From: Andrew Cohen @ 2010-12-02 20:08 UTC (permalink / raw)
  To: ding

>>>>> "Andrew" == Andrew Cohen <cohen@andy.bu.edu> writes:

    Andrew> A (mostly) straightforward way to handle this is to use the
    Andrew> gnus-summary-line-format. I would like to add a couple of
    Andrew> specs to gnus-summary-line-format-alist to do this
    Andrew> (tentatively %Z for the RSV and %G for the full group name
    Andrew> and %g for the short name). I'd then introduce
    Andrew> nnir-summary-line-format which is used locally in nnir
    Andrew> summary buffers rather than gnus-summary-line-format (set
    Andrew> through a hook).


OK, just pushed this change. Set nnir-summary-line-format to whatever; a
nil value (the default) will use gnus-summary-line-format instead. 

In case anyone is interested my overly complex value is

"%15{%U%}%15{│ %}%12{%-10&user-date;%}%15{ │%}%12{ %}%(%-18,18f%)%12{ %}%*%7{%B%}%«%14{%~(ignore 0)Z %}%11{%s%} %14{%g%}%»\n"


Cheers,
Andy




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

* Re: nnir summary line formatting
  2010-12-02 15:14 nnir summary line formatting Andrew Cohen
                   ` (2 preceding siblings ...)
  2010-12-02 20:08 ` Andrew Cohen
@ 2010-12-03  3:54 ` Katsumi Yamaoka
  2010-12-03  4:13   ` Andrew Cohen
  2010-12-03 13:37   ` Andrew Cohen
  3 siblings, 2 replies; 9+ messages in thread
From: Katsumi Yamaoka @ 2010-12-03  3:54 UTC (permalink / raw)
  To: ding

Andrew Cohen wrote:
> A (mostly) straightforward way to handle this is to use the
> gnus-summary-line-format. I would like to add a couple of specs to
> gnus-summary-line-format-alist to do this (tentatively %Z for the RSV
> and %G for the full group name and %g for the short name).

Currently nnir- macros used in `gnus-summary-line-format-alist'
will never be expanded.  For instance:

(assq ?Z gnus-summary-line-format-alist)
 => (90 (or (nnir-article-rsv (aref gnus-tmp-header 0)) 0) 100)

But it seems to have to be:
 => (90 (or (elt (if (> (aref gnus-tmp-header 0) 0) (progn (elt nnir-artlist (1- (aref gnus-tmp-header 0))))) 2) 0) 100)

To make it do that, those macros have to be loaded before gnus-sum,
however nnir requires gnus-sum in it.

> I'd then introduce nnir-summary-line-format which is used locally
> in nnir summary buffers rather than gnus-summary-line-format
> (set through a hook).

Does it solve?



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

* Re: nnir summary line formatting
  2010-12-03  3:54 ` Katsumi Yamaoka
@ 2010-12-03  4:13   ` Andrew Cohen
  2010-12-03 13:37   ` Andrew Cohen
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Cohen @ 2010-12-03  4:13 UTC (permalink / raw)
  To: ding

>>>>> "Katsumi" == Katsumi Yamaoka <yamaoka@jpl.org> writes:

    Katsumi> Currently nnir- macros used in
    Katsumi> `gnus-summary-line-format-alist' will never be expanded.
    Katsumi> For instance:

    Katsumi> (assq ?Z gnus-summary-line-format-alist) => (90 (or
    Katsumi> (nnir-article-rsv (aref gnus-tmp-header 0)) 0) 100)

    Katsumi> But it seems to have to be: => (90 (or (elt (if (> (aref
    Katsumi> gnus-tmp-header 0) 0) (progn (elt nnir-artlist (1- (aref
    Katsumi> gnus-tmp-header 0))))) 2) 0) 100)

    Katsumi> To make it do that, those macros have to be loaded before
    Katsumi> gnus-sum, however nnir requires gnus-sum in it.

Ah, good catch. I think it works without expanding the macro (at least
it seems to be working for me) but it should probably be fixed to that
the macro is properly expanded. I'll think on it.

Best,
Andy




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

* Re: nnir summary line formatting
  2010-12-03  3:54 ` Katsumi Yamaoka
  2010-12-03  4:13   ` Andrew Cohen
@ 2010-12-03 13:37   ` Andrew Cohen
  2010-12-03 14:06     ` Katsumi Yamaoka
  1 sibling, 1 reply; 9+ messages in thread
From: Andrew Cohen @ 2010-12-03 13:37 UTC (permalink / raw)
  To: ding

>>>>> "Katsumi" == Katsumi Yamaoka <yamaoka@jpl.org> writes:


    Katsumi> Currently nnir- macros used in
    Katsumi> `gnus-summary-line-format-alist' will never be expanded.
    Katsumi> For instance:

    Katsumi> (assq ?Z gnus-summary-line-format-alist) => (90 (or
    Katsumi> (nnir-article-rsv (aref gnus-tmp-header 0)) 0) 100)

    Katsumi> But it seems to have to be: => (90 (or (elt (if (> (aref
    Katsumi> gnus-tmp-header 0) 0) (progn (elt nnir-artlist (1- (aref
    Katsumi> gnus-tmp-header 0))))) 2) 0) 100)

    Katsumi> To make it do that, those macros have to be loaded before
    Katsumi> gnus-sum, however nnir requires gnus-sum in it.


Hi Katsumi:

I'm just learning about this stuff so I wanted to ask if this is the
right way to handle it:

I've added autoloads to gnus-sum:

(autoload 'nnir-article-rsv "nnir" nil nil 'macro)
(autoload 'nnir-article-group "nnir" nil nil 'macro)

and I've rearranged the order of things in nnir.el so the macro
definitions come before the (require 'gnus-sum). 

After doing this (and byte compiling and starting fresh) I have 

(assq ?Z gnus-summary-line-format-alist)
(90 (or (elt (if ... ...) 2) 0) 100)

which looks good (the macro is fully expanded). And no warnings during
byte-compilation. 

Does this all sound right? If so, I'll push the change.

Best,
Andy




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

* Re: nnir summary line formatting
  2010-12-03 13:37   ` Andrew Cohen
@ 2010-12-03 14:06     ` Katsumi Yamaoka
  2010-12-03 14:32       ` Andrew Cohen
  0 siblings, 1 reply; 9+ messages in thread
From: Katsumi Yamaoka @ 2010-12-03 14:06 UTC (permalink / raw)
  To: ding

Andrew Cohen <cohen@andy.bu.edu> wrote:
> Hi Katsumi:

> I'm just learning about this stuff so I wanted to ask if this is the
> right way to handle it:

> I've added autoloads to gnus-sum:

> (autoload 'nnir-article-rsv "nnir" nil nil 'macro)
> (autoload 'nnir-article-group "nnir" nil nil 'macro)

> and I've rearranged the order of things in nnir.el so the macro
> definitions come before the (require 'gnus-sum).

[...]

> Does this all sound right? If so, I'll push the change.

I think it's definitely right.  Thanks.



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

* Re: nnir summary line formatting
  2010-12-03 14:06     ` Katsumi Yamaoka
@ 2010-12-03 14:32       ` Andrew Cohen
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Cohen @ 2010-12-03 14:32 UTC (permalink / raw)
  To: ding

>>>>> "Katsumi" == Katsumi Yamaoka <yamaoka@jpl.org> writes:


    Katsumi> [...]

    >> Does this all sound right? If so, I'll push the change.

    Katsumi> I think it's definitely right.  Thanks.

And now pushed. Thanks for all the help.




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

end of thread, other threads:[~2010-12-03 14:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-02 15:14 nnir summary line formatting Andrew Cohen
2010-12-02 15:25 ` Tassilo Horn
2010-12-02 15:28 ` Julien Danjou
2010-12-02 20:08 ` Andrew Cohen
2010-12-03  3:54 ` Katsumi Yamaoka
2010-12-03  4:13   ` Andrew Cohen
2010-12-03 13:37   ` Andrew Cohen
2010-12-03 14:06     ` Katsumi Yamaoka
2010-12-03 14:32       ` Andrew Cohen

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