bug-global
[Top][All Lists]
Advanced

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

Re: [PATCH] add custom var gtags-find-all-text-files


From: Shigio YAMAGUCHI
Subject: Re: [PATCH] add custom var gtags-find-all-text-files
Date: Fri, 25 Oct 2013 18:39:30 +0900

Hello,

OK.
Your code will be included in the next release.
Thank you for the patch.


2013/10/25 Jean-Marc Saffroy <address@hidden>
Hi,

I use global from emacs, and I love it! Recently I started using the
find-file command, and I was annoyed that it prompts me with files I'm not
interested in (in particular, emacs backup files, or non-source files
generated by my builds).

So I cooked the little patch below (against release 6.2.9). The patch
maintains the current behaviour (prompt "other" files) as a default.


Cheers,
Jean-Marc

--
address@hidden

 gtags.el |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)


diff --git a/gtags.el b/gtags.el
--- a/gtags.el
+++ b/gtags.el
@@ -141,6 +141,11 @@
   :type 'boolean
   :group 'gtags)

+(defcustom gtags-find-all-text-files t
+  "*If non-nil, gtags-find-file command finds all text files."
+  :group 'gtags
+  :type 'boolean)
+
 ;; Variables
 (defvar gtags-current-buffer nil
   "Current buffer.")
@@ -419,7 +424,7 @@
 (defun gtags-completing (flag string predicate code)
   ; The purpose of using the -n option for the -P command is to exclude
   ; dependence on the execution directory.
-  (let ((option (cond ((eq flag 'files)   "-cPo")
+  (let ((option (cond ((eq flag 'files)   (if gtags-find-all-text-files "-cPo" "-cP"))
                       ((eq flag 'grtags)  "-cr")
                       ((eq flag 'gsyms)   "-cs")
                       ((eq flag 'idutils) "-cI")
@@ -585,7 +590,7 @@
                   nil nil nil gtags-history-list))
     (if (not (equal "" input)) (setq tagname input))
     (gtags-push-context)
-    (gtags-goto-tag tagname "Po")))
+    (gtags-goto-tag tagname (if gtags-find-all-text-files "Po" "P"))))

 (defun gtags-parse-file ()
   "Input file name and show the list of tags in it."

_______________________________________________
Bug-global mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-global



--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3

reply via email to

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