From owner-freebsd-cvsweb@FreeBSD.ORG Thu May 1 08:50:33 2003 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9DD0C37B405 for ; Thu, 1 May 2003 08:50:33 -0700 (PDT) Received: from smtp2.pp.htv.fi (smtp2.pp.htv.fi [213.243.153.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E81D43FE0 for ; Thu, 1 May 2003 08:50:32 -0700 (PDT) (envelope-from scop@FreeBSD.org) Received: from posti.pp.htv.fi (posti.pp.htv.fi [212.90.64.50]) by smtp2.pp.htv.fi (Postfix) with ESMTP id 0A3982970AA for ; Thu, 1 May 2003 18:50:31 +0300 (EEST) Received: from cs78129105.pp.htv.fi (cs78129105.pp.htv.fi [62.78.129.105]) by posti.pp.htv.fi (8.11.1/8.11.1) with ESMTP id h41Fq0905142 for ; Thu, 1 May 2003 18:52:00 +0300 (EETDST) From: Ville =?ISO-8859-1?Q?Skytt=E4?= To: freebsd-cvsweb@FreeBSD.org In-Reply-To: <1043873668.27541.215.camel@bobcat.ods.org> References: <6B1DF6EEBA51D31182F200902740436803B24E25@mail-in.comverse.com> <1043873668.27541.215.camel@bobcat.ods.org> Content-Type: text/plain; charset=ISO-8859-1 Organization: FreeBSD Message-Id: <1051804229.4054.51.camel@bobcat.ods.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 01 May 2003 18:50:29 +0300 Content-Transfer-Encoding: 8bit Subject: RE: Syntax color highlighting patch set X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list [restricted posting] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 15:50:33 -0000 On Wed, 2003-01-29 at 22:54, Ville Skyttä wrote: > Thanks Neal, that's an useful feature. However, that's version 3.x > stuff, we're not adding features to 2.x. > > I will take a look next weekend, when I finally plan to land the first > set of template code. Well, it took almost 3 months longer than I thought, but a modified version of Neal's implementation of syntax highlighting with Enscript was just committed into the development version of CVSweb. Thanks, Neal, and sorry for the delay. -- \/ille Skyttä scop at FreeBSD.org From owner-freebsd-cvsweb@FreeBSD.ORG Thu May 1 08:54:51 2003 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 31E3037B401 for ; Thu, 1 May 2003 08:54:51 -0700 (PDT) Received: from smtp2.pp.htv.fi (smtp2.pp.htv.fi [213.243.153.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 721F243FA3 for ; Thu, 1 May 2003 08:54:50 -0700 (PDT) (envelope-from scop@FreeBSD.org) Received: from posti.pp.htv.fi (posti.pp.htv.fi [212.90.64.50]) by smtp2.pp.htv.fi (Postfix) with ESMTP id C68292970AC for ; Thu, 1 May 2003 18:54:49 +0300 (EEST) Received: from cs78129105.pp.htv.fi (cs78129105.pp.htv.fi [62.78.129.105]) by posti.pp.htv.fi (8.11.1/8.11.1) with ESMTP id h41FuJ906501 for ; Thu, 1 May 2003 18:56:19 +0300 (EETDST) From: Ville =?ISO-8859-1?Q?Skytt=E4?= To: freebsd-cvsweb@FreeBSD.org In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-1 Organization: FreeBSD Message-Id: <1051804488.4054.57.camel@bobcat.ods.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 01 May 2003 18:54:48 +0300 Content-Transfer-Encoding: 8bit Subject: Re: Displaying line numbers X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list [restricted posting] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 15:54:51 -0000 On Sat, 2003-04-19 at 23:24, Roy Smith wrote: > We've been using cvsweb for looking at files during code reviews. One > feature it's missing that would be really useful for this application > is being able to display a file with line numbers in the margin. Is > there a way to do this? > > I don't mind diving in and coding it, but I'd rather not reinvent the > wheel if somebody's done it already. I agree, that'd be useful and AFAICT such a feature doesn't exist. I may take a look at this, but contributions are certainly welcome too. In addition to the line numbers, there should be a XX for all lines so that one can point to them using #lXX in URLs. Even better if the line referred to in this way would be somehow highlighted... -- \/ille Skyttä scop at FreeBSD.org From owner-freebsd-cvsweb@FreeBSD.ORG Thu May 1 08:58:21 2003 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 37F7437B401 for ; Thu, 1 May 2003 08:58:18 -0700 (PDT) Received: from smtp1.pp.htv.fi (smtp1.pp.htv.fi [212.90.64.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F43C43F93 for ; Thu, 1 May 2003 08:58:18 -0700 (PDT) (envelope-from scop@FreeBSD.org) Received: from posti.pp.htv.fi (posti.pp.htv.fi [212.90.64.50]) by smtp1.pp.htv.fi (Postfix) with ESMTP id DD5AB80143 for ; Thu, 1 May 2003 18:58:16 +0300 (EEST) Received: from cs78129105.pp.htv.fi (cs78129105.pp.htv.fi [62.78.129.105]) by posti.pp.htv.fi (8.11.1/8.11.1) with ESMTP id h41Fxk907539 for ; Thu, 1 May 2003 18:59:46 +0300 (EETDST) From: Ville =?ISO-8859-1?Q?Skytt=E4?= To: freebsd-cvsweb@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1 Organization: FreeBSD Message-Id: <1051804695.4054.62.camel@bobcat.ods.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 01 May 2003 18:58:16 +0300 Content-Transfer-Encoding: 8bit Subject: Status of things X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list [restricted posting] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 15:58:21 -0000 I know I've been promising to take a look at this and that in FreeBSD for the past couple of months but failed to do so because of other things that have kept me busy. Sorry about that. A couple of months ago, I did an initial HTML::Template'ized version, but have now decided that I won't be developing that or committing into CVS. It just didn't seem to be worth the trouble after all, as the templates became too messy. Hopefully, I'll have more time to look into the recent feature requests and bug reports from now on, keep them coming. Cheers, -- \/ille Skyttä scop at FreeBSD.org From owner-freebsd-cvsweb@FreeBSD.ORG Thu May 1 10:14:16 2003 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F2FEA37B401; Thu, 1 May 2003 10:14:15 -0700 (PDT) Received: from us-wkf-interscan1.comverse.com (us-wkf-fwmain.comverse.com [63.64.185.250]) by mx1.FreeBSD.org (Postfix) with ESMTP id 039B543FB1; Thu, 1 May 2003 10:14:14 -0700 (PDT) (envelope-from Vassilii.Khachaturov@comverse.com) Received: from mail-in.comverse.com (localhost.localdomain [127.0.0.1]) h41GErw20847; Thu, 1 May 2003 12:14:54 -0400 Received: by mail-in.comverse.com with Internet Mail Service (5.5.2653.19) id ; Thu, 1 May 2003 13:08:50 -0400 Message-ID: <6B1DF6EEBA51D31182F200902740436803B24F59@mail-in.comverse.com> From: Khachaturov Vassilii To: "'Ville Skytta'" Date: Thu, 1 May 2003 13:08:49 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" cc: freebsd-cvsweb@freebsd.org Subject: RE: Displaying line numbers X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list [restricted posting] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 17:14:16 -0000 > In addition to the line numbers, there should be a name="lXX">XX > for all lines so that one can point to them using #lXX in URLs. Even agreed > better if the line referred to in this way would be somehow > highlighted... I doubt this is possible. The #id resolution takes place at the browser level, the HTTP query sent to the server doesn't normally include it. From owner-freebsd-cvsweb@FreeBSD.ORG Thu May 1 13:24:20 2003 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C5D2837B401 for ; Thu, 1 May 2003 13:24:20 -0700 (PDT) Received: from smtp3.pp.htv.fi (smtp3.pp.htv.fi [213.243.153.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 092B943FAF for ; Thu, 1 May 2003 13:24:20 -0700 (PDT) (envelope-from scop@FreeBSD.org) Received: from posti.pp.htv.fi (posti.pp.htv.fi [212.90.64.50]) by smtp3.pp.htv.fi (Postfix) with ESMTP id BC69027AF88 for ; Thu, 1 May 2003 23:24:18 +0300 (EEST) Received: from cs78129105.pp.htv.fi (cs78129105.pp.htv.fi [62.78.129.105]) by posti.pp.htv.fi (8.11.1/8.11.1) with ESMTP id h41KPn911315 for ; Thu, 1 May 2003 23:25:49 +0300 (EETDST) From: Ville =?ISO-8859-1?Q?Skytt=E4?= To: freebsd-cvsweb@FreeBSD.org In-Reply-To: <6B1DF6EEBA51D31182F200902740436803B24F59@mail-in.comverse.com> References: <6B1DF6EEBA51D31182F200902740436803B24F59@mail-in.comverse.com> Content-Type: text/plain; charset=ISO-8859-1 Organization: FreeBSD Message-Id: <1051820658.4054.85.camel@bobcat.ods.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 01 May 2003 23:24:18 +0300 Content-Transfer-Encoding: 8bit Subject: RE: Displaying line numbers X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list [restricted posting] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 20:24:21 -0000 On Thu, 2003-05-01 at 20:08, Khachaturov Vassilii wrote: > > In addition to the line numbers, there should be a > name="lXX">XX > > for all lines so that one can point to them using #lXX in URLs. Even > > agreed > > > better if the line referred to in this way would be somehow > > highlighted... > > I doubt this is possible. The #id resolution takes place at the browser > level, > the HTTP query sent to the server doesn't normally include it. Yep. I meant (but failed to note) that I was thinking about doing this in JavaScript, using window.location.hash and dynamically setting the CSS properties for the requested line from the document's onload handler. I think that would work. It might have an impact on the HTML output, possibly requiring a element around each row, or at least extending the to enclose the whole row in order to be simply able to access one object and set its properties. By the way, is there a function/ perl module for getting the number of lines in a file? `wc -l` of course works... I think that would be needed in order to get the line numbers properly left padded with spaces like in 1 [...] 100 [...] Oh, and I have some doubts whether it'll be possible to have the line numbers with the new Enscript-formatted output... need to check it out. We output it line by line so in case enscript emits one line of HTML per one line of source, it could be trivial. -- \/ille Skyttä scop at FreeBSD.org From owner-freebsd-cvsweb@FreeBSD.ORG Thu May 1 14:09:19 2003 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F12F437B407; Thu, 1 May 2003 14:09:18 -0700 (PDT) Received: from us-wkf-interscan1.comverse.com (us-wkf-fwmain.comverse.com [63.64.185.250]) by mx1.FreeBSD.org (Postfix) with ESMTP id 941FF43F3F; Thu, 1 May 2003 14:09:17 -0700 (PDT) (envelope-from Vassilii.Khachaturov@comverse.com) Received: from mail-in.comverse.com (localhost.localdomain [127.0.0.1]) h41K9tA24807; Thu, 1 May 2003 16:09:55 -0400 Received: by mail-in.comverse.com with Internet Mail Service (5.5.2653.19) id ; Thu, 1 May 2003 17:03:54 -0400 Message-ID: <6B1DF6EEBA51D31182F200902740436803B24F5B@mail-in.comverse.com> From: Khachaturov Vassilii To: "'Ville Skytta'" Date: Thu, 1 May 2003 17:03:53 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" cc: freebsd-cvsweb@freebsd.org Subject: RE: Displaying line numbers X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list [restricted posting] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 21:09:19 -0000 > By the way, is there a function/ perl module for getting the number of > lines in a file? `wc -l` of course works... I think that would be > needed in order to get the line numbers properly left padded > with spaces > like in > > 1 > [...] > 100 > [...] There's the mjd-s Tie::File module you might want to look at... From owner-freebsd-cvsweb@FreeBSD.ORG Thu May 1 20:00:16 2003 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B65037B401; Thu, 1 May 2003 20:00:16 -0700 (PDT) Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CCD143F93; Thu, 1 May 2003 20:00:14 -0700 (PDT) (envelope-from roy@panix.com) Received: from panix.com (p67-13.acedsl.com [66.114.67.13]) by mail1.acecape.com (8.12.9/8.12.9) with ESMTP id h4230DAd013757; Thu, 1 May 2003 23:00:13 -0400 Date: Thu, 1 May 2003 23:00:10 -0400 Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) To: Khachaturov Vassilii From: Roy Smith In-Reply-To: <6B1DF6EEBA51D31182F200902740436803B24F5B@mail-in.comverse.com> Message-Id: <303ACB4B-7C4A-11D7-8CCF-0050E405C35A@panix.com> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) cc: freebsd-cvsweb@freebsd.org Subject: Re: Displaying line numbers ($preformat_in_markup) X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list [restricted posting] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2003 03:00:17 -0000 What is the purpose of the $preformat_in_markup variable? Looking at the source, I only see two places it's used. One is in the big "use vars" block near the top of the file, the other is inside cvswebMarkup(): } elsif ($preformat_in_markup) { print "
";

                 # prefetch several lines
                 my @buf = head($filehandle);

                 my %d = scan_directives(@buf);

                 while (@buf || !eof($filehandle)) {
                         $_ = @buf ? shift @buf : <$filehandle>;

                         print spacedHtmlText($_, $d{'tabstop'});
                 }

If it's never mentioned anywhere else in the file, it seems to me that 
it can never be set and this is dead code.  Am I missing something?

From owner-freebsd-cvsweb@FreeBSD.ORG  Thu May  1 23:07:05 2003
Return-Path: 
Delivered-To: freebsd-cvsweb@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7CA8737B401
	for ;
	Thu,  1 May 2003 23:07:05 -0700 (PDT)
Received: from smtp2.pp.htv.fi (smtp2.pp.htv.fi [213.243.153.6])
	by mx1.FreeBSD.org (Postfix) with ESMTP id DDD9743F93
	for ;
	Thu,  1 May 2003 23:07:04 -0700 (PDT)
	(envelope-from scop@FreeBSD.org)
Received: from posti.pp.htv.fi (posti.pp.htv.fi [212.90.64.50])
	by smtp2.pp.htv.fi (Postfix) with ESMTP id 358BE296DA1
	for ;
	Fri,  2 May 2003 09:07:04 +0300 (EEST)
Received: from cs78129105.pp.htv.fi (cs78129105.pp.htv.fi [62.78.129.105])
	by posti.pp.htv.fi (8.11.1/8.11.1) with ESMTP id h4268Z902311
	for ;
	Fri, 2 May 2003 09:08:35 +0300 (EETDST)
From: Ville =?ISO-8859-1?Q?Skytt=E4?= 
To: freebsd-cvsweb@FreeBSD.org
In-Reply-To: <303ACB4B-7C4A-11D7-8CCF-0050E405C35A@panix.com>
References: <303ACB4B-7C4A-11D7-8CCF-0050E405C35A@panix.com>
Content-Type: text/plain; charset=ISO-8859-1
Organization: FreeBSD
Message-Id: <1051855623.4054.130.camel@bobcat.ods.org>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) 
Date: 02 May 2003 09:07:03 +0300
Content-Transfer-Encoding: 8bit
Subject: Re: Displaying line numbers ($preformat_in_markup)
X-BeenThere: freebsd-cvsweb@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: CVS Web maintenance mailing list [restricted posting]
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 02 May 2003 06:07:05 -0000

On Fri, 2003-05-02 at 06:00, Roy Smith wrote:

> If it's never mentioned anywhere else in the file, it seems to me that 
> it can never be set and this is dead code.  Am I missing something?

Take a look at cvsweb.conf...

-- 
\/ille Skyttä
scop at FreeBSD.org


From owner-freebsd-cvsweb@FreeBSD.ORG  Sat May  3 08:27:05 2003
Return-Path: 
Delivered-To: freebsd-cvsweb@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id A9F0F37B401; Sat,  3 May 2003 08:27:05 -0700 (PDT)
Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id E60EC43FBD; Sat,  3 May 2003 08:27:04 -0700 (PDT)
	(envelope-from roy@panix.com)
Received: from panix.com (p67-13.acedsl.com [66.114.67.13])
	by mail1.acecape.com (8.12.9/8.12.9) with ESMTP id h43FR3eT017121;
	Sat, 3 May 2003 11:27:03 -0400
Date: Sat, 3 May 2003 11:27:01 -0400
Content-Type: text/plain; charset=US-ASCII; format=flowed
Mime-Version: 1.0 (Apple Message framework v552)
To: Khachaturov Vassilii 
From: Roy Smith 
In-Reply-To: <6B1DF6EEBA51D31182F200902740436803B24F59@mail-in.comverse.com>
Message-Id: 
Content-Transfer-Encoding: 7bit
X-Mailer: Apple Mail (2.552)
cc: freebsd-cvsweb@freebsd.org
Subject: Re: Displaying line numbers
X-BeenThere: freebsd-cvsweb@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: CVS Web maintenance mailing list [restricted posting]
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 03 May 2003 15:27:05 -0000

On Thursday, May 1, 2003, at 01:08  PM, Khachaturov Vassilii wrote:
>> In addition to the line numbers, there should be a > name="lXX">XX
>> for all lines so that one can point to them using #lXX in URLs.  Even

Well, I finally sat down and looked at the code.  Turns out this is a 
fairly trivial change, at least for a simple version.  Diffs from the 
2.0.6  cvsweb.cgi (the line numbers may be off a little; I left out 
some other, non-related changes).


*** 1943,1952 ****
         } else {
                 print "
";

-               my $lineNumber = 0;
                 while (<$filehandle>) {
-                       $lineNumber++;
-                       printf '%5d:  ', 
$lineNumber, $lineNumber;
                         print htmlquote($_);
                 }
                 print "
"; --- 1941,1947 ---- I didn't worry much about figuring out how many lines the file had. I left room for 5-digit line numbers, which seemed good enough. I guess the next thing would be to add some way to turn the feature on and off. I could see two ways. One would be a static switch in cvsweb.conf, the other would be some sort of control on the "CVS log for xxx" page. Maybe instead of: Revision 1.1 / (download) - annotate - [select for diffs] there could be an additional link: Revision 1.1 (with/without line numbers) / (download) - annotate - [select for diffs], or a checkbox. Maybe the static switch in cvsweb.conf would control the default setting of the checkbox (i.e. by default you get line numbers vs. by default you don't). Any ideas? Left to my own devices, I'm inclined to go with the idea of a checkbox and a cvsweb.conf switch to control the default value.