Gnus development mailing list
 help / color / mirror / Atom feed
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: sort by reverse date & bbdb
Date: Sun, 30 May 2004 12:14:30 -0400	[thread overview]
Message-ID: <m34qpxsxi1.fsf@asfast.com> (raw)
In-Reply-To: <87iseerkqy.fsf@dinglei.ipanel.com.cn>

Ding Lei <dinglei@ipanel.cn> writes:

> Danny Siu <dsiu@adobe.com> writes:
>
>> Ding Lei writes:
>>
>>   Ding> Hello,
>>   Ding> 1. C-c C-s C-d does sort by date, what's the combo for sort by
>>   Ding>    reverse date?
>>
>> Try prefix it with C-u C-c C-s C-d.  Lots of command has alternative
>> behaviour if given the C-u prefix.  Also, some command takes numeric prefix.
>> For eg: C-u 7 C-n moves your cursor down 7 lines.
> Ah it works. Thanks!  but .. what's the corresponding lisp command?
> what's the reverse for (gnus-summary-sort-by-date) ??

That command is (gnus-summary-sort-by-date) :)

When you pass a non-nil argument to it, it sorts in reverse order:

  gnus-summary-sort-by-date is an interactive compiled Lisp function in
  `gnus-sum'.
  (gnus-summary-sort-by-date &optional REVERSE)

  Sort the summary buffer by date.
  Argument REVERSE means reverse order.

If you want a function that does this without having to specify an
argument, you can do the following:

  (defun my-gnus-summary-sort-by-date-rev ()
    (interactive)
    (gnus-summary-sort-by-date t))


> And how do I customize default sorting methods for different groups?
> Thank you!

You can set up a `gnus-summary-generate-hook', as follows:

  (defun my-gnus-article-sort-by-date-rev (h1 h2)
    ;; swap the argument order to do a reverse sort
    (gnus-article-sort-by-date h2 h1))
  (defun my-gnus-summary-generate-hook ()
    (when (and (not (null gnus-newsgroup-name))
               (stringp gnus-newsgroup-name))
      (cond
       ((string-match "\\(foo\\|bar\\)" gnus-newsgroup-name)
        (setq gnus-article-sort-functions '(my-gnus-article-sort-by-date-rev))
        t)
       (t
        (setq gnus-article-sort-functions '(gnus-article-sort-by-date))
        t))))
  (add-hook 'gnus-summary-generate-hook 'my-gnus-summary-generate-hook)


-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.




  reply	other threads:[~2004-05-30 16:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-29  6:16 Ding Lei
2004-05-29 20:16 ` Danny Siu
2004-05-30 15:35   ` Ding Lei
2004-05-30 16:14     ` Lloyd Zusman [this message]
2004-05-31 16:54       ` Reiner Steib

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=m34qpxsxi1.fsf@asfast.com \
    --to=ljz@asfast.com \
    /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).