help-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Allow wildcards in skip lists


From: Arne Jørgensen
Subject: Allow wildcards in skip lists
Date: Thu, 13 Feb 2014 21:02:01 +0100
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3 (darwin)

Hi,

On my wish list for GNU Global I have being able to add wildcards in
skips lists.

Emacs' flymake-mode creates temporary copies of files by adding
`_flymake' before the the file extension. I.e. a temporary copy of
`my-code.php' is named `my-code_flymake.php'. So adding `*_flymake.*` to
the skip list will ensured that the file is not indexed by gtags.

I have created a very simple patch that turns `*' in the skip list into
`.*' in the regular expression instead of escaping it.

Kind regards,
Arne Jørgensen

Index: libutil/find.c
===================================================================
RCS file: /sources/global/global/libutil/find.c,v
retrieving revision 1.91
diff -u -r1.91 find.c
--- libutil/find.c      13 Oct 2012 07:01:33 -0000      1.91
+++ libutil/find.c      13 Feb 2014 08:10:21 -0000
@@ -275,7 +275,9 @@
                } else {
                        strbuf_putc(reg, '/');
                        for (q = skipf; *q; q++) {
-                               if (isregexchar(*q))
+                               if (*q == '*')
+                                       strbuf_putc(req, '.');
+                               else if (isregexchar(*q))
                                        strbuf_putc(reg, '\\');
                                strbuf_putc(reg, *q);
                        }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]