[PATCH] pager_honours_reverse_sort
- To: mutt-dev@xxxxxxxx
- Subject: [PATCH] pager_honours_reverse_sort
- From: "Ben Walton" <bdwalton@xxxxxxxxx>
- Date: Tue, 9 Oct 2007 15:21:04 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=wXAJRQ434/UE/dPTDV2G4p0xUBN3vBGJabXHqp2ByBg=; b=oTa0iVB3iuPzhmsjEgXk1aMYIzSW95HZPnGO7Qj6b8f8TsSXwNkHKZfY1muJH7ZqUFKU1Bsh37dNsL0OWi52lfFiB547nZH2pSVNnlVfuc9iCVbTL17/n5U7DMXbXY5m6D31tb9asgP6gO13/u7B5mntgQ/vB5/bgdg+NCbcZdw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=M+BVzo9pmFUKym0bRX9Ko59rRAxcyMFU+0OPMVCICGTnWoXgFVNvchTEbjKdyXi/3904lixGH6E2SSFQt71TdTM3YWQ36ZjcqQIwBHpuA4hiW9U8T9vSJ227Rh9VFQ7GI6pTq+xmly0TNc+PHEMhPUIx+NkarpLsIyvwmyz/3Yw=
- List-post: <mailto:mutt-dev@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-dev"
- Sender: owner-mutt-dev@xxxxxxxx
Hi All,
The attached patch adds the configuration variable
pager_honours_reverse_sort. When true, this option will see the pager
skip to the previous (lower numbered) message in the list instead of
the next message. I prefer to keep new mail at the top of the heap,
but the pager always goes to the next mail (typically older in my
case). I've grown tired of using pager_stop and decided to hack this
change in.
I hope it's acceptable.
Thanks
-Ben
--
---------------------------------------------------------------------------------------------------------------------------
Ben Walton <bdwalton@xxxxxxxxx>
When one person suffers from a delusion, it is called insanity. When
many people suffer from a delusion it is called Religion.
Robert M. Pirsig, Zen and the Art of Motorcycle Maintenance
---------------------------------------------------------------------------------------------------------------------------
#diff -r 709db707bcdf init.h
--- a/init.h Fri Sep 28 11:06:43 2007 +0200
+++ b/init.h Fri Oct 05 16:57:58 2007 -0400
@@ -1398,6 +1398,13 @@ struct option_t MuttVars[] = {
** when you are at the end of a message and invoke the \fInext-page\fP
** function.
*/
+ { "pager_honours_reverse_sort", DT_BOOL, R_NONE,
OPTPAGERHONOURSREVERSE, 0 },
+ /*
+ ** .pp
+ ** When set, the internal pager will move to the previous messages
instead
+ ** of the next message when paging past the bottom/end of the current
+ ** message.
+ */
{ "pgp_autosign", DT_SYN, R_NONE, UL "crypt_autosign", 0 },
{ "crypt_autosign", DT_BOOL, R_NONE, OPTCRYPTAUTOSIGN, 0 },
/*
#diff -r 709db707bcdf mutt.h
--- a/mutt.h Fri Sep 28 11:06:43 2007 +0200
+++ b/mutt.h Tue Oct 09 14:38:43 2007 -0400
@@ -409,6 +409,7 @@ enum
OPTMIMEFORWDECODE,
OPTNARROWTREE,
OPTPAGERSTOP,
+ OPTPAGERHONOURSREVERSE,
OPTPIPEDECODE,
OPTPIPESPLIT,
#ifdef USE_POP
#diff -r 709db707bcdf pager.c
--- a/pager.c Fri Sep 28 11:06:43 2007 +0200
+++ b/pager.c Fri Oct 05 17:00:21 2007 -0400
@@ -1897,7 +1897,11 @@ mutt_pager (const char *banner, const ch
else
{
/* end of the current message, so display the next message. */
- rc = OP_MAIN_NEXT_UNDELETED;
+ /* FIXME: Make this based on an option later */
+ if (option (OPTPAGERHONOURSREVERSE) && Sort & SORT_REVERSE)
+ rc = OP_MAIN_PREV_UNDELETED;
+ else
+ rc = OP_MAIN_NEXT_UNDELETED;
ch = -1;
}
break;