1 /**
2  * @file
3  * Config used by libindex
4  *
5  * @authors
6  * Copyright (C) 2021 Richard Russon <rich@flatcap.org>
7  *
8  * @copyright
9  * This program is free software: you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License as published by the Free Software
11  * Foundation, either version 2 of the License, or (at your option) any later
12  * version.
13  *
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  * details.
18  *
19  * You should have received a copy of the GNU General Public License along with
20  * this program.  If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 /**
24  * @page index_config Config used by the Index
25  *
26  * Config used by libindex
27  */
28 
29 #include "config.h"
30 #include <stddef.h>
31 #include <config/lib.h>
32 #include <stdbool.h>
33 
34 static struct ConfigDef IndexVars[] = {
35   // clang-format off
36   { "change_folder_next", DT_BOOL, false, 0, NULL,
37     "Suggest the next folder, rather than the first when using '<change-folder>'"
38   },
39   { "collapse_all", DT_BOOL, false, 0, NULL,
40     "Collapse all threads when entering a folder"
41   },
42   { "mark_macro_prefix", DT_STRING, IP "'", 0, NULL,
43     "Prefix for macros using '<mark-message>'"
44   },
45   { "uncollapse_jump", DT_BOOL, false, 0, NULL,
46     "When opening a thread, jump to the next unread message"
47   },
48   { "uncollapse_new", DT_BOOL, true, 0, NULL,
49     "Open collapsed threads when new mail arrives"
50   },
51   { NULL },
52   // clang-format on
53 };
54 
55 /**
56  * config_init_index - Register index config variables - Implements ::module_init_config_t - @ingroup cfg_module_api
57  */
config_init_index(struct ConfigSet * cs)58 bool config_init_index(struct ConfigSet *cs)
59 {
60   return cs_register_variables(cs, IndexVars, 0);
61 }
62