[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
patch for gtags.el: about *GTAGS SELECT*... buffer
From: |
Yushi Oka |
Subject: |
patch for gtags.el: about *GTAGS SELECT*... buffer |
Date: |
Sun, 24 Jan 2010 02:00:03 +0900 |
Hello,
(ohisashi buri desu. yamaguchi-san)
I have attached a patch for gtags.el.
This patch adds gtags-select-buffer-single option.
If this option is not nil, "*GTAGS SELECT* ..." buffer is single.
What do you think about this patch?
diff -ur gtags.el.5.7.7 gtags.el
--- gtags.el.5.7.7 2009-12-23 11:09:00.000000000 +0900
+++ gtags.el 2010-01-21 00:58:41.281250000 +0900
@@ -92,6 +92,11 @@
:group 'gtags
:type 'boolean)
+(defcustom gtags-select-buffer-single nil
+ "*If non-nil, gtags select buffer is single."
+ :group 'gtags
+ :type 'boolean)
+
;; Variables
(defvar gtags-current-buffer nil
"Current buffer.")
@@ -501,6 +506,29 @@
(setq prefix "(R)"))
(t (setq prefix "(D)")))
;; load tag
+ (if gtags-select-buffer-single
+ (progn
+ ; delete "*GTAGS SELECT*" buffer info from gtags-buffer-stack and
gtags-point-stack
+ (let (now-gtags-buffer-stack now-buffer now-gtags-point-stack
now-point)
+ (setq now-gtags-buffer-stack gtags-buffer-stack)
+ (setq now-gtags-point-stack gtags-point-stack)
+ (while now-gtags-buffer-stack
+ (setq now-buffer (car now-gtags-buffer-stack))
+ (setq now-point (car now-gtags-point-stack))
+ (if (string-match "*GTAGS SELECT*" (buffer-name now-buffer))
+ (progn
+ (delete now-buffer gtags-buffer-stack)
+ (delete now-point gtags-point-stack)))
+ (setq now-gtags-buffer-stack (cdr now-gtags-buffer-stack))
+ (setq now-gtags-point-stack (cdr now-gtags-point-stack))))
+ ; kill "*GTAGS SELECT*" buffer
+ (let (now-buffer-list now-buffer)
+ (setq now-buffer-list (buffer-list))
+ (while now-buffer-list
+ (setq now-buffer (car now-buffer-list))
+ (if (string-match "*GTAGS SELECT*" (buffer-name now-buffer))
+ (kill-buffer now-buffer))
+ (setq now-buffer-list (cdr now-buffer-list))))))
(setq buffer (generate-new-buffer (generate-new-buffer-name (concat
"*GTAGS SELECT* " prefix tagname))))
(set-buffer buffer)
;
--
Yushi Oka <address@hidden>
- patch for gtags.el: about *GTAGS SELECT*... buffer,
Yushi Oka <=