[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/etags-regen 4f7b533 6/8: etags-regen--all-files: Extract to a se
From: |
Dmitry Gutov |
Subject: |
scratch/etags-regen 4f7b533 6/8: etags-regen--all-files: Extract to a separate function |
Date: |
Sun, 7 Feb 2021 21:12:02 -0500 (EST) |
branch: scratch/etags-regen
commit 4f7b533473919f14b893afa31e7ddb304c88d206
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
etags-regen--all-files: Extract to a separate function
---
lisp/progmodes/etags-regen.el | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el
index c17edeb..7769bec 100644
--- a/lisp/progmodes/etags-regen.el
+++ b/lisp/progmodes/etags-regen.el
@@ -133,7 +133,7 @@ File extensions to generate the tags for."
(declare-function dired-glob-regexp "dired")
-(defun etags-regen--tags-generate (proj)
+(defun etags-regen--all-files (proj)
(require 'dired)
(let* ((root (project-root proj))
(default-directory root)
@@ -152,7 +152,20 @@ File extensions to generate the tags for."
;; abc/ -> abc/*
(setq i (concat i "*"))))
(dired-glob-regexp i))
- (cons ".#*" etags-regen-ignores)))
+ (cons ".#*" etags-regen-ignores))))
+ (cl-delete-if-not
+ (lambda (f)
+ (and (string-match-p file-regexp f)
+ (not (cl-find
+ (lambda (re) (string-match-p re f))
+ ignore-regexps))))
+ files)))
+
+(defun etags-regen--tags-generate (proj)
+ (require 'dired)
+ (let* ((root (project-root proj))
+ (default-directory root)
+ (files (etags-regen--all-files proj))
(tags-file (make-temp-file "emacs-regen-tags-"))
;; ctags's etags requires '-L -' for stdin input.
;; It looks half-broken here (indexes only some of the input files),
@@ -165,11 +178,7 @@ File extensions to generate the tags for."
etags-regen--tags-root root)
(with-temp-buffer
(mapc (lambda (f)
- (when (and (string-match-p file-regexp f)
- (not (seq-some
- (lambda (re) (string-match-p re f))
- ignore-regexps)))
- (insert f "\n")))
+ (insert f "\n"))
files)
(shell-command-on-region (point-min) (point-max) command
nil nil etags-regen--errors-buffer-name t))))
- scratch/etags-regen updated (153a549 -> f4a1d47), Dmitry Gutov, 2021/02/07
- scratch/etags-regen 8d00e2f 1/8: Merge branch 'master' into scratch/etags-regen, Dmitry Gutov, 2021/02/07
- scratch/etags-regen 1daad17 2/8: Merge branch 'master' into scratch/etags-regen, Dmitry Gutov, 2021/02/07
- scratch/etags-regen 44f19c7 3/8: Merge branch 'master' into scratch/etags-regen, Dmitry Gutov, 2021/02/07
- scratch/etags-regen 25b2915 7/8: Introduce project-files-filtered and use it, Dmitry Gutov, 2021/02/07
- scratch/etags-regen f4a1d47 8/8: Brute force refresh implementation, Dmitry Gutov, 2021/02/07
- scratch/etags-regen 3098e47 4/8: Merge branch 'master' into scratch/etags-regen, Dmitry Gutov, 2021/02/07
- scratch/etags-regen 4f7b533 6/8: etags-regen--all-files: Extract to a separate function,
Dmitry Gutov <=
- scratch/etags-regen f520e5d 5/8: Merge branch 'master' into scratch/etags-regen, Dmitry Gutov, 2021/02/07