Kevin McCarthy wrote:
> 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.

Attached is a slightly revised patch, with a fixed summary and based
against tip.  Thank you for any feedback you can provide.

-Kevin

# HG changeset patch
# User Kevin McCarthy <ke...@8t8.us>
# Date 1329510974 28800
# Branch HEAD
# Node ID bcda5c54e3d0be75b16c73f34882a87c832714b2
# Parent  c26dbc7021f4ec56c0e41d43019e43dd0be666de
Add $pager_next_new boolean to control displaying next or new message.
If $pager_stop is unset, this boolean toggles between displaying the
next new message or just the next message when you reaach the end of
the message.

diff -r c26dbc7021f4 -r bcda5c54e3d0 init.h
--- a/init.h	Tue Dec 20 22:24:35 2011 -0800
+++ b/init.h	Fri Feb 17 12:36:14 2012 -0800
@@ -1640,12 +1640,21 @@
   ** is less than $$pager_index_lines, 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 $$pager_stop is set.
+  ** See also: ``$$pager_stop''.
+  */
   { "pager_stop",	DT_BOOL, R_NONE, OPTPAGERSTOP, 0 },
   /*
   ** .pp
   ** When \fIset\fP, the internal-pager will \fBnot\fP move to the next message
   ** when you are at the end of a message and invoke the \fC<next-page>\fP
   ** function.
+  ** See also: ``$$pager_next_new''.
   */
   { "pgp_auto_decode", DT_BOOL, R_NONE, OPTPGPAUTODEC, 0 },
   /*
diff -r c26dbc7021f4 -r bcda5c54e3d0 mutt.h
--- a/mutt.h	Tue Dec 20 22:24:35 2011 -0800
+++ b/mutt.h	Fri Feb 17 12:36:14 2012 -0800
@@ -396,6 +396,7 @@
   OPTMHPURGE,
   OPTMIMEFORWDECODE,
   OPTNARROWTREE,
+  OPTPAGERNEXTNEW,
   OPTPAGERSTOP,
   OPTPIPEDECODE,
   OPTPIPESPLIT,
diff -r c26dbc7021f4 -r bcda5c54e3d0 pager.c
--- a/pager.c	Tue Dec 20 22:24:35 2011 -0800
+++ b/pager.c	Fri Feb 17 12:36:14 2012 -0800
@@ -1942,7 +1942,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;
@@ -2005,7 +2008,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