1095 Commits

Author SHA1 Message Date
Lukas Fleischer
7e61b3de06 Add child_wait() function
Can be used to wait for the termination of a child process.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:15:36 +02:00
Lukas Fleischer
6e2b00096d Add fork_exec() function
Can be used to execute an external program. Provides the possibility to
optionally create a pipe to the new process.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:15:36 +02:00
Lukas Fleischer
003431880e Make recur_*_write() public
This allows one to serialize and send recurrent items to arbitrary
output streams.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:15:35 +02:00
Lukas Fleischer
3076670a76 Refactor out todo item serialization
Add a todo_write() function that allows one to serialize todo items and
write serialized data to an output stream in a fashion similar to
apoint_write() and event_write().

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:15:35 +02:00
Lukas Fleischer
29d71935af doc/manual.txt: Remove note on missing UTF-8 support
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:09:18 +02:00
Lukas Fleischer
b3afd7e15f TODO: Remove UTF-8 support from TODO list
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:09:18 +02:00
Lukas Fleischer
496f0d98f8 utf8_width() performance improvements
* Sort character width lookup table by character ranges.

* Use binary search instead of linear search for UTF-8 character width
  lookups which will speed up utf8_width() (O(log n) instead of O(n)).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:09:18 +02:00
Lukas Fleischer
33ce6cd8f8 Avoid segfault in getstr_fixscr()
Avoid a segfault that may occur if getstr_fixscr() changes the scroll
offset to something outside the input boundaries (e.g. if a word that is
only partly visible is killed via backward-kill-word).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:09:17 +02:00
Lukas Fleischer
e85501e5ef Use constant for maximum UTF-8 character size
Introduce a UTF8_MAXLEN constant instead of using the literal value "6"
at various places.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:09:13 +02:00
Lukas Fleischer
c8029a5a13 Refactor getstring code
* Rename static showstring() function to getstr_print(), rename
  ins_char() to getstr_ins_char() and del_char() to getstr_del_char().

* Refactor out getstring data structure initialization and window
  scrolling routines.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:08:46 +02:00
Lukas Fleischer
c4246779ff Make display_todo_item() UTF-8 compatible
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:08:46 +02:00
Lukas Fleischer
c8a745fe23 Make display_item() UTF-8 compatible
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 18:48:47 +02:00
Lukas Fleischer
39d2671495 Make getstring() UTF-8 compatible
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:43:44 +02:00
Lukas Fleischer
edc20ba443 Split line editing functions into separate file
Move getstring() related stuff into a separate file as a first step on
our way to UTF-8 support for line editing helpers.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:43:44 +02:00
Lukas Fleischer
271457b7a4 Add basic UTF-8 helper functions
Add utf8_width() and utf8_strwidth() which can be used to calculate the
display width of a single character or a string, respectively. A lookup
table is used to spot double width characters, as well as composing
characters. There currently isn't any code to deal with ambigious
characters.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:43:44 +02:00
Lukas Fleischer
7f5fc0c62f src/calcurse.h: Add UTF-8 related macros
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:43:44 +02:00
Lukas Fleischer
470f05cd38 Enable arrow key navigation by default
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:40:38 +02:00
Lukas Fleischer
585ed53748 doc/manual.txt: Document backward-kill-word
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:40:31 +02:00
Lukas Fleischer
0827e00247 Handle resize properly in the sidebar config menu
There used to be no resize handler in custom_sidebar_config() which
resulted in a messed up screen if the terminal was resized during
sidebar configuration. Doing a simple wins_reset() if the terminal was
resized works around this problem.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:21:05 +02:00
Lukas Fleischer
bc2bead505 Do not try to display items with negative width
Don't display anything rather than segfault if the appointment panel
becomes too small (e.g. during a terminal resize).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-28 18:28:21 +02:00
Lukas Fleischer
6c6c7d5ec0 Always work with new window dimensions on resize
This one came up after improving resizing behaviour in commit
fec37db06bbbdff79bc9816046a76e0b29e173b4. We used to use outdated width
and height values at various places without noticing it due to the
resize algorithm being called several times on every resize.

This patch ensures we retrieve the new window dimensions *before* doing
any layout calculations.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-28 18:27:52 +02:00
Lukas Fleischer
fec37db06b Avoid redundant redraws on resize
Use a global flag to record whether the terminal was resized instead of
redrawing everything each time a KEY_RESIZE is read.

Add some additional checks to help_write_pad() as invalid actions may be
passed now due to using signals instead of virtual key presses.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-28 18:22:43 +02:00
Lukas Fleischer
6636232bc7 doc/Makefile.am: Fix "--without-asciidoc"
Do not try to distribute man page and manual files if documentation
generation is disabled.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-20 19:01:30 +02:00
Lukas Fleischer
9c3a8a5a49 src/llist.c: Use stable insertion algorithm
Ensure the relative order of elements with equal keys is maintained when
inserting into a sorted list.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-20 19:01:30 +02:00
Lukas Fleischer
b2645847a0 Fix whitespace issues
Strip trailing whitespaces in all source files.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-09 21:37:22 +02:00
Lukas Fleischer
4e6e3a9c97 src/utils.c: Make bell() static
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-07 09:33:50 +02:00
Lukas Fleischer
3cd5c1d738 Release 2.9.0.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:48:24 +02:00
Lukas Fleischer
ee369c596f build-aux/git-version-gen: Ignore timestamps.
Do not declare the working tree dirty if only a timestamp has changed.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:46:34 +02:00
Lukas Fleischer
c61a63a46d Add version information to distribution tarball.
We somehow forgot this when adding Git version string support in commit
c5e4187590f37e9524a8e3fcb2bccb20f2e8b4eb.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:25:13 +02:00
Lukas Fleischer
f3e3020104 README: Add missing translators.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:25:13 +02:00
Lukas Fleischer
79deaaac35 Translation updates from Transifex.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:25:07 +02:00
Lukas Fleischer
6d2b7bd497 .tx/config: Add EOL character to the last line.
Be a little more consistent here.

