From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/57774 Path: main.gmane.org!not-for-mail From: Lloyd Zusman Newsgroups: gmane.emacs.gnus.general Subject: Re: sort by reverse date & bbdb Date: Sun, 30 May 2004 12:14:30 -0400 Sender: ding-owner@lists.math.uh.edu Message-ID: References: <20040529061606.GA804@ipanel.cn> <87iseerkqy.fsf@dinglei.ipanel.com.cn> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085933788 1648 80.91.224.253 (30 May 2004 16:16:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 May 2004 16:16:28 +0000 (UTC) Original-X-From: ding-owner+M6315@lists.math.uh.edu Sun May 30 18:16:19 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BUSyx-0001Pb-00 for ; Sun, 30 May 2004 18:16:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1BUSyc-0006fL-00; Sun, 30 May 2004 11:15:58 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1BUSyU-0006fF-00 for ding@lists.math.uh.edu; Sun, 30 May 2004 11:15:50 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1BUSyT-00032O-Bo for ding@lists.math.uh.edu; Sun, 30 May 2004 11:15:49 -0500 Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by justine.libertine.org (Postfix) with ESMTP id 7A2473A0057 for ; Sun, 30 May 2004 11:15:47 -0500 (CDT) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BUSyN-0002DM-00 for ; Sun, 30 May 2004 18:15:46 +0200 Original-Received: from hippo.asfast.net ([216.182.10.250]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 30 May 2004 18:15:43 +0200 Original-Received: from ljz by hippo.asfast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 30 May 2004 18:15:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Lines: 60 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: hippo.asfast.net User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.2 (gnu/linux) Cancel-Lock: sha1:vR1qoYyy5yiW8/MiN/bqP2LcuYM= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:57774 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:57774 Ding Lei writes: > Danny Siu 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.