emacs-devel
[Top][All Lists]
Advanced

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

Re: Missing entries for Perl in etags-regen-file-extensions -- okay for


From: Dmitry Gutov
Subject: Re: Missing entries for Perl in etags-regen-file-extensions -- okay for emacs-30?
Date: Mon, 23 Sep 2024 19:57:09 +0300
User-agent: Mozilla Thunderbird

On 22/09/2024 08:19, Eli Zaretskii wrote:
Date: Sun, 22 Sep 2024 04:09:22 +0300
Cc: spwhitton@spwhitton.name, emacs-devel@gnu.org
From: Dmitry Gutov <dmitry@gutov.dev>

On 21/09/2024 18:14, Eli Zaretskii wrote:

If you have reservations about some of the extensions, let's exclude
them for now.  I believe there are just a few of them, while the vast
majority should present no problem, right?  I'm okay with leaving out
HTML and Texinfo.  Are there more of those?  TeX, perhaps?

TeX yes. I'm also not sure about PostScript - but really because I still
don't know how a function definition in that language looks, even after
skimming through a manual.

Speaking of other extensions, isn't ".a" usually a compiled library
rather than ASM source code? Also curious about ".t" for Scheme and
".ml" for Lisp.

Fine, let's exclude all of these.  It still leaves quite a lot.

Great! Here's the combined diff I plan to install:

- More extensions.
- case-fold-search bound to t, so extension matching is not case-sensitive.
- string-match-p for etags-regen-ignores entries, minor speed bump.
- *.a removed from the list, though it previously was in it (like discussed in this thread). - *.def and *.inc also not added because I see .def being used for "module definition files", and .inc files sometimes have C-like contents, and sometimes SGML (with ASM in just a few examples). In the mozilla/gecko-dev checkout I tested, that is, to see how the change would affect indexing.

diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el
index a8e67197070..11073c76ac6 100644
--- a/lisp/progmodes/etags-regen.el
+++ b/lisp/progmodes/etags-regen.el
@@ -118,9 +118,13 @@ etags-regen-regexp-alist
 ;; when it cannot determine the type of the file.
 ;; http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00323.html
 (defcustom etags-regen-file-extensions
-  '("rb" "js" "py" "pl" "pm" "el" "c" "cpp" "cc" "h" "hh" "hpp"
-    "java" "go" "cl" "lisp" "prolog" "php" "erl" "hrl"
-    "F" "f" "f90" "for" "cs" "a" "asm" "ads" "adb" "ada")
+  '("ads" "adb" "ada" "asm" "ins" "s" "sa" "S" "src"
+    "c" "h" "c++" "cc" "cpp" "cxx" "h++" "hh" "hpp" "hxx" "m" "pdb"
+    "cs" "hs" "erl" "hrl" "fth" "tok" "f" "f90" "for" "go"
+    "java" "cl" "clisp" "el" "lisp" "lsp" "lua" "lm" "p" "pas"
+    "pl" "pm" "php" "php3" "php4" "pc" "prolog" "py" "rb" "ru" "rbw"
+    "rs" "oak" "rkt" "sch" "scheme" "scm" "sm" "ss"
+    "y" "y++" "ym" "yxx" "yy")
   "Code file extensions for `etags-regen-mode'.

 File extensions to generate the tags for."
@@ -242,11 +246,12 @@ etags-regen--all-files
          (ir-start (1- (length root)))
          (ignores-regexps
           (mapcar #'etags-regen--ignore-regexp
-                  etags-regen-ignores)))
+                  etags-regen-ignores))
+         (case-fold-search t))
     (cl-delete-if
      (lambda (f) (or (not (string-match-p match-re f))
                 (string-match-p "/\\.#" f) ;Backup files.
-                (cl-some (lambda (ignore) (string-match ignore f ir-start))
+ (cl-some (lambda (ignore) (string-match-p ignore f ir-start))
                          ignores-regexps)))
      files)))


WDYT?



reply via email to

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