Also, transifex-client will automatically add a newline character to the
last line of its config file unless it is already there.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-18 20:37:03 +02:00
Lukas Fleischer
0f03e80d03 Add missing llist header files to "_SOURCES".
We forgot to add those to the "_SOURCES" variable in commit
0eb1da8dd7fa3ae9d95e12df6058fb41a5ec1c11 and
d668963e2056027526374098efe2869a0d389b92. Spotted by `make distcheck`.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-17 10:16:32 +02:00
Lukas Fleischer
35ade5bf96 Add iCalendar keywords TODO entry.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 07:52:47 +02:00
Lukas Fleischer
38865b8e48 Update copyright notices in source files, documentation and "COPYING".
* Update copyright dates (use 2004-2011 as date range everywhere).

* Change copyright holder from "Frederic Culot" to "calcurse Development
  Team".

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 07:26:05 +02:00
Lukas Fleischer
c9db3b7db7 TODO overhaul.
* Use AsciiDoc style formatting.

* Fix some wording. Use "we" instead of "I" and "us" instead of "me".

* Update mail addresses.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:51:27 +02:00
Lukas Fleischer
bd0be4237c README overhaul.
* Use AsciiDoc style formatting.

* Remove outdated information on the "ChangeLog" file (removed that in
  commit b9fa5bdbb17f507ba756fe38a14d5993e522bb6c).

* Replace references to language specific manual files by
  "doc/manual.html".

* Update author roles.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:51:05 +02:00
Lukas Fleischer
79353a625c Ignore daemon lock file if the daemon process died.
Do this in a fashion similar to what was done in commit
6ff95238766656c5ea9d5c65c35d3aef93499f60.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:38 +02:00
Lukas Fleischer
ddd0cb21fa Be a bit more fail-safe in "build-aux/git-version-gen".
The existence of a ".git" directory is not a sufficient condition to be
sure we are in a Git repository. Only overwrite the version information
file if `git describe` returns a non-empty string.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:38 +02:00
Lukas Fleischer
621b335179 Return -1 in io_file_is_empty() if file cannot be accessed.
Ensure files don't appear as empty if fopen() fails (e.g. on temporary
EACCES failures).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:38 +02:00
Lukas Fleischer
371f20e631 Documentation Makefile overhaul.
* Add documentation input and output files to distribution tarballs.

* Use a more generic rule to generate man pages instead of the hardcoded
  "calcurse.1" target.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:38 +02:00
Lukas Fleischer
c5e4187590 Add Git version string support.
Introduce a script to auto-generate version strings. Use `git describe`
to create descriptive version strings when building from a Git checkout,
use ".version" files for release tarballs.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:37 +02:00
Lukas Fleischer
cbd66b13b1 Use "event" structure when iterating over events in app_arg().
Regression introduced in commit
5b174ba5d46c256f41c1cfb952d46f49a088db8a.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:37 +02:00
Lukas Fleischer
20c84c3003 Add comments to linked list functions.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:37 +02:00
Lukas Fleischer
112fbe00a4 llist.c: Nullify pointers after free()'ing.
* Set all data members to "NULL" in llist_free_inner() after freeing
  them. Altough we normally shouldn't continue working with a list that
  already went through llist_free_inner(), this will protect against
  dangling pointer bugs in case anyone will ever come up with the idea
  of doing so.

* Set list head to "NULL" in llist_free(), basically to put the list
  into an initialized state.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:36 +02:00
Lukas Fleischer
fb5f9d0155 Use generic lists for recurring item exceptions.
Rename "days" structure to "excp" which seems to be a better name here.
Use generic linked lists of excp structures instead of using the "days"
structure which again contains a linked list implementation. Do some
cleanups and invocation fixes.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:36 +02:00
Lukas Fleischer
0ad23c7a8f Remove "next" member from "recur_apoint" structure.
Field seems to be unused. Verify using following spatch:

----
@@ struct recur_apoint *rapt; @@

* rapt->next
----

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:36 +02:00
Lukas Fleischer
9fab24818a Use generic lists for recurring apointments and events.
Use them instead of "recur_apoint_list" and "next" pointers in
"recur_event" type variables. Includes some code simplifications and
cleanups.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:35 +02:00
Lukas Fleischer
2438470fd3 Add recur_apoint_inday() and recur_event_inday().
To be used with llist_fn_match_t callbacks later.

I feel a bit ill adding those functions. This definitely is a hack.
Ultimately, there should be some generic recur_item_inday() function
that accepts both recurring apointments and events (or some wrapper
structure) instead of parameter galeere. This is not the right place to
fix that tho.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:35 +02:00
Lukas Fleischer
153c638d1d Use generic lists for generic day items.
Use the new generic list implementation instead of "next" pointers in
day_item type variables. Includes some cleanups and fixes.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:35 +02:00