| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
This allows for printing a subset of the items in the data files by
using filters.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Use the same error message if option arguments have the same data type
and always add the violating value.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Print TODO items before appointments in query outputs and add an empty
line between the list of TODO items and the list of appointments. This
is how items were printed before the big parser refactoring.
Also, add a test to ensure we do not unintentionally change that format
in the future.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Filtering items when running garbage collection or when importing data
might result in data loss, so simply ignore filters here.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new range query mode (--days) and refactor the command line
argument parser.
Note: This slightly changes the behavior of some command line
parameters, since date arguments no longer use the input date format
from the configuration file!
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
| |
The item filters now apply to both appointments and TODO items. Also,
add a new type mask "todo" and the following new filter options:
* --filter-priority
* --filter-completed
* --filter-uncompleted
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
| |
Add a new parameter -Q that can be used to print all appointments inside
a given query range, followed by all TODO items. The date range can be
specified using the --from and --to arguments. The start date defaults
to the current day, the end date defaults to the day after the start
date if not specified.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This adds a new item filter option --filter-pattern and removes the
whole -S parameter logic, while making -S an alias for --filter-pattern.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the following filter options that allow for restricting the
set of items that are read from the appointments file:
* --filter-type
* --filter-start-from
* --filter-start-to
* --filter-start-after
* --filter-start-before
* --filter-end-from
* --filter-end-to
* --filter-end-after
* --filter-end-before
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
This allows for merging the (unsaved) items with the items from the data
files when invoking the reload operation. To this end, an external merge
tool (defaults to vimdiff) is used.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
| |
This adds some more accurate checks to avoid a segmentation fault that
occurred when accessing a nonexistent item.
Fixes GitHub issue #7.
Reported-by: Bromind <martin.vassor@hotmail.fr>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This re-introduces the heading (showing the POM and the current date) as
well as the separating line between events and appointments.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
| |
Use the generic list box implementation for the appointments panel. This
results in some major changes to how the items are printed.
Note that this temporarily removes the heading showing the POM and the
date as well as the separating line between events and appointments.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
Adds the -l/--limit command line option. Limits the number of appointments
and/or ToDo items displayed.
Signed-off-by: William Pettersson <william.pettersson@gmail.com>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
| |
This completes our switch to the Linux kernel coding style. Note that we
still use deeply nested constructs at some places which need to be fixed
up later.
Converted using the `Lindent` script from the Linux kernel code base,
along with some manual fixes.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
| |
From the Linux kernel coding guidelines:
Do not unnecessarily use braces where a single statement will do.
[...] This does not apply if one branch of a conditional statement
is a single statement. Use braces in both branches.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Add 2013 to the copyright range for all source and documentation files.
Reported-by: Frederic Culot <frederic@culot.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This was broken in commit 87fb8cfec0d8e8fc901746095458bd316314b6ee. Fix
function signatures and update all invocations accordingly.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|\
| |
| |
| |
| |
| | |
Conflicts:
src/day.c
src/recur.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since the result of localtime() is stored in a statically allocated
structure, data was overwritten when a context switch occurred during
(or shortly after) the execution of localtime(), potentially resulting
in critical data corruption. BUG#7 and BUG#8 are likely related.
This patch converts all usages of localtime() with localtime_r(), which
is thread-safe.
Reported-by: Baptiste Jonglez <baptiste@jonglez.org>
Reported-by: Erik Saule <esaule@bmi.osu.edu>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is particularly useful if one wants to use configuration and key
bindings from a specific directory, while using an appointment file from
somewhere else. "-c" has precedence over "-D".
Also update the usage message, man page and documentation.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Return the total number of items found instead of the pad length, since
this is used to store items in non-interactive mode as well now. The pad
length can still be calculated by using the appointment and event count
parameters.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This kills the hackish code we used to filter and display appointments
and events in non-interactive mode. From now on, the same algorithm that
is used in interactive mode (read day_store_items() for details) is
called, resulting in code that is much easier to maintain.
The resulting performance loss is rather small. Here are the run times
of `calcurse -s01/01/1902 -r18250 -D ../test/data >/dev/null` before and
after the patch was applied:
0.30user 0.26system 0:01.22elapsed 46%CPU (0avgtext+0avgdata 1340maxresident)k
0inputs+0outputs (0major+398minor)pagefaults 0swaps
0.33user 0.21system 0:01.18elapsed 46%CPU (0avgtext+0avgdata 1360maxresident)k
0inputs+0outputs (0major+395minor)pagefaults 0swaps
Note that this also fixes a few bugs that were encountered in
non-interactive mode, most notably BUG#2.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|/
|
|
|
|
|
|
|
| |
Remove the "static" keyword from day_store_items(), so that it is
accessible from other compilation units. Also, allow for discarding the
event/appointment counters by passing NULL pointers and move the
"regex.h" header inclusion to "calcurse.h".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
| |
* Point out that bug reports should be sent to the bugs mailing list,
not to misc in help and usage messages.
* Call more_info() when displaying the help message instead of
copy-pasting strings to avoid double translation.
Reported-by: rafael ff1 <rafael.f.f1@gmail.com>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
| |
For some reasons, we were using snprintf() to format a string into a
buffer, and then displaying this buffer to stdout using fputs().
That's exactly what fprintf() is here for, so use it.
Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Some strings are initialized without wrapping them in _(); instead,
_() is applied on the variable when it is used.
This is incorrect, since these strings don't get added to the catalog.
Fix that by applying _() only once, when the string is declared.
Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert our code base to adhere to Linux kernel coding style using
Lindent, with the following exceptions:
* Use spaces, instead of tabs, for indentation.
* Use 2-character indentations (instead of 8 characters).
Rationale: We currently have too much levels of indentation. Using
8-character tabs would make huge code parts unreadable. These need to be
cleaned up before we can switch to 8 characters.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This option was removed in 6b95f7b67dc8e29072fed4e05efa450422661348.
Update the usage message, the man page and the manual accordingly.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the "const" keyword to parameters and variables that are never
modified. Most of these were spotted by "-Wwrite-strings".
We cast the second parameter to execvp() explicitly as it expects a
"char *const[]" where it should expect a "const char *const[]"
(according to the documentation, this is due to compatibility reasons).
This should be changed once we come up with a better solution.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
| |
These functions don't take any parameters, "void" is the right parameter
signature to use here.
Fixes some warnings seen with "-Wstrict-prototypes".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
| |
Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
| |
Fixes a couple of warnings seen with GCC 4.7.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Translated strings returned by gettext() are statically allocated and
shouldn't be modified.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
| |
Add 2012 to the copyright range for all source and documentation files.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
We don't save any configuration nor items if this is set. This should be
used with care, and hence there's no short option for this.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
We used custom_load_conf() to load the configuration file and
io_save_conf() to save configuration. Move these functions, including
all helpers, to a central location.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
| |
This is superseded by custom format strings.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Following long command line options can be used to override the default
format strings:
* --format-apt
* --format-recur-apt
* --format-event
* --format-recur-event
* --format-todo
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Move print_notefile() from "src/args.c" to "src/utils.c".
* Add a "%N" format specifier to print_*(). This invokes
print_notefile() and prints the content of an item's note file.
* src/args.c: Use the new format specifier instead of print_notefile()
everywhere.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This goes in line with the other commits adding print_*() support.
Following format specifiers are allowed:
* p: Print the priority of the item
* m: Print the description of the item
* n: Print the name of the note file belonging to the item
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
| |
Add print_recur_apoint() and print_recur_event() helper functions to
print recurrent items to stdout and use them everywhere. Currently,
these are only wrapper functions to print_apoint() and print_event()
that create temporary, non-recurrent items.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a flexible helper function print_event() and use it whenever we
print events to stdout. This reduces the number of copy-pasted code and
eventually allows for specifying custom format strings.
Following format specifiers are supported:
* m: Print the description of the item
* n: Print the name of the note file belonging to the item
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a flexible helper function print_apoint() and use it whenever we
print appointments to stdout. This reduces the number of copy-pasted
code and eventually allows for specifying custom format strings.
Following format specifiers are supported:
* s: Print the start time of the appointment as UNIX time stamp
* S: Print the start time of the appointment using the "hh:mm" format
* d: Print the duration of the appointment in seconds
* e: Print the end time of the appointment as UNIX time stamp
* E: Print the end time of the appointment using the "hh:mm" format
* m: Print the description of the item
* n: Print the name of the note file belonging to the item
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
| |
This is no longer needed as of commit 2d89d336.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This is one of the few valid use cases for a global variable. No need to
make it pseudo-local and pass it from one function to another.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
No reason to use "return (x);" here. Refer to the GNU coding guidelines
for details. Created using following semantic patch:
@@
expression expr;
@@
- return (expr);
+ return expr;
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use this constant everywhere when referring to a null pointer instead of
casting 0 to various types of pointers. Created using following semantic
patch:
@@
type type;
@@
- (type *)0
+ NULL
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A small style fix that removes all remaining "(void)" casts. Using these
isn't encouraged in GNU coding guidelines and doesn't serve a certain
purpose, except for satisfying a few static code analysis tools. We
already nuked some of these in previous patches, but this semantic patch
should fix what's left:
@@
identifier func;
@@
- (void)func (
+ func (
...);
Long lines were re-formatted manually.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|