From 16bda3aa4443fe29a3310bc682cfe9aad9ae54b5 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 4 Feb 2009 23:20:31 +0100 Subject: [PATCH] Spell check all text files and add dictionary to speed it up --- INSTALL | 2 +- Makefile | 6 +- NEWS | 4 +- TODO | 2 +- contrib/aspell.dict | 146 ++++++++++++++++++++++++++++++++++++++++++++ manual.txt | 11 ++-- tig.1.txt | 5 +- tig.c | 41 ++++++------- tigrc.5.txt | 2 +- 9 files changed, 180 insertions(+), 39 deletions(-) create mode 100644 contrib/aspell.dict diff --git a/INSTALL b/INSTALL index 3f6ff92..7759326 100644 --- a/INSTALL +++ b/INSTALL @@ -24,7 +24,7 @@ need to first make the configure script: $ make configure Release notes documenting notable changes are available in the NEWS file. When -upgrading, you are adviced to also read them after you have completed the +upgrading, you are advised to also read them after you have completed the installation. The following tools and packages are needed: diff --git a/Makefile b/Makefile index 33ef7b8..252d1b7 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,7 @@ LDLIBS ?= -lcurses CFLAGS ?= -Wall -O2 DFLAGS = -g -DDEBUG -Werror -O0 PROGS = tig +TXTDOC = tig.1.txt tigrc.5.txt manual.txt NEWS README INSTALL BUGS TODO MANDOC = tig.1 tigrc.5 HTMLDOC = tig.1.html tigrc.5.html manual.html README.html NEWS.html ALLDOC = $(MANDOC) $(HTMLDOC) manual.html-chunked manual.pdf @@ -104,7 +105,10 @@ distclean: clean $(RM) config.h config.log config.make config.status config.h.in spell-check: - aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt + for file in $(TXTDOC) tig.c; do \ + aspell --lang=en --dont-backup \ + --personal=./contrib/aspell.dict check $$file; \ + done strip: $(PROGS) strip $(PROGS) diff --git a/NEWS b/NEWS index ceb0290..bd7d6c4 100644 --- a/NEWS +++ b/NEWS @@ -99,7 +99,7 @@ Improvements: - Stage view: add stage-next action to jump to next diff chunk that can be staged. By default bound to '@'. - Configure: check for the ncurses header files. - - Add author-width option to costumize the width of the author column. + - Add author-width option to customize the width of the author column. For example, put the following in ~/.tigrc: set author-width = 10 Bug fixes: @@ -153,7 +153,7 @@ Improvements: Bug fixes: - - Fix UTF8 handling for tag names and commit messages. + - Fix UTF-8 handling for tag names and commit messages. - Fix the check for git-config(1) in configure to handle the case when git has been installed using a libexecdir which is not in the path. - Fix replacing of SYSCONFDIR when installing from released tarballs. diff --git a/TODO b/TODO index 2790840..2ae71df 100644 --- a/TODO +++ b/TODO @@ -23,7 +23,7 @@ Before tig-1.0 Other revgraph improvements: - Show from which branch heads and tags a commit is reachable, and - perhaps which tag is the latests among the ones reachable from + perhaps which tag is the latest among the ones reachable from that commit, as part of the diff view. How should rewritten parent information be handled? Depends on new enhanced commit structure. diff --git a/contrib/aspell.dict b/contrib/aspell.dict new file mode 100644 index 0000000..7a28da9 --- /dev/null +++ b/contrib/aspell.dict @@ -0,0 +1,146 @@ +personal_ws-1.1 en 145 +docbook +DocBook +xpm +oldmode +libiconv +whitespace +VLINE +README +keybindings +lrwxrwxrwx +waddnstr +startup +refspec +XSL +cd +stderr +getch +SHA +errno +nodelay +COLORTERM +AuthorDate +CJK +subdirectory +Fullwidth +xrvt +config +mergetool +subshells +cmd +keymap +committer +lds +gc +dev +unstaged +ifdef +revgraph +DSSL +FIXME +frontend +acked +untracked +subdirectories +jsh +ncurses +newmode +reachability +unstanged +subcommand +tig +bool +Scrool +multi +ld +autoreconf +Cogito +ident +namespace +xhtml +PageDown +repo +Debian +diffstat +Nn +Online +ACDMRTXB +keymaps +filename +cdate +gitlink +fgcolor +tigrc +unmerged +stdout +lineno +AsciiDoc +asciidoc +PgUp +endif +contrib +delim +unstage +wclear +CommitDate +manpages +waitpid +libexecdir +UI +manpage +XXXXXX +autoconf +Jamo +PDF +bgcolor +tz +sysconfdir +tty +subdir +TODO +Yi +cacheinfo +cdup +UTF +combi +resize +filesystem +signoff +nowarn +tigblob +ELinks +waddch +Yy +xmlto +backgrounded +stdin +ifndef +drwxr +distclean +commitencoding +PgDown +NUL +qgit +struct +aterm +ncursesw +gitk +unicode +backend +subtrees +keybinding +Fonseca +wgetch +rwxr +Baudis +chunked +Makefile +wrt +subcommands +adate +iconv +topo +Pre +PageUp +tig's diff --git a/manual.txt b/manual.txt index 25bc396..b6c4db5 100644 --- a/manual.txt +++ b/manual.txt @@ -407,10 +407,10 @@ Searching `-------`-------------------------------------------------------------------- Key Action ----------------------------------------------------------------------------- -/ Search the view. Opens a prompt for entering search regex to use. -? Search backwards in the view. Also prompts for regex. -n Find next match for the current search regex. -N Find previous match for the current search regex. +/ Search the view. Opens a prompt for entering search regexp to use. +? Search backwards in the view. Also prompts for regexp. +n Find next match for the current search regexp. +N Find previous match for the current search regexp. ----------------------------------------------------------------------------- [[misc-keys]] @@ -443,7 +443,7 @@ External Commands For more custom needs, external commands provide a way to easily execute a script or program. They are bound to keys and use information from the current browsing state, such as the current commit ID. Tig comes with -the following builtin external commands: +the following built-in external commands: `-------`-------------------------------------------------------------------- Key Action @@ -600,4 +600,3 @@ Other git repository browsers: - gitk(1) - qgit(1) - - gitview(1) diff --git a/tig.1.txt b/tig.1.txt index 1088861..fcbcc61 100644 --- a/tig.1.txt +++ b/tig.1.txt @@ -95,7 +95,7 @@ ENVIRONMENT VARIABLES In addition to environment variables used by git (e.g. GIT_DIR), tig defines the ones below. The command related environment variables have access to the -internal state of tig via replacement variabls, such as `%(commit)` and +internal state of tig via replacement variables, such as `%(commit)` and `%(blob)`. See manpage:tigrc[5] for a full list. TIGRC_USER:: @@ -160,8 +160,7 @@ the Free Software Foundation; either version 2 of the License, or SEE ALSO -------- -manpage:tigrc[5], git(7), cogito(7), as well as other git repository browsers: -gitk(1), qgit(1), gitview(1). +manpage:tigrc[5], git(7), gitk(1) Online resources: diff --git a/tig.c b/tig.c index d875b0e..ce406c8 100644 --- a/tig.c +++ b/tig.c @@ -121,7 +121,7 @@ static size_t utf8_length(const char **string, size_t col, int *width, size_t ma #define GIT_CONFIG "config" #endif -/* Some ascii-shorthands fitted into the ncurses namespace. */ +/* Some ASCII-shorthands fitted into the ncurses namespace. */ #define KEY_TAB '\t' #define KEY_RETURN '\r' #define KEY_ESC 27 @@ -1391,7 +1391,7 @@ static int config_lineno; static bool config_errors; static const char *config_msg; -/* Wants: object fgcolor bgcolor [attr] */ +/* Wants: object fgcolor bgcolor [attribute] */ static int option_color_command(int argc, const char *argv[]) { @@ -1511,7 +1511,7 @@ option_set_command(int argc, const char *argv[]) int arglen = strlen(arg); switch (arg[0]) { - case '"': + case '\"': case '\'': if (arglen == 1 || arg[arglen - 1] != arg[0]) { config_msg = "Unmatched quotation"; @@ -1656,7 +1656,7 @@ load_option_file(const char *path) { struct io io = {}; - /* It's ok that the file doesn't exist. */ + /* It's OK that the file doesn't exist. */ if (!io_open(&io, path)) return; @@ -1745,7 +1745,7 @@ struct view { /* Searching */ char grep[SIZEOF_STR]; /* Search string */ - regex_t *regex; /* Pre-compiled regex */ + regex_t *regex; /* Pre-compiled regexp */ /* If non-NULL, points to the view that opened this view. If this view * is closed tig will switch back to the parent view. */ @@ -1784,7 +1784,7 @@ struct view_ops { bool (*draw)(struct view *view, struct line *line, unsigned int lineno); /* Depending on view handle a special requests. */ enum request (*request)(struct view *view, enum request request, struct line *line); - /* Search for regex in a line. */ + /* Search for regexp in a line. */ bool (*grep)(struct view *view, struct line *line); /* Select line */ void (*select)(struct view *view, struct line *line); @@ -3781,14 +3781,11 @@ push_tree_stack_entry(const char *name, unsigned long lineno) /* Parse output from git-ls-tree(1): * - * 100644 blob fb0e31ea6cc679b7379631188190e975f5789c26 Makefile - * 100644 blob 5304ca4260aaddaee6498f9630e7d471b8591ea6 README * 100644 blob f931e1d229c3e185caad4449bf5b66ed72462657 tig.c - * 100644 blob ed09fe897f3c7c9af90bcf80cae92558ea88ae38 web.conf */ #define SIZEOF_TREE_ATTR \ - STRING_SIZE("100644 blob ed09fe897f3c7c9af90bcf80cae92558ea88ae38\t") + STRING_SIZE("100644 blob f931e1d229c3e185caad4449bf5b66ed72462657\t") #define SIZEOF_TREE_MODE \ STRING_SIZE("100644 ") @@ -4064,7 +4061,7 @@ tree_request(struct view *view, enum request request, struct line *line) switch (line->type) { case LINE_TREE_DIR: - /* Depending on whether it is a subdir or parent (updir?) link + /* Depending on whether it is a subdirectory or parent link * mangle the path buffer. */ if (line == &view->line[1] && *opt_path) { pop_tree_stack_entry(); @@ -4652,8 +4649,8 @@ status_run(struct view *view, const char *argv[], char status, enum line_type ty if (!buf) break; - /* Collapse all 'M'odified entries that follow a - * associated 'U'nmerged entry. */ + /* Collapse all modified entries that follow an + * associated unmerged entry. */ if (unmerged == file) { unmerged->status = 'U'; unmerged = NULL; @@ -5992,15 +5989,11 @@ static struct view_ops main_ops = { /* * Unicode / UTF-8 handling * - * NOTE: Much of the following code for dealing with unicode is derived from + * NOTE: Much of the following code for dealing with Unicode is derived from * ELinks' UTF-8 code developed by Scrool . Origin file is - * src/intl/charset.c from the utf8 branch commit elinks-0.11.0-g31f2c28. + * src/intl/charset.c from the UTF-8 branch commit elinks-0.11.0-g31f2c28. */ -/* I've (over)annotated a lot of code snippets because I am not entirely - * confident that the approach taken by this small UTF-8 interface is correct. - * --jonas */ - static inline int unicode_width(unsigned long c) { @@ -6038,7 +6031,7 @@ static const unsigned char utf8_bytes[256] = { 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4, 5,5,5,5,6,6,1,1, }; -/* Decode UTF-8 multi-byte representation into a unicode character. */ +/* Decode UTF-8 multi-byte representation into a Unicode character. */ static inline unsigned long utf8_to_unicode(const char *string, size_t length) { @@ -6079,7 +6072,7 @@ utf8_to_unicode(const char *string, size_t length) unicode += (string[5] & 0x3f); break; default: - die("Invalid unicode length"); + die("Invalid Unicode length"); } /* Invalid characters could return the special 0xfffd value but NUL @@ -6117,7 +6110,7 @@ utf8_length(const char **start, size_t skip, int *width, size_t max_width, int * * it is a single- or double-width character. */ unicode = utf8_to_unicode(string, bytes); - /* FIXME: Graceful handling of invalid unicode character. */ + /* FIXME: Graceful handling of invalid Unicode character. */ if (!unicode) break; @@ -6244,7 +6237,7 @@ init_display(void) if (!cursed) die("Failed to initialize curses"); - nonl(); /* Tell curses not to do NL->CR/NL on output */ + nonl(); /* Disable conversion and detect newlines from input. */ cbreak(); /* Take input chars one at a time, no wait for \n */ noecho(); /* Don't echo input */ leaveok(stdscr, FALSE); @@ -6562,7 +6555,7 @@ read_ref(char *id, size_t idlen, char *name, size_t namelen) } if (check_replace && !strcmp(name, refs[refs_size - 1].name)) { - /* it's an annotated tag, replace the previous sha1 with the + /* it's an annotated tag, replace the previous SHA1 with the * resolved commit id; relies on the fact git-ls-remote lists * the commit id of an annotated tag right before the commit id * it points to. */ diff --git a/tigrc.5.txt b/tigrc.5.txt index 149fcd7..ff0613d 100644 --- a/tigrc.5.txt +++ b/tigrc.5.txt @@ -262,7 +262,7 @@ Scrolling: ------------------------------------------------------------------------------ scroll-line-up Scroll one line up scroll-line-down Scroll one line down -scroll-page-eup Scroll one page up +scroll-page-up Scroll one page up scroll-page-down Scroll one page down scroll-left Scroll one column left scroll-right Scroll one column right -- 2.32.0.93.g670b81a890