emacsorphanage / helm-gtags

GNU GLOBAL helm interface
203 stars 32 forks source link

How can I customize helm-gtags-auto-update to update all tags? #174

Open huangguiyang opened 7 years ago

syohex commented 4 years ago

Sorry late reply. There is no way. I suppose it requires following patch

diff --git a/helm-gtags.el b/helm-gtags.el
index e3eab8c..08f39e6 100644
--- a/helm-gtags.el
+++ b/helm-gtags.el
@@ -86,7 +86,9 @@

 (defcustom helm-gtags-auto-update nil
   "*If non-nil, tag files are updated whenever a file is saved."
-  :type 'boolean
+  :type '(choice (const :tag "update entirely" all)
+                 (const :tag "update tags against file" t)
+                 (const :tag "Do not update automatically" nil))
   :group 'helm-gtags)

 (defcustom helm-gtags-pulse-at-cursor t
@@ -1368,10 +1370,12 @@ You can jump definitions of functions, symbols in this file."

 (defsubst helm-gtags--how-to-update-tags ()
   "Not documented."
-  (cl-case (prefix-numeric-value current-prefix-arg)
-    (4 'entire-update)
-    (16 'generate-other-directory)
-    (otherwise 'single-update)))
+  (if (eq helm-gtags-auto-update 'all)
+      'entire-update
+    (cl-case (prefix-numeric-value current-prefix-arg)
+      (4 'entire-update)
+      (16 'generate-other-directory)
+      (otherwise 'single-update))))

 (defun helm-gtags--update-tags-command (how-to)
   "Not documented."