aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2024-09-23 21:35:00 +0300
committerDmitry Gutov2024-09-23 21:35:19 +0300
commit32d0c8f6af52cd8db363456d817c3d214eea4c00 (patch)
tree863e8ae7ee141971f18369eb07bbd982f81bcd32
parent8f265b49e3d3b4403ab0cdd4a5b94d2e335297cb (diff)
downloademacs-32d0c8f6af52cd8db363456d817c3d214eea4c00.tar.gz
emacs-32d0c8f6af52cd8db363456d817c3d214eea4c00.zip
etags-regen-file-extensions: Enable for more extensions
* lisp/progmodes/etags-regen.el (etags-regen-file-extensions): Add more extensions, but remove "a". From the ones recognized by etags, also omit "t", "ml", "l", "def" and "inc", see https://lists.gnu.org/archive/html/emacs-devel/2024-09/msg00735.html. (etags-regen--all-files): Use 'string-match-p' for performance. Bind 'case-fold-search' to t to match extensions in any case.
-rw-r--r--lisp/progmodes/etags-regen.el15
1 files changed, 10 insertions, 5 deletions
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 @@ We currently support only Emacs's etags program with this option."
118;; when it cannot determine the type of the file. 118;; when it cannot determine the type of the file.
119;; http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00323.html 119;; http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00323.html
120(defcustom etags-regen-file-extensions 120(defcustom etags-regen-file-extensions
121 '("rb" "js" "py" "pl" "pm" "el" "c" "cpp" "cc" "h" "hh" "hpp" 121 '("ads" "adb" "ada" "asm" "ins" "s" "sa" "S" "src"
122 "java" "go" "cl" "lisp" "prolog" "php" "erl" "hrl" 122 "c" "h" "c++" "cc" "cpp" "cxx" "h++" "hh" "hpp" "hxx" "m" "pdb"
123 "F" "f" "f90" "for" "cs" "a" "asm" "ads" "adb" "ada") 123 "cs" "hs" "erl" "hrl" "fth" "tok" "f" "f90" "for" "go"
124 "java" "cl" "clisp" "el" "lisp" "lsp" "lua" "lm" "p" "pas"
125 "pl" "pm" "php" "php3" "php4" "pc" "prolog" "py" "rb" "ru" "rbw"
126 "rs" "oak" "rkt" "sch" "scheme" "scm" "sm" "ss"
127 "y" "y++" "ym" "yxx" "yy")
124 "Code file extensions for `etags-regen-mode'. 128 "Code file extensions for `etags-regen-mode'.
125 129
126File extensions to generate the tags for." 130File extensions to generate the tags for."
@@ -242,11 +246,12 @@ File extensions to generate the tags for."
242 (ir-start (1- (length root))) 246 (ir-start (1- (length root)))
243 (ignores-regexps 247 (ignores-regexps
244 (mapcar #'etags-regen--ignore-regexp 248 (mapcar #'etags-regen--ignore-regexp
245 etags-regen-ignores))) 249 etags-regen-ignores))
250 (case-fold-search t))
246 (cl-delete-if 251 (cl-delete-if
247 (lambda (f) (or (not (string-match-p match-re f)) 252 (lambda (f) (or (not (string-match-p match-re f))
248 (string-match-p "/\\.#" f) ;Backup files. 253 (string-match-p "/\\.#" f) ;Backup files.
249 (cl-some (lambda (ignore) (string-match ignore f ir-start)) 254 (cl-some (lambda (ignore) (string-match-p ignore f ir-start))
250 ignores-regexps))) 255 ignores-regexps)))
251 files))) 256 files)))
252 257