diff options
author | Frederic Culot <calcurse@culot.org> | 2009-01-24 18:45:35 +0000 |
---|---|---|
committer | Frederic Culot <calcurse@culot.org> | 2009-01-24 18:45:35 +0000 |
commit | 87f010ff067134b0561d6e658bbbbe3c971f3841 (patch) | |
tree | bbd100e45b97c8f258cd37d7caccaa3558e677f0 | |
parent | b411c2bf3f4514b9a28b80a24127dccaa94d38a5 (diff) | |
download | calcurse-87f010ff067134b0561d6e658bbbbe3c971f3841.tar.gz calcurse-87f010ff067134b0561d6e658bbbbe3c971f3841.zip |
bugfix: load keys even in non-interactive mode to avoid the loss of user-configured key bindings
-rwxr-xr-x | ChangeLog | 3 | ||||
-rwxr-xr-x | src/args.c | 27 | ||||
-rwxr-xr-x | src/calcurse.c | 3 | ||||
-rwxr-xr-x | src/io.c | 4 | ||||
-rwxr-xr-x | src/keys.c | 4 |
5 files changed, 21 insertions, 20 deletions
@@ -15,6 +15,9 @@ * configure.ac: switch to 2.5 * src/calcurse.1: manpage updated for 2.5 version + + * src/args.c (parse_args): load keys even in non-interactive mode + to avoid the loss of user configured key bindings 2009-01-23 Frederic Culot <frederic@culot.org> @@ -1,4 +1,4 @@ -/* $calcurse: args.c,v 1.44 2009/01/03 21:32:11 culot Exp $ */ +/* $calcurse: args.c,v 1.45 2009/01/24 18:45:35 culot Exp $ */ /* * Calcurse - text-based organizer @@ -730,7 +730,7 @@ parse_args (int argc, char **argv, conf_t *conf) { usage (); usage_try (); - return (EXIT_FAILURE); + return EXIT_FAILURE; /* Incorrect arguments */ } else if (Dflag && cflag) @@ -739,7 +739,7 @@ parse_args (int argc, char **argv, conf_t *conf) stderr); usage (); usage_try (); - return (EXIT_FAILURE); + return EXIT_FAILURE; } else { @@ -764,14 +764,17 @@ parse_args (int argc, char **argv, conf_t *conf) io_init (cfile, datadir); no_file = io_check_data_files (); if (dflag || aflag || nflag || iflag || xflag || rflag || sflag) - io_load_app (); + { + vars_init (conf); + custom_load_conf (conf, 0); + io_load_keys (conf->pager); + io_load_app (); + io_load_todo (); + } } if (iflag) { notify_init_vars (); - vars_init (conf); - custom_load_conf (conf, 0); - io_load_todo (); io_import_data (IO_IMPORT_ICAL, conf, ifile); io_save_cal (conf, IO_SAVE_DISPLAY_NONE); non_interactive = 1; @@ -779,11 +782,9 @@ parse_args (int argc, char **argv, conf_t *conf) if (xflag) { notify_init_vars (); - custom_load_conf (conf, 0); - io_load_todo (); io_export_data (xfmt, conf); non_interactive = 1; - return (non_interactive); + return non_interactive; } if (tflag) { @@ -798,8 +799,6 @@ parse_args (int argc, char **argv, conf_t *conf) if (dflag || rflag || sflag) { notify_init_vars (); - vars_init (conf); - custom_load_conf (conf, 0); if (dflag) date_arg (ddate, add_line, Nflag, conf); if (rflag || sflag) @@ -811,8 +810,6 @@ parse_args (int argc, char **argv, conf_t *conf) date_t day; day.dd = day.mm = day.yyyy = 0; notify_init_vars (); - vars_init (conf); - custom_load_conf (conf, 0); app_found = app_arg (add_line, &day, 0, Nflag, conf); non_interactive = 1; } @@ -823,6 +820,6 @@ parse_args (int argc, char **argv, conf_t *conf) io_init (cfile, datadir); no_file = io_check_data_files (); } - return (non_interactive); } + return non_interactive; } diff --git a/src/calcurse.c b/src/calcurse.c index 841603a..552cfb4 100755 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -1,4 +1,4 @@ -/* $calcurse: calcurse.c,v 1.77 2009/01/03 21:32:11 culot Exp $ */ +/* $calcurse: calcurse.c,v 1.78 2009/01/24 18:45:35 culot Exp $ */ /* * Calcurse - text-based organizer @@ -134,7 +134,6 @@ main (int argc, char **argv) } vars_init (&conf); - keys_init (); wins_init (); wins_slctd_init (); notify_init_bar (); @@ -1,4 +1,4 @@ -/* $calcurse: io.c,v 1.57 2009/01/24 14:44:25 culot Exp $ */ +/* $calcurse: io.c,v 1.58 2009/01/24 18:45:35 culot Exp $ */ /* * Calcurse - text-based organizer @@ -1278,6 +1278,8 @@ io_load_keys (char *pager) io_file_t *log; int i, skipped, loaded, line; const int MAX_ERRORS = 5; + + keys_init (); #define HSIZE 256 HTABLE_HEAD (ht_keybindings, HSIZE, ht_keybindings_s) ht_keys = @@ -1,4 +1,4 @@ -/* $calcurse: keys.c,v 1.15 2009/01/24 14:44:25 culot Exp $ */ +/* $calcurse: keys.c,v 1.16 2009/01/24 18:45:35 culot Exp $ */ /* * Calcurse - text-based organizer @@ -113,7 +113,7 @@ dump_intro (FILE *fd) "# the 'ESC', 'SPC' and 'TAB' keyword, respectively.\n" "# Arrow keys can also be specified with the UP, DWN, LFT, RGT keywords.\n" "# Last, Home and End keys can be assigned using 'KEY_HOME' and 'KEY_END'\n" - "# keywords" + "# keywords." "\n#\n" "# A description of what each ACTION keyword is used for is available\n" "# from calcurse online configuration menu.\n"); |