emacs-diffs
[Top][All Lists]
Advanced

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

scratch/etags-regen 798c90b 07/11: Support etags-regen-program-options i


From: Dmitry Gutov
Subject: scratch/etags-regen 798c90b 07/11: Support etags-regen-program-options in --update-file
Date: Sun, 3 Jan 2021 19:06:31 -0500 (EST)

branch: scratch/etags-regen
commit 798c90ba1b4bc545860f8847bf6ec4e8e460218a
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Support etags-regen-program-options in --update-file
    
    Also switch to shell-command for consistency, to avoid problems with
    quoting in regexps.
---
 lisp/progmodes/etags-regen.el | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el
index 21cd578..8876f38 100644
--- a/lisp/progmodes/etags-regen.el
+++ b/lisp/progmodes/etags-regen.el
@@ -92,11 +92,12 @@
                 (insert f "\n")))
             files)
       (shell-command-on-region (point-min) (point-max) command
-       nil nil "*etags-project-tags-errors*" t))))
+                               nil nil "*etags-project-tags-errors*" t))))
 
 (defun etags-regen--update-file ()
   ;; TODO: Maybe only do this when Emacs is idle for a bit.
   (let ((file-name buffer-file-name)
+        (options etags-regen-program-options)
         (tags-file-buf (get-file-buffer etags-regen--tags-file))
         pr should-scan)
     (save-excursion
@@ -127,15 +128,13 @@
         (goto-char (point-max))
         (let ((inhibit-read-only t)
               (current-end (point)))
-          (call-process
-           etags-regen-program
-           nil
-           '(t "*etags-project-tags-errors*")
-           nil
-           file-name
-           "--append"
-           "-o"
-           "-")
+          ;; FIXME: call-process is significantly faster, though.
+          ;; Like 10ms vs 20ms here.
+          (shell-command
+           (format "%s %s %s -o -"
+                   etags-regen-program (mapconcat #'identity options " ")
+                   file-name)
+           t "*etags-project-tags-errors*")
           ;; XXX: When the project is big (tags file in 10s of megabytes),
           ;; this is much faster than revert-buffer.  Or even using
           ;; write-region without APPEND.



reply via email to

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