There was an email today on mutt-users about configuring the space bar
to go to the next new email at the end of a message.  It sounded like a
reasonable request, and is the default behavior on some mail readers.

Here is a patch to implement a configuration option for that.  This is
my first patch (and email to the list) so please let me know if I
submitted the patch correctly.

Thank you,

-Kevin

# HG changeset patch
# User Kevin McCarthy <ke...@8t8.us>
# Date 1329446914 28800
# Node ID 826d0a0125e799f4ddaa001656dcd4b8cdb1d0f9
# Parent  f467353f5657d9504dc5924fefc804fadc586f57
imported patch pagernew

diff -r f467353f5657 -r 826d0a0125e7 init.h
--- a/init.h	Sat Mar 31 18:50:39 2007 -0700
+++ b/init.h	Thu Feb 16 18:48:34 2012 -0800
@@ -1374,12 +1374,21 @@
   ** is less than \fIpager_index_lines\fP, then the index will only use as
   ** many lines as it needs.
   */
+  { "pager_next_new",	DT_BOOL, R_NONE, OPTPAGERNEXTNEW, 0 },
+  /*
+  ** .pp
+  ** When set, the pager will move to the next new message upon reaching
+  ** then end of a message.  When unset, the pager will move to the next
+  ** message.  This variable has no effect when \fIpager_stop\fP is set.
+  ** See also: ``$$pager_stop''.
+  */
   { "pager_stop",	DT_BOOL, R_NONE, OPTPAGERSTOP, 0 },
   /*
   ** .pp
   ** When set, the internal-pager will \fBnot\fP move to the next message
   ** when you are at the end of a message and invoke the \fInext-page\fP
   ** function.
+  ** See also: ``$$pager_next_new''.
   */
   { "pgp_autosign", 	DT_SYN,  R_NONE, UL "crypt_autosign", 0 },
   { "crypt_autosign",	DT_BOOL, R_NONE, OPTCRYPTAUTOSIGN, 0 },
diff -r f467353f5657 -r 826d0a0125e7 mutt.h
--- a/mutt.h	Sat Mar 31 18:50:39 2007 -0700
+++ b/mutt.h	Thu Feb 16 18:48:34 2012 -0800
@@ -405,6 +405,7 @@
   OPTMHPURGE,
   OPTMIMEFORWDECODE,
   OPTNARROWTREE,
+  OPTPAGERNEXTNEW,
   OPTPAGERSTOP,
   OPTPIPEDECODE,
   OPTPIPESPLIT,
diff -r f467353f5657 -r 826d0a0125e7 pager.c
--- a/pager.c	Sat Mar 31 18:50:39 2007 -0700
+++ b/pager.c	Thu Feb 16 18:48:34 2012 -0800
@@ -1892,7 +1892,10 @@
 	else
 	{
 	  /* end of the current message, so display the next message. */
-	  rc = OP_MAIN_NEXT_UNDELETED;
+	  if (option (OPTPAGERNEXTNEW))
+	    rc = OP_MAIN_NEXT_NEW;
+	  else
+	    rc = OP_MAIN_NEXT_UNDELETED;
 	  ch = -1;
 	}
 	break;
@@ -1955,7 +1958,10 @@
 	else
 	{
 	  /* end of the current message, so display the next message. */
-	  rc = OP_MAIN_NEXT_UNDELETED;
+	  if (option (OPTPAGERNEXTNEW))
+	    rc = OP_MAIN_NEXT_NEW;
+	  else
+	    rc = OP_MAIN_NEXT_UNDELETED;
 	  ch = -1;
 	}
 	break;

Attachment: signature.asc
Description: Digital signature

Reply via email to