]> granicus.if.org Git - neomutt/commitdiff
config: don't dump deprecated items
authorRichard Russon <rich@flatcap.org>
Mon, 9 Sep 2019 10:31:09 +0000 (11:31 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 9 Sep 2019 10:45:18 +0000 (11:45 +0100)
config/dump.c
config/dump.h
config/types.h
init.h

index 02244455cfb8992b4c45351fa880f0be98142b58..8dae7b63c6dbf6826d010dea6ee6b6408b5d876a 100644 (file)
@@ -222,6 +222,9 @@ bool dump_config(struct ConfigSet *cs, ConfigDumpFlags flags, FILE *fp)
     if ((type == DT_SYNONYM) && !(flags & CS_DUMP_SHOW_SYNONYMS))
       continue;
 
+    if ((he->type & DT_DEPRECATED) && !(flags & CS_DUMP_SHOW_DEPRECATED))
+      continue;
+
     // if ((type == DT_DISABLED) && !(flags & CS_DUMP_SHOW_DISABLED))
     //   continue;
 
index 53169cc68bdb029b2b5044b391a8f3acae71ad23..9dd635e46196c96b72b494a6846015554a51a38b 100644 (file)
@@ -31,16 +31,17 @@ struct Buffer;
 struct ConfigSet;
 struct HashElem;
 
-typedef uint8_t ConfigDumpFlags;        ///< Flags for dump_config(), e.g. #CS_DUMP_ONLY_CHANGED
-#define CS_DUMP_NO_FLAGS             0  ///< No flags are set
-#define CS_DUMP_ONLY_CHANGED   (1 << 0) ///< Only show config that the user has changed
-#define CS_DUMP_HIDE_SENSITIVE (1 << 1) ///< Obscure sensitive information like passwords
-#define CS_DUMP_NO_ESCAPING    (1 << 2) ///< Do not escape special chars, or quote the string
-#define CS_DUMP_HIDE_NAME      (1 << 3) ///< Do not print the name of the config item
-#define CS_DUMP_HIDE_VALUE     (1 << 4) ///< Do not print the value of the config item
-#define CS_DUMP_SHOW_DEFAULTS  (1 << 5) ///< Show the default value for the config item
-#define CS_DUMP_SHOW_DISABLED  (1 << 6) ///< Show disabled config items, too
-#define CS_DUMP_SHOW_SYNONYMS  (1 << 7) ///< Show synonyms and the config items their linked to
+typedef uint8_t ConfigDumpFlags;          ///< Flags for dump_config(), e.g. #CS_DUMP_ONLY_CHANGED
+#define CS_DUMP_NO_FLAGS              0   ///< No flags are set
+#define CS_DUMP_ONLY_CHANGED    (1 << 0)  ///< Only show config that the user has changed
+#define CS_DUMP_HIDE_SENSITIVE  (1 << 1)  ///< Obscure sensitive information like passwords
+#define CS_DUMP_NO_ESCAPING     (1 << 2)  ///< Do not escape special chars, or quote the string
+#define CS_DUMP_HIDE_NAME       (1 << 3)  ///< Do not print the name of the config item
+#define CS_DUMP_HIDE_VALUE      (1 << 4)  ///< Do not print the value of the config item
+#define CS_DUMP_SHOW_DEFAULTS   (1 << 5)  ///< Show the default value for the config item
+#define CS_DUMP_SHOW_DISABLED   (1 << 6)  ///< Show disabled config items, too
+#define CS_DUMP_SHOW_SYNONYMS   (1 << 7)  ///< Show synonyms and the config items they're linked to
+#define CS_DUMP_SHOW_DEPRECATED (1 << 8)  ///< Show config items that aren't used any more
 
 void              dump_config_neo(struct ConfigSet *cs, struct HashElem *he, struct Buffer *value, struct Buffer *initial, ConfigDumpFlags flags, FILE *fp);
 bool              dump_config(struct ConfigSet *cs, ConfigDumpFlags flags, FILE *fp);
index 5b7e0680535910ffe3fcc642d7b5756ac3e7f931..71ff5136e5d114bab533f1be6c0415c4fdcc1905 100644 (file)
@@ -74,6 +74,7 @@ typedef uint32_t ConfigRedrawFlags; ///< Flags for redraw/resort, e.g. #R_INDEX
 #define R_REDRAW_MASK  0x07FE0000   ///< Mask for the Redraw Flags
 
 /* Private config item flags */
+#define DT_DEPRECATED   (1 << 27)  ///< Config item shouldn't be used any more
 #define DT_INHERITED    (1 << 28)  ///< Config item is inherited
 #define DT_INITIAL_SET  (1 << 29)  ///< Config item must have its initial value freed
 #define DT_DISABLED     (1 << 30)  ///< Config item is disabled
diff --git a/init.h b/init.h
index bd5c40b05fb6f790f7617e73c66a2d7d08c93400..528e11c028f0ee7dd9eba237f64bd0209448c38a 100644 (file)
--- a/init.h
+++ b/init.h
@@ -4887,10 +4887,10 @@ struct ConfigDef MuttVars[] = {
 #endif
   /*--*/
 
-  { "ignore_linear_white_space", DT_BOOL,            &C_IgnoreLinearWhiteSpace, false   },
-  { "pgp_encrypt_self",          DT_QUAD,            &C_PgpEncryptSelf,         MUTT_NO },
-  { "smime_encrypt_self",        DT_QUAD,            &C_SmimeEncryptSelf,       MUTT_NO },
-  { "wrapmargin",                DT_NUMBER|R_PAGER,  &C_Wrap,                   0       },
+  { "ignore_linear_white_space", DT_DEPRECATED|DT_BOOL,            &C_IgnoreLinearWhiteSpace, false   },
+  { "pgp_encrypt_self",          DT_DEPRECATED|DT_QUAD,            &C_PgpEncryptSelf,         MUTT_NO },
+  { "smime_encrypt_self",        DT_DEPRECATED|DT_QUAD,            &C_SmimeEncryptSelf,       MUTT_NO },
+  { "wrapmargin",                DT_DEPRECATED|DT_NUMBER|R_PAGER,  &C_Wrap,                   0       },
 
   { "abort_noattach_regexp",  DT_SYNONYM, NULL, IP "abort_noattach_regex",     },
   { "attach_keyword",         DT_SYNONYM, NULL, IP "abort_noattach_regex",     },