     (setq window (cscope-show-entry-internal file line-number t))
     (if (windowp window)
 	(select-window window))
-    ))
+    )
+  (if cscope-close-window-after-select
+    (delete-windows-on cscope-output-buffer-name)))
 
 
 (defun cscope-select-entry-one-window ()

      (define-key cscope-list-entry-keymap [button2] 'cscope-mouse-select-entry-other-window)
    (define-key cscope-list-entry-keymap [mouse-2] 'cscope-mouse-select-entry-other-window))
  (define-key cscope-list-entry-keymap [return] 'cscope-select-entry-other-window)
  (define-key cscope-list-entry-keymap " " 'cscope-show-entry-other-window)
  (define-key cscope-list-entry-keymap "o" 'cscope-select-entry-one-window)
  (define-key cscope-list-entry-keymap "q" 'cscope-bury-buffer)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; File:         xcscope.el
; RCS:          $RCSfile: xcscope.el,v $ $Revision: 1.15 $ $Date: 2013/04/09 14:35:57 $ $Author: nhorman $
; Description:  cscope interface for (X)Emacs
; Author:       Darryl Okahata
; Created:      Wed Apr 19 17:03:38 2000
