Simplifications.
[apps/madmutt.git] / init.c
diff --git a/init.c b/init.c
index ce05070..c9442ce 100644 (file)
--- a/init.c
+++ b/init.c
@@ -319,18 +319,6 @@ static int rx_from_string (struct option_t* dst, const char* val,
   return (1);
 }
 
-static void magic_to_string (char* dst, ssize_t dstlen,
-                             struct option_t* option) {
-  const char* s = NULL;
-  switch (option->data) {
-    case M_MBOX:    s = "mbox"; break;
-    case M_MH:      s = "MH"; break;
-    case M_MAILDIR: s = "Maildir"; break;
-    default:        s = "unknown"; break;
-  }
-  snprintf (dst, dstlen, "%s=%s", option->option, s);
-}
-
 static int magic_from_string (struct option_t* dst, const char* val,
                               char *errbuf, ssize_t errlen)
 {
@@ -367,7 +355,6 @@ static struct {
   { DT_QUAD,    quad_to_string,   quad_from_string },
   { DT_SORT,    sort_to_string,   sort_from_string },
   { DT_RX,      rx_to_string,     rx_from_string },
-  { DT_MAGIC,   magic_to_string,  magic_from_string },
 };
 
 
@@ -433,9 +420,7 @@ int query_quadoption2(int v, const char *prompt)
     return (v);
 
   default:
-    v = mutt_yesorno(prompt, (v == M_ASKYES));
-    CLEARLINE(stdscr, LINES - 1);
-    return (v);
+    return mutt_yesorno(prompt, (v == M_ASKYES));
   }
 }
 
@@ -449,12 +434,8 @@ int query_quadoption (int opt, const char *prompt)
     return (v);
 
   default:
-    v = mutt_yesorno (prompt, (v == M_ASKYES));
-    CLEARLINE(stdscr, LINES - 1);
-    return (v);
+    return mutt_yesorno(prompt, (v == M_ASKYES));
   }
-
-  /* not reached */
 }
 
 /* always wise to do what someone else did before */
@@ -1105,7 +1086,6 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data,
     }
     else if (DTYPE (option->type) == DT_STR ||
              DTYPE (option->type) == DT_PATH ||
-             DTYPE (option->type) == DT_MAGIC ||
              DTYPE (option->type) == DT_NUM ||
              DTYPE (option->type) == DT_SORT ||
              DTYPE (option->type) == DT_RX)
@@ -1565,23 +1545,6 @@ int mutt_var_value_complete (char *buffer, ssize_t len, int pos)
                  (*((short *)option->data) & SORT_REVERSE) ? "reverse-" : "",
                  (*((short *)option->data) & SORT_LAST) ? "last-" : "", p);
       }
-      else if (DTYPE (option->type) == DT_MAGIC) {
-        const char *p;
-        switch (DefaultMagic) {
-          case M_MBOX:
-            p = "mbox";
-            break;
-          case M_MH:
-            p = "MH";
-            break;
-          case M_MAILDIR:
-            p = "Maildir";
-            break;
-          default:
-            p = "unknown";
-        }
-        m_strcpy(tmp, sizeof(tmp), p);
-      }
       else if (DTYPE (option->type) == DT_BOOL)
         m_strcpy(tmp, sizeof(tmp), option(option->data) ? "yes" : "no");
       else
@@ -1773,13 +1736,3 @@ void mutt_init (int skip_sys_rc, string_list_t * commands)
   }
 }
 
-int mutt_get_hook_type (const char *name)
-{
-  struct command_t *c;
-
-  for (c = Commands; c->name; c++)
-    if (c->func == mutt_parse_hook && ascii_strcasecmp (c->name, name) == 0)
-      return c->data;
-  return 0;
-}
-