 
 ;; -- stack
 
-(defvar rdebug--stack-frame-map
+(defvar rdebug-frames-mode-map
   (let ((map (make-sparse-keymap)))
+    (define-key map "q" 'kill-this-buffer)
     (define-key map [mouse-1] 'rdebug-goto-stack-frame-mouse)
     (define-key map [mouse-2] 'rdebug-goto-stack-frame-mouse)
     (define-key map [(control m)] 'rdebug-goto-stack-frame)

             (+ b (match-beginning 5)) (+ b (match-end 5))
             (list 'face font-lock-constant-face
                   'font-lock-face font-lock-constant-face))
            (if (string= (substring s (match-beginning 1) (match-end 1)) 
			 "-->")
                ;; highlight the currently selected frame
                (add-text-properties b e
                                     (list 'face 'bold
                                           'font-lock-face 'bold))
              ;; remove the trailing ## 
              (beginning-of-line)
              (delete-char 2)
              (insert "  "))
	    (add-text-properties b e
				 (list 'mouse-face 'highlight
				       'keymap rdebug--stack-frame-map))
	    (let ((fn-str (substring s (match-beginning 3) (match-end 3)))
		  (fn-start (+ b (match-beginning 3))))
	      (if (string-match "\\([^(]+\\)(" fn-str)

		   (+ fn-start (match-beginning 1)) (+ fn-start (match-end 1))
		   (list 'face font-lock-function-name-face
			 'font-lock-face font-lock-function-name-face))))))
	;; remove initial ###  or -->
	(beginning-of-line)
	(delete-char 3)
        (forward-line)
        (beginning-of-line)))))

(defun rdebug-goto-stack-frame (pt)
  "Show the rdebug stack frame corresponding at PT in the rdebug stack buffer."
  (interactive "d")
  (save-excursion
    (goto-char pt)
