Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Dec 2001 12:51:52 +0900 (JST)
From:      shigio@tamacom.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/32636: Improved less powered by GLOBAL.
Message-ID:  <200112090351.fB93pqo00851@tamacom.com>

next in thread | raw e-mail | index | archive | help

>Number:         32636
>Category:       bin
>Synopsis:       Improved less powered by GLOBAL.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 08 20:00:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Shigio Yamaguchi
>Release:        FreeBSD 4.3-RELEASE i386
>Organization:
Tama Communications Corporation
>Environment:
System: FreeBSD choota.signet.or.jp 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Thu Jul 5 11:01:05 JST 2001 shigio@choota.signet.or.jp:/usr/src/sys/compile/GENERIC i386


>Description:

I have made a patch for less-358. It support following facilities:

o Support multi tag

  Improved less supports following tag files:
	Traditional tags by ctags.
	Extended tags by Exuberant Ctags <http://ctags.sourceforge.net>;
	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]
	<tag>   <lineno>  <file>         <image>
	+------------------------------------------------
	|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]
	<tag>   <type>  <lineno>   <file>        <image>
	+----------------------------------------------------------
	|main     function 30      main.c         main(argc, argv)
	|func     function 21      subr.c         func(arg)

	Exuberant Ctags with -x option write this format.
	See <http://ctags.sourceforge.net>;

  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

  Improved 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'.

>How-To-Repeat:
	N/A
>Fix:

	Above patch is available at:

	http://www.tamacom.com/unix/less-358+gtags.tar.gz


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112090351.fB93pqo00851>