bug-global
[Top][All Lists]
Advanced

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

Re: patch for gtags.el: about *GTAGS SELECT*... buffer


From: Yushi Oka
Subject: Re: patch for gtags.el: about *GTAGS SELECT*... buffer
Date: Mon, 08 Feb 2010 00:04:54 +0900

Hello,

I found a serious problem in my patch for gtags.el and have fixed it.
Killed buffer that exist in gtags-buffer-stack manually, gtags-goto-tag
function doesn't work.

I have attached a new 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-02-07 02:18:21.593750000 +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,31 @@
       (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 (reverse gtags-buffer-stack))
+            (setq now-gtags-point-stack (reverse gtags-point-stack))
+            (setq gtags-buffer-stack nil)
+            (setq gtags-point-stack nil)
+            (while now-gtags-buffer-stack
+              (setq now-buffer (car now-gtags-buffer-stack))
+              (setq now-point (car now-gtags-point-stack))
+              (if (and (buffer-name now-buffer) (not (string-match "*GTAGS 
SELECT*" (buffer-name now-buffer))))
+                  (progn
+                    (setq gtags-buffer-stack (cons now-buffer 
gtags-buffer-stack))
+                    (setq gtags-point-stack (cons 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)
     ;


> Hello, (ohisashi buri desu)
> 
> > 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?
> 
> Smart!  It is especially wonderful to have left the last buffer.
> This behavior is preferable in almost case, and extra operations
> are not required. A lot of users will set this variable.
> I want to take this patch for the public gtags.el. Thank you.
> 
> This solution seems almost to be alternative of your proposal.
> Right? >klchxbec
> --
> Shigio YAMAGUCHI <address@hidden>
> PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3

-- 
Yushi Oka <address@hidden>





reply via email to

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