[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/etags-regen 570f132 03/11: etags.c: Implement the -L flag
From: |
Dmitry Gutov |
Subject: |
scratch/etags-regen 570f132 03/11: etags.c: Implement the -L flag |
Date: |
Sun, 3 Jan 2021 19:06:30 -0500 (EST) |
branch: scratch/etags-regen
commit 570f132500bdc65cb8d6f42858e02e800414a2a7
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
etags.c: Implement the -L flag
---
lib-src/etags.c | 3 ++-
lisp/progmodes/etags-regen.el | 12 ++++++------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/lib-src/etags.c b/lib-src/etags.c
index b5c18e0..d79c6f4 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -1112,7 +1112,7 @@ main (int argc, char **argv)
/* When the optstring begins with a '-' getopt_long does not rearrange the
non-options arguments to be at the end, but leaves them alone. */
optstring = concat ("-ac:Cf:Il:o:Qr:RSVhH",
- (CTAGS) ? "BxdtTuvw" : "Di:",
+ (CTAGS) ? "BxdtTuvw" : "Di:L:",
"");
while ((opt = getopt_long (argc, argv, optstring, longopts, NULL)) != EOF)
@@ -1124,6 +1124,7 @@ main (int argc, char **argv)
break;
case 1:
+ case 'L':
/* This means that a file name has been seen. Record it. */
argbuffer[current_arg].arg_type = at_filename;
argbuffer[current_arg].what = optarg;
diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el
index 837a18e..a1053a8 100644
--- a/lisp/progmodes/etags-regen.el
+++ b/lisp/progmodes/etags-regen.el
@@ -41,10 +41,6 @@
;; How do we get the correct etags here?
;; E.g. "~/vc/emacs-master/lib-src/etags"
;;
- ;; ctags's etags requires '-L -' for stdin input.
- ;; It also looks broken here (indexes only some of the input files).
- ;;
- ;; If our etags supported '-L', we could use any version of etags.
)
(defun etags-regen--maybe-generate ()
@@ -84,7 +80,10 @@
files)
(shell-command-on-region
(point-min) (point-max)
- (format "%s - -o %s" etags-regen-program etags-regen--tags-file)
+ ;; ctags's etags requires '-L -' for stdin input.
+ ;; It looks half-broken here (indexes only some of the input files),
+ ;; but better-maintained versions of it exist (like universal-ctags).
+ (format "%s -L - -o %s" etags-regen-program etags-regen--tags-file)
nil nil "*etags-project-tags-errors*" t))))
(defun etags-regen--update-file ()
@@ -167,6 +166,7 @@
(advice-add 'tags-completion-at-point-function :before
#'etags-regen--maybe-generate))
(advice-remove 'etags--xref-backend #'etags-regen--maybe-generate)
- (advice-remove 'tags-completion-at-point-function
#'etags-regen--maybe-generate)))
+ (advice-remove 'tags-completion-at-point-function
#'etags-regen--maybe-generate)
+ (etags-regen--tags-cleanup)))
;;; etags-regen.el ends here
- scratch/etags-regen 4d0886e 02/11: Move to a separate file and minor mode, (continued)
- scratch/etags-regen 4d0886e 02/11: Move to a separate file and minor mode, Dmitry Gutov, 2021/01/03
- scratch/etags-regen d6285de 05/11: New defcustom: etags-regen-program-options, Dmitry Gutov, 2021/01/03
- scratch/etags-regen d9e3afe 04/11: Make etags-regen-program a user option, Dmitry Gutov, 2021/01/03
- scratch/etags-regen 798c90b 07/11: Support etags-regen-program-options in --update-file, Dmitry Gutov, 2021/01/03
- scratch/etags-regen 5270872 11/11: Undo the etags.el changes, Dmitry Gutov, 2021/01/03
- scratch/etags-regen aa4eddb 09/11: Ensure errors buffer name is more consistent, Dmitry Gutov, 2021/01/03
- scratch/etags-regen 8ce70eb 06/11: Use `silent' for appending, too, Dmitry Gutov, 2021/01/03
- scratch/etags-regen 46c1f2f 10/11: Solve (hopefully?) the local-variable-satefy issue, Dmitry Gutov, 2021/01/03
- scratch/etags-regen ab5bf3c 01/11: Merge branch 'master' into scratch/etags-regen, Dmitry Gutov, 2021/01/03
- scratch/etags-regen 6f26f60 08/11: Bookkeeping, Dmitry Gutov, 2021/01/03
- scratch/etags-regen 570f132 03/11: etags.c: Implement the -L flag,
Dmitry Gutov <=