Package: vim-common
Severity: wishlist
Tags: patch

On Fri, Oct 15, 2010 at 07:25:59AM +0900, tyru wrote:
> today I found interesting program /usr/bin/helpztags
> from output of "dpkg -L vim-common" on Ubuntu.

Which is something provided by the Debian packaging, so I've opened a
bug for you in the BTS to make sure I keep track of the patch.

> so I run it to some of my plugins.
> but helpztags only supports for .txt help file.
> so I wrote the patch to fix it.

Thanks.  Looks useful.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <james...@jamessan.com>
--- helpztags.bak	2010-10-15 07:03:05.000000000 +0900
+++ helpztags	2010-10-15 07:11:35.000000000 +0900
@@ -51,9 +51,9 @@
 foreach $dir (@ARGV) {
   chdir $dir || die "Error: $dir: no such directory\n";
   print "Processing ".$dir."\n";
-  open(TAGSFILE,">tags") || die "Error: Cannot open $dir/tags for writing.\n";
-  foreach $file (<*.{gz,txt}>) {
-    next unless $file =~ m/^[\w.-]+\.txt(?:.gz)?$/;
+  foreach $file (<*.{gz,txt,??x}>) {
+    next unless $file =~ m/^[\w.-]+\.(txt|[a-zA-Z]{2}x)(?:.gz)?$/;
+    $suffix=$1 eq 'txt' ? '' : "-".substr($1, 0, 2);
     do { open(GZ, "zcat $file|") if ($file =~ /\.gz$/) } or open(GZ,$file);
     while (<GZ>) {
         # From vim61/src/ex_cmds.c, lines 5034-5036
@@ -66,8 +66,9 @@
       }
     }
     close(GZ);
+    open(TAGSFILE,">tags$suffix") || die "Error: Cannot open $dir/tags for writing.\n";
+    map { print TAGSFILE "$_\t$tags{$_}\t/*"; s'\\'\\\\'g; s'/'\/'g; print TAGSFILE "$_*\n" } sort keys %tags;
+    close TAGSFILE;
   }
-  map { print TAGSFILE "$_\t$tags{$_}\t/*"; s'\\'\\\\'g; s'/'\/'g; print TAGSFILE "$_*\n" } sort keys %tags;
-  close TAGSFILE;
   chdir $startdir;
 }

Attachment: signature.asc
Description: Digital signature

Reply via email to