Gnus development mailing list
 help / color / mirror / Atom feed
* Use entire subject when sorting summary buffer
@ 2003-04-29  9:08 Niklas Morberg
  2003-04-29 15:53 ` Simon Josefsson
  0 siblings, 1 reply; 3+ messages in thread
From: Niklas Morberg @ 2003-04-29  9:08 UTC (permalink / raw)


We have a corporate spam filter that puts `[SPAM]' in the
Subject of suspected spam. When sorting a folder that
contains these messages by subject, the `[SPAM]' part is
ignored.

I sent a test message to myself with `[TEST] a' as Subject.
This got sorted as the letter a

In other words: only the text after brackets are used for
sorting. I would like to use the brackets and the text
within brackets as well when sorting.

I have set:

     (gnus-simplify-subject-functions nil)
     (gnus-simplify-ignored-prefixes nil)
     (gnus-thread-sort-functions '(gnus-thread-sort-by-subject))))

using gnus-parameters. `C-h v variable' in the summary
buffer tells me that the above settings are in effect.

Is there anything else I need to set/unset?

Niklas




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

* Re: Use entire subject when sorting summary buffer
  2003-04-29  9:08 Use entire subject when sorting summary buffer Niklas Morberg
@ 2003-04-29 15:53 ` Simon Josefsson
  2003-05-06 11:24   ` Niklas Morberg
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Josefsson @ 2003-04-29 15:53 UTC (permalink / raw)


Niklas Morberg <niklas.morberg@axis.com> writes:

> We have a corporate spam filter that puts `[SPAM]' in the
> Subject of suspected spam. When sorting a folder that
> contains these messages by subject, the `[SPAM]' part is
> ignored.
>
> I sent a test message to myself with `[TEST] a' as Subject.
> This got sorted as the letter a
>
> In other words: only the text after brackets are used for
> sorting. I would like to use the brackets and the text
> within brackets as well when sorting.
>
> I have set:
>
>      (gnus-simplify-subject-functions nil)
>      (gnus-simplify-ignored-prefixes nil)
>      (gnus-thread-sort-functions '(gnus-thread-sort-by-subject))))
>
> using gnus-parameters. `C-h v variable' in the summary
> buffer tells me that the above settings are in effect.
>
> Is there anything else I need to set/unset?

Try:

(setq gnus-thread-sort-functions '(my-gnus-thread-sort-by-subject))

(defun my-gnus-article-sort-by-subject (h1 h2)
  "Sort articles by root subject."
  (string-lessp
   (downcase (mail-header-subject h1))
   (downcase (mail-header-subject h2))))

Compare with original:

(defsubst gnus-article-sort-by-subject (h1 h2)
  "Sort articles by root subject."
  (string-lessp
   (downcase (gnus-simplify-subject-re (mail-header-subject h1)))
   (downcase (gnus-simplify-subject-re (mail-header-subject h2)))))




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

* Re: Use entire subject when sorting summary buffer
  2003-04-29 15:53 ` Simon Josefsson
@ 2003-05-06 11:24   ` Niklas Morberg
  0 siblings, 0 replies; 3+ messages in thread
From: Niklas Morberg @ 2003-05-06 11:24 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> Try:
>
> (setq gnus-thread-sort-functions '(my-gnus-thread-sort-by-subject))
>
> (defun my-gnus-article-sort-by-subject (h1 h2)
>   "Sort articles by root subject."
>   (string-lessp
>    (downcase (mail-header-subject h1))
>    (downcase (mail-header-subject h2))))

Thanks. I needed to have a my-gnus-thread-sort-by-subject to
call my-gnus-article-sort-by-subject as well, but then it
worked.

> Compare with original:
> 
> (defsubst gnus-article-sort-by-subject (h1 h2)
>   "Sort articles by root subject."
>   (string-lessp
>    (downcase (gnus-simplify-subject-re (mail-header-subject h1)))
>    (downcase (gnus-simplify-subject-re (mail-header-subject h2)))))

Looking at the implementation of gnus-simplify-subject-re I
came up with a different solution. Setting:

  (message-subject-re-regexp "")

with gnus-parameters for the group in question seems to
achieve the same thing but with less modifications to gnus.

Niklas




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

end of thread, other threads:[~2003-05-06 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-29  9:08 Use entire subject when sorting summary buffer Niklas Morberg
2003-04-29 15:53 ` Simon Josefsson
2003-05-06 11:24   ` Niklas Morberg

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