Real men don't need the stupid silly help on top/bottom of the screen.
[apps/madmutt.git] / pager.c
diff --git a/pager.c b/pager.c
index 5880834..5f93d96 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -108,13 +108,11 @@ typedef struct _ansi_attr {
 
 static short InHelp = 0;
 
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
 static struct resize {
   int line;
   int SearchCompiled;
   int SearchBack;
 } *Resize = NULL;
-#endif
 
 #define NumSigLines 4
 
@@ -892,7 +890,7 @@ fill_buffer (FILE * f, off_t *last_pos, off_t offset, unsigned char *buf,
 }
 
 #ifdef USE_NNTP
-#include <nntp/nntp.h>
+#include "nntp.h"
 #endif
 
 static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
@@ -1231,14 +1229,6 @@ display_line (FILE * f, off_t *last_pos, struct line_t **lineInfo, int n,
   /* display the line */
   format_line (lineInfo, n, buf, flags, &a, cnt, &ch, &vch, &col, &special);
 
-  /* avoid a bug in ncurses... */
-#ifndef USE_SLANG_CURSES
-  if (col == 0) {
-    SETCOLOR (MT_COLOR_NORMAL);
-    addch (' ');
-  }
-#endif
-
   /* end the last color pattern (needed by S-Lang) */
   if (special || (col != COLS && (flags & (M_SHOWCOLOR | M_SEARCH))))
     resolve_color (*lineInfo, n, vch, flags, 0, &a);
@@ -1260,15 +1250,7 @@ display_line (FILE * f, off_t *last_pos, struct line_t **lineInfo, int n,
     bkgdset (def_color | ' ');
 #endif
   }
-
-  /* ncurses always wraps lines when you get to the right side of the
-   * screen, but S-Lang seems to only wrap if the next character is *not*
-   * a newline (grr!).
-   */
-#ifndef USE_SLANG_CURSES
-  if (col < COLS)
-#endif
-    addch ('\n');
+  addch ('\n');
 
   /*
    * reset the color back to normal.  This *must* come after the
@@ -1298,31 +1280,6 @@ static int upNLines (int nlines, struct line_t *info, int cur, int hiding)
   return cur;
 }
 
-static struct mapping_t PagerHelp[] = {
-  {N_("Exit"), OP_EXIT},
-  {N_("PrevPg"), OP_PREV_PAGE},
-  {N_("NextPg"), OP_NEXT_PAGE},
-  {NULL, 0}
-};
-static struct mapping_t PagerHelpExtra[] = {
-  {N_("View Attachm."), OP_VIEW_ATTACHMENTS},
-  {N_("Del"), OP_DELETE},
-  {N_("Reply"), OP_REPLY},
-  {N_("Next"), OP_MAIN_NEXT_UNDELETED},
-  {NULL, 0}
-};
-
-#ifdef USE_NNTP
-static struct mapping_t PagerNewsHelpExtra[] = {
-  {N_("Post"), OP_POST},
-  {N_("Followup"), OP_FOLLOWUP},
-  {N_("Del"), OP_DELETE},
-  {N_("Next"), OP_MAIN_NEXT_UNDELETED},
-  {NULL, 0}
-};
-#endif
-
-
 /* This pager is actually not so simple as it once was.  It now operates in
    two modes: one for viewing messages and the other for viewing help.  These
    can be distinguished by whether or not ``hdr'' is NULL.  The ``hdr'' arg
@@ -1333,8 +1290,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
 {
   static char searchbuf[STRING];
   char buffer[LONG_STRING];
-  char helpstr[STRING * 2];
-  char tmphelp[STRING * 2];
   int maxLine, lastLine = 0;
   struct line_t *lineInfo;
   struct q_class_t *QuoteList = NULL;
@@ -1397,23 +1352,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
     (lineInfo[i].syntax)[0].first = (lineInfo[i].syntax)[0].last = -1;
   }
 
-  mutt_compile_help (helpstr, sizeof(helpstr), MENU_PAGER, PagerHelp);
-  if (IsHeader (extra)) {
-    m_strcpy(tmphelp, sizeof(tmphelp), helpstr);
-    mutt_compile_help (buffer, sizeof(buffer), MENU_PAGER,
-#ifdef USE_NNTP
-                       (Context
-                        && (Context->magic == M_NNTP)) ? PagerNewsHelpExtra :
-#endif
-                       PagerHelpExtra);
-    snprintf (helpstr, sizeof (helpstr), "%s %s", tmphelp, buffer);
-  }
-  if (!InHelp) {
-    m_strcpy(tmphelp, sizeof(tmphelp), helpstr);
-    mutt_make_help (buffer, sizeof(buffer), _("Help"), MENU_PAGER, OP_HELP);
-    snprintf (helpstr, sizeof(helpstr), "%s %s", tmphelp, buffer);
-  }
-
   while (ch != -1) {
     mutt_curs_set (0);
     imap_keepalive ();
@@ -1452,11 +1390,10 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
       if (option (OPTHELP)) {
         SETCOLOR (MT_COLOR_STATUS);
         move (helpoffset, SW);
-        mutt_paddstr (COLS-SW, helpstr);
+        mutt_paddstr (COLS-SW, "");
         SETCOLOR (MT_COLOR_NORMAL);
       }
 
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
       if (Resize != NULL) {
         if ((SearchCompiled = Resize->SearchCompiled)) {
           REGCOMP
@@ -1469,7 +1406,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
 
         p_delete(&Resize);
       }
-#endif
 
       if (IsHeader (extra) && PagerIndexLines) {
         if (pager_index == NULL) {
@@ -1639,7 +1575,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
       mutt_query_exit ();
       continue;
     }
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
     else if (SigWinch) {
       mutt_resize_screen ();
 
@@ -1683,7 +1618,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
       clearok (stdscr, TRUE);   /*force complete redraw */
       continue;
     }
-#endif
     else if (ch == -1) {
       ch = 0;
       continue;
@@ -2221,7 +2155,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
       CHECK_MODE (IsHeader (extra) && !IsAttach (extra));
       CHECK_ATTACH;
       if (extra->ctx && extra->ctx->magic == M_NNTP &&
-          !((NNTP_DATA *) extra->ctx->data)->allowed &&
+          !((nntp_data_t *) extra->ctx->data)->allowed &&
           query_quadoption (OPT_TOMODERATED,
                             _
                             ("Posting to this group not allowed, may be moderated. Continue?"))
@@ -2235,7 +2169,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
       CHECK_MODE (IsHeader (extra) || IsMsgAttach (extra));
       CHECK_ATTACH;
       if (extra->ctx && extra->ctx->magic == M_NNTP &&
-          !((NNTP_DATA *) extra->ctx->data)->allowed &&
+          !((nntp_data_t *) extra->ctx->data)->allowed &&
           query_quadoption (OPT_TOMODERATED,
                             _
                             ("Posting to this group not allowed, may be moderated. Continue?"))
@@ -2263,7 +2197,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
           query_quadoption (OPT_FOLLOWUPTOPOSTER,
                             _("Reply by mail as poster prefers?")) != M_YES) {
         if (extra->ctx && extra->ctx->magic == M_NNTP
-            && !((NNTP_DATA *) extra->ctx->data)->allowed
+            && !((nntp_data_t *) extra->ctx->data)->allowed
             && query_quadoption (OPT_TOMODERATED,
                                  _
                                  ("Posting to this group not allowed, may be moderated. Continue?"))