(patch) new option: pager_end_partial
Hello,
A friend switching from elm to mutt sent me the following complaint:
This one has to do with a stupid misfeature of the builtin pager.
When I get near the bottom of a message (say, 5 more lines), if I
hit <space> to page, it scrolls the entire page and just shows me
the last 5 lines on the screen. Elm would just scroll 5 lines and
show me a full screen. Any way to do that in Mutt?
I don't think it's necessarily a misfeature since some users will prefer
the current mutt behavior. But it's something that would be nice to
configure.
This attached patch adds a new boolean setting: pager_end_partial. The
setting controls whether the pager will display a partial page when the
end of a message is displayed. The default is set to preserve the
current behavior. When unset, the pager will adjust the current
position to display as much of the message as possible.
Would you consider applying this patch or suggest changes to help it be
accepted?
Thanks,
Aron
P.S. Please cc me on replies since I'm not subscribed to the list.
--- mutt-1.5.5.1/init.h 2004-01-12 15:51:34.000000000 -0500
+++ mutt-1.5.5.1.agriffis/init.h 2004-01-12 15:34:02.000000000 -0500
@@ -1202,6 +1202,13 @@
** is less than \fIpager_index_lines\fP, then the index will only use as
** many lines as it needs.
*/
+ { "pager_end_partial", DT_BOOL, R_NONE, OPTPAGERENDPARTIAL, 1 },
+ /*
+ ** .pp
+ ** Controls whether the pager will display a partial page when the end
+ ** of a message is displayed. When unset, the pager will adjust the
+ ** current position to display as much of the message as possible.
+ */
{ "pager_stop", DT_BOOL, R_NONE, OPTPAGERSTOP, 0 },
/*
** .pp
--- mutt-1.5.5.1/mutt.h 2004-01-12 15:51:34.000000000 -0500
+++ mutt-1.5.5.1.agriffis/mutt.h 2004-01-12 15:28:39.000000000 -0500
@@ -386,6 +386,7 @@
OPTMHPURGE,
OPTMIMEFORWDECODE,
OPTNARROWTREE,
+ OPTPAGERENDPARTIAL,
OPTPAGERSTOP,
OPTPIPEDECODE,
OPTPIPESPLIT,
--- mutt-1.5.5.1/pager.c 2004-01-12 15:51:34.000000000 -0500
+++ mutt-1.5.5.1.agriffis/pager.c 2004-01-12 15:33:59.000000000 -0500
@@ -1680,6 +1680,13 @@
curline++;
}
last_offset = lineInfo[curline].offset;
+
+ /* adjust topline so that we don't display past the end of the message
*/
+ if (!option (OPTPAGERENDPARTIAL) && lines < bodylen && topline > 0)
+ {
+ topline = upNLines (bodylen, lineInfo, lastLine, hideQuoted);
+ force_redraw = 1;
+ }
} while (force_redraw);
SETCOLOR (MT_COLOR_TILDE);