branch: master commit 25946d3cf174a32addd773ccee396982894c7d97 Author: Leo Liu <sdl....@gmail.com> Commit: Leo Liu <sdl....@gmail.com>
Implement #162: New variable ggtags-extra-args --- README.rst | 1 + ggtags.el | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index e10affb..e133235 100644 --- a/README.rst +++ b/README.rst @@ -320,6 +320,7 @@ NEWS #. Don't choke on tag names start with ``-`` (`#156 <https://github.com/leoliu/ggtags/issues/156>`_). #. ``ggtags-show-definition`` supports ``ggtags-sort-by-nearness``. +#. New variable ``ggtags-extra-args``. [2016-10-02 Sun] 0.8.12 +++++++++++++++++++++++ diff --git a/ggtags.el b/ggtags.el index 8a970a1..e312fcc 100644 --- a/ggtags.el +++ b/ggtags.el @@ -218,6 +218,12 @@ isn't built with sqlite3 support." :safe 'booleanp :group 'ggtags) +(defcustom ggtags-extra-args nil + "Extra arguments to pass to `gtags' in `ggtags-create-tags'." + :type '(repeat string) + :safe #'ggtags-list-of-string-p + :group 'ggtags) + (defcustom ggtags-sort-by-nearness nil "Sort tags by nearness to current directory. GNU Global 6.5+ required." @@ -735,14 +741,15 @@ source trees. See Info node `(global)gtags' for details." (setenv "GTAGSLABEL" "ctags")) (ggtags-with-temp-message "`gtags' in progress..." (let ((default-directory (file-name-as-directory root)) - (args (cl-remove-if - #'null - (list (and ggtags-use-idutils "--idutils") - (and ggtags-use-sqlite3 - (ggtags-process-succeed-p "gtags" "--sqlite3" "--help") - "--sqlite3") - (and conf "--gtagsconf") - (and conf (ggtags-ensure-localname conf)))))) + (args (append (cl-remove-if + #'null + (list (and ggtags-use-idutils "--idutils") + (and ggtags-use-sqlite3 + (ggtags-process-succeed-p "gtags" "--sqlite3" "--help") + "--sqlite3") + (and conf "--gtagsconf") + (and conf (ggtags-ensure-localname conf)))) + ggtags-extra-args))) (condition-case err (apply #'ggtags-process-string "gtags" args) (error (if (and ggtags-use-idutils