Re: Proposed feature - Optionally generate gtags for gtags-visit-rootdir

Earl Chew <[email protected]>
Newsgroups gmane.comp.gnu.global.bugs
Message-ID <[email protected]>
Ok. Thank you in advance for including this functionality.

On 13 October 2015 18:03:00 GMT-07:00, Shigio YAMAGUCHI <[email protected]> wrote:
>Hi,
>Thank you for the patch.
>I would like to take over this matter. I had forgotten, but
>this option should work in TRAMP environment. However, TRAMP
>facility of gtags.el is almost undocumented. So, please let
>me do it. It takes time a little though.
>
>Regards,
>Shigio
>
>2015-10-12 3:10 GMT+09:00 Earl Chew <[email protected]>:
>
>> On 8/10/2015 21:15, Shigio YAMAGUCHI wrote:
>>
>>> I agree with you.
>>> No problem with 1).
>>>
>>
>> What do you think about this attempt ?
>>
>> Earl
>>
>> --- gtags.el.orig       2015-10-11 10:28:05.269639542 -0700
>> +++ gtags.el    2015-10-11 11:06:05.468301202 -0700
>> @@ -197,12 +197,19 @@
>>    "Root directory of source tree.")
>>  (defvar gtags-global-command nil
>>    "Command name of global.")
>> +(defvar gtags-command nil
>> +  "Command name of gtags.")
>>
>>  ;; Set global's command name
>>  (setq gtags-global-command (getenv "GTAGSGLOBAL"))
>>  (if (or (not gtags-global-command) (equal gtags-global-command ""))
>>      (setq gtags-global-command "global"))
>>
>> +;; Set global's command name
>> +(setq gtags-command (getenv "GTAGS"))
>> +(if (or (not gtags-command) (equal gtags-command ""))
>> +    (setq gtags-command "gtags"))
>> +
>>  ;; Key mapping of gtags-mode.
>>  (if gtags-suggested-key-mapping
>>      (progn
>> @@ -512,9 +519,9 @@
>>  ;;
>>  ;; interactive command
>>  ;;
>> -(defun gtags-visit-rootdir ()
>> +(defun gtags-visit-rootdir (arg)
>>    "Tell tags commands the root directory of source tree."
>> -  (interactive)
>> +  (interactive "P")
>>    (let (path input default-path)
>>      (setq path gtags-rootdir)
>>      (if (not path)
>> @@ -530,7 +537,21 @@
>>        (if (not (file-directory-p input))
>>          (message "%s is not directory." input)
>>         (setq gtags-rootdir (expand-file-name input))
>> -       (setenv "GTAGSROOT" gtags-rootdir)))))
>> +       (setenv "GTAGSROOT" gtags-rootdir)
>> +       (when arg
>> +         (let (stdout)
>> +           (message "Building gtags %s" gtags-rootdir)
>> +           (gtags-push-tramp-environment)
>> +           (setq stdout
>> +             (shell-command-to-string
>> +               (format "exec %s"
>> +                (shell-quote-argument gtags-command))))
>> +           (gtags-pop-tramp-environment)
>> +           (message "Built gtags %s%s"
>> +             gtags-rootdir
>> +             (if (= 0 (length stdout))
>> +               ""
>> +               (concat ": " stdout)))))))))
>>
>>  (defun gtags-find-tag (&optional other-win)
>>    "Input tag name and move to the definition."
>>
>
>
>
>-- 
>Shigio YAMAGUCHI <[email protected]>
>PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


Earl
-- 
Sent from my mobile phone. Please excuse my brevity.

_______________________________________________
Bug-global mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-global
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.