Re: [PATCH] gitweb: move highlight config out of guess_file_syntax()
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jul 26, 2010, 20:48 UTC
- Message-ID
- <201007262248.35341.jnareb@gmail.com>
- In-Reply-To
- <4C4CCE60.1080301@mit.edu>
On Mon, 26 Jul 2010, Alejandro R. Sedeño wrote:
> On 7/25/2010 7:35 PM, Jakub Narębski wrote:
Show 19 quoted lines
> > BTW. is this something _you_ needed (and what did you need to configure
> > / to put in $GITWEB_CONFIG file), or just a generalization?
>
>
> This is something I was using in previous versions of gitweb, though
> with the older (pre-592ea41) syntax. (I had applied the older
> highlighting patches, and was quite happy to see them merged.)
>
> Before, $GITWEB_CONFIG contained lines like:
>
> $highlight_type{'\.lisp$'} = 'lisp';
>
> As of 1.7.2, with syntax highlighting merged and refactored (592ea41),
> access to the hashes that define syntax highlighting mappings was lost.
> Moving the hashes out into the config area lets $GITWEB_CONFIG contain
> lines like:
>
> $highlight_ext{'lisp'} = 'lisp';
> $highlight_basename{'GNUmakefile'} = 'mak';O.K., I don't think we want to put all possible languages that 'highlight' supports in %highlight_ext, so you might want to add support for less common languages, or languages introduced in newer versions of tool.
Note that you can write here
$highlight_basename{'GNUmakefile'} = 'make';which might be slightly more readable.
-- Jakub Narebski Poland