Bug 32636

Summary: Improved less powered by GLOBAL.
Product: Base System Reporter: shigio <shigio>
Component: binAssignee: ps
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-RELEASE   
Hardware: Any   
OS: Any   

Description shigio 2001-12-09 04:00:02 UTC
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'.

Fix: 

Above patch is available at:

	http://www.tamacom.com/unix/less-358+gtags.tar.gz
How-To-Repeat: 	N/A
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2001-12-10 11:29:13 UTC
State Changed
From-To: open->closed

The less supplied with FreeBSD is GNU less, and is maintained outside the  
FreeBSD src tree (which is why it's in src/contrib). 

Please liase with the GNU less maintainer to arrange for your patches to 
be incorporated into the vendor distribution so that we  can pick up 
the changes the next time we update the version in src/contrib/less. 

More information on contactin the vendor: 

http://www.greenwoodsoftware.com/less/
Comment 2 shigio 2001-12-29 12:37:41 UTC
Hi,
> Please liase with the GNU less maintainer to arrange for your patches to 
>       be incorporated into the vendor distribution so that we  can pick up 
>       the changes the next time we update the version in src/contrib/less. 

Thank you for your advice.

Now, less-371, which includes my patch, is available.
Please see:
http://www.greenwoodsoftware.com/less/ 

Thanks.
--
Shigio Yamaguchi - Tama Communications Corporation
Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 2001-12-29 23:45:39 UTC
State Changed
From-To: closed->open

Patches incorporated into distribution, new version available. 


Comment 4 Sheldon Hearn freebsd_committer freebsd_triage 2001-12-29 23:45:39 UTC
Responsible Changed
From-To: freebsd-bugs->ps

Paul maintains contrib/less
Comment 5 ps freebsd_committer freebsd_triage 2002-01-07 21:07:23 UTC
State Changed
From-To: open->closed

its in -current now.  will MFC in a few weeks