<<< Date Index >>>     <<< Thread Index >>>

[PATCH] pager_honours_reverse_sort



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;