[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] add custom var gtags-find-all-text-files
From: |
Jean-Marc Saffroy |
Subject: |
[PATCH] add custom var gtags-find-all-text-files |
Date: |
Thu, 24 Oct 2013 19:55:20 +0200 (CEST) |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
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."
- [PATCH] add custom var gtags-find-all-text-files,
Jean-Marc Saffroy <=