Add example user-defined commands to the manual

Inspired by GH #121, GH #65 and GH #74.
Add toggle-files to disable file filtering for the diff and main views

Requested by Vincent Scheib.
Restore default signal handlers

This guarantees that the OS can handle further signals if, for example,
endwin() did not return.

Signed-off-by: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Catch SIGQUIT and gracefully exit tig

Ctrl+4 sends a SIGQUIT to tig, which results in printing a
"Quit (core dumped)" message and leaving the console dirty.

This patch catches the signal in order to correctly end the session.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Link to stackoverflow.com/questions/tagged/tig for Q and A

Thanks to Vincent Scheib for arranging and Paul Kinlan for donating his
Stack Overflow karma to create the tag.
main: add toggle for commit title overflow

Many developers and tools use the Git convention for commit titles,
as discussed in the git-commit(1) man page:

  Though not required, it's a good idea to begin the commit message with
  a single short (less than 50 character) line summarizing the change

This patch adds the ability to highlight text exceeding a specified
width in commit titles, through a "title-overflow" option.

As a boolean, it enables/disables the highlighting, with a default value
of 50. As a int, it enables and uses the value as the maximum width for
a title to be considered short.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Minor improvement of the option description.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Refactor commit title drawing to expand text and make it reusable
Rename the title-overflow color to overflow
Highlight commit title overflow in the diff view
Add +ESC key binding

Example:
bind generic ^[v move-page-up

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
[#102] Revert 40868f7 which breaks blame and pickaxe support for follow

The commit breaks `tig blame --follow tig.c` and `tig -Sfoo --follow`.
Fix diff title overflow rendering to use view specific flag
Update documentation as regards color specification using bare numbers

The change in the set_color function that allows colors to be specified by
numbers (like in Git) was done in commit 54e8c4d2, but the documentation
has not been updated accordingly.

Fixes GH #129
[ jf: minor rewording ]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Build with curses.h when using the default Mac OS X make configuration
Add a ".." entry if tig is used on an empty path in tree view.

Without this change it was impossible to leave an empty directory in tree view
if you started tig inside an empty directory in the working tree.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Move argument formatting to separate function
Format diff and blame arguments
Rename format_arg => format_expand_arg
Append the argument in format_expand_arg
Introduce format_context struct to simplify argument passing