Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
b7e29962
Commit
b7e29962
authored
Jan 14, 2021
by
Dmitry Gutov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New feature: etags-regen-ignores
parent
7ef4c7c1
Pipeline
#8709
failed with stage
in 54 minutes and 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
.dir-locals.el
.dir-locals.el
+2
-1
lisp/progmodes/etags-regen.el
lisp/progmodes/etags-regen.el
+30
-1
No files found.
.dir-locals.el
View file @
b7e29962
...
...
@@ -9,7 +9,8 @@
.
(((
"c"
"objc"
)
.
(
"/[ \t]*DEFVAR_[A-Z_ \t(]+\"\\([^\"]+\\)\"/\\1/"
"/[ \t]*DEFVAR_[A-Z_ \t(]+\"[^\"]+\",[ \t]\\([A-Za-z0-9_]+\\)/\\1/"
))))))
"/[ \t]*DEFVAR_[A-Z_ \t(]+\"[^\"]+\",[ \t]\\([A-Za-z0-9_]+\\)/\\1/"
))))
(
etags-regen-ignores
.
(
"test/manual/etags/"
))))
(
c-mode
.
((
c-file-style
.
"GNU"
)
(
c-noise-macro-names
.
(
"INLINE"
"ATTRIBUTE_NO_SANITIZE_UNDEFINED"
"UNINIT"
"CALLBACK"
"ALIGN_STACK"
))
(
electric-quote-comment
.
nil
)
...
...
lisp/progmodes/etags-regen.el
View file @
b7e29962
...
...
@@ -100,6 +100,17 @@ File extensions to generate the tags for."
(
string-match-p
"\\`[a-zA-Z0-9]+\\'"
ext
)))
value
))))
(
defcustom
etags-regen-ignores
nil
"Additional ignore rules, in the format of `project-ignores'."
:type
'
(
repeat
(
string
:tag
"Glob to ignore"
)))
;;;###autoload
(
put
'etags-regen-ignores
'safe-local-variable
(
lambda
(
value
)
(
and
(
listp
value
)
(
seq-every-p
#'
stringp
value
))))
(
defvar
etags-regen--errors-buffer-name
"*etags-regen-tags-errors*"
)
(
defun
etags-regen--maybe-generate
()
...
...
@@ -120,13 +131,28 @@ File extensions to generate the tags for."
(
add-hook
'before-save-hook
#'
etags-regen--mark-as-new
)
(
visit-tags-table
etags-regen--tags-file
))))
(
declare-function
dired-glob-regexp
"dired"
)
(
defun
etags-regen--tags-generate
(
proj
)
(
require
'dired
)
(
let*
((
root
(
project-root
proj
))
(
default-directory
root
)
(
files
(
project-files
proj
))
(
extensions
etags-regen-file-extensions
)
;; FIXME: Try to do the filtering inside project.el already.
(
file-regexp
(
format
"\\.%s\\'"
(
regexp-opt
extensions
t
)))
(
ignore-regexps
(
mapcar
(
lambda
(
i
)
(
if
(
string-match
"\\./"
i
)
;; ./abc -> abc
(
setq
i
(
substring
i
2
))
;; abc -> */abc
(
setq
i
(
concat
"*/"
i
))
(
if
(
string-match
"/\\'"
i
)
;; abc/ -> abc/*
(
setq
i
(
concat
i
"*"
))))
(
dired-glob-regexp
i
))
etags-regen-ignores
))
(
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),
...
...
@@ -139,7 +165,10 @@ File extensions to generate the tags for."
etags-regen--tags-root
root
)
(
with-temp-buffer
(
mapc
(
lambda
(
f
)
(
when
(
string-match-p
file-regexp
f
)
(
when
(
and
(
string-match-p
file-regexp
f
)
(
not
(
seq-some
(
lambda
(
re
)
(
string-match-p
re
f
))
ignore-regexps
)))
(
insert
f
"\n"
)))
files
)
(
shell-command-on-region
(
point-min
)
(
point-max
)
command
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment