GLOBAL patch for less. Shigio Yamaguchi 2000/12/14 modified by Shigio Yamaguchi 2001/1/14 You can use GLOBAL from less viewer with this patch. You need less-358. % cd less-358 % patch < less-358+gtags.diff This patch enables the following facilities: o Support multi tag New less supports following tag files: Traditional tags by ctags. Extended tags by Exuberant Ctags GLOBAL's tag by global. Ctags -x format from stdin. User can specify tag file by the -T option. By default, Tag file name is "tags". But if the file is not found then new less use GTAGS. % ls tags tags % less -t main -- tag file is 'tags' (default) % less -TGTAGS -t main -- use GTAGS % ctags -x *.c | less -T- -- use ctags -x format from stdin % ls tags ls: tags: No such file or directory % less -t main -- use GTAGS About GLOBAL's tag, GTAGS, GRTAGS, GSYMS and GPATH are available as tag file name. User must not specify the path (GLOBAL locate the path instead of you.) About ctags -x format, both of standard and extended format are supported. [standard format] +------------------------------------------------ |main 30 main.c main(argc, argv) |func 21 subr.c func(arg) The following commands write this format. o Traditinal Ctags with -x option o Global with -x option [extended format] +---------------------------------------------------------- |main function 30 main.c main(argc, argv) |func function 21 subr.c func(arg) Exuberant Ctags with -x option write this format. See Following usages are available with this facility. % global -xg 'lseek(.*)' | less -T- # grep(1) needed. % global -xI func | less -T- # id-utils(1) needed. % ctags -x func | less -T- o Support duplicated tag News less also supports duplicated tag entries. This facility is supported in all tag files. In traditional tag file, it is treated special case that tag is only one. At first, less shows the first tag. User can move to the next or previous entry by 't'(next) and 'T'(previous) command. 't' go to the next entry 'T' go to the previous entry o Rare case spec If user invoke examin command while tag structure loaded, less cleanup tag structure leaving ifile structure. (1) % less -t main ... [lessecho.c (tag 1 of 4)] <- 4 tags found. currently lessecho.c loaded. (2) Examine: edit.c <- examine 'edit.c' (3) ... [edit.c (file 2 of 2)] <- insert edit.c in ifile structure. (4) t <- go to next tag [No next tag (press RETURN)] <- no tag structure If user use stdin as tag file (by -T- option) and invoke ':t' command in less then less use default tag file, that is, 'tags'.