             ((= (elt filename 0) ?\<)
              (format "(Non-file source: '%s')" filename))
 
-            (t (format "Not found: %s" filename)))
-      )
-    )
-  )
+            (t (format "Not found: %s" filename))))))
 
  
-;;; Subprocess commands
-
-
--
-;; rdebugtrack 
+;; rdebugtrack
 (defcustom rdebugtrack-mode-text " rdebug"
   "*String to display in the mode line when rdebugtrack mode is active.
 
 \(When the string is not empty, make sure that it has a leading space.)"
-  :tag "rdebug mode text"                ; To separate it from `global-...'
+  :tag "rdebug mode text"           ; To separate it from `global-...'
   :group 'rdebug
   :type 'string)
 

  ;; other rdebug commands wipe out the highlight.  You can always do a
  ;; 'where' (aka 'w') command to reveal the overlay arrow.
  (rdebug-debug-enter "rdebugtrack-track-stack-file"
  (let* ((origbuf (current-buffer))
	 (currproc (get-buffer-process origbuf)))

    (if (not (and currproc rdebugtrack-do-tracking-p))
        (rdebugtrack-overlay-arrow nil)
      ;else 
      (let* ((procmark (process-mark currproc))
	     (block-start (max comint-last-input-end
			       (- procmark rdebugtrack-track-range)))
             (block-str (buffer-substring block-start procmark))
             target target_fname target_lineno target_buffer)

        (if (not (string-match rdebugtrack-input-prompt block-str))
            (rdebugtrack-overlay-arrow nil)
	  ;else 
          
          (setq target (rdebugtrack-get-source-buffer block-str))

          (if (stringp target)
              (rdebug-debug-message "rdebugtrack: %s" target)
	    ; else
	    (gud-rdebug-marker-filter block-str)
            (setq target_lineno (car target))
            (setq target_buffer (cadr target))
            (setq target_fname (buffer-file-name target_buffer))
            (switch-to-buffer-other-window target_buffer)
            (goto-line target_lineno)
            (rdebug-debug-message "rdebugtrack: line %s, file %s" target_lineno target_fname)
            (rdebugtrack-overlay-arrow t)
            (pop-to-buffer origbuf t)
            )

	  ; Delete processed annotations from buffer.
	  (save-excursion
	    (let ((annotate-start)
		  (annotate-end (point-max)))
	      (goto-char block-start)
	      (while (re-search-forward
		      rdebug-annotation-start-regexp annotate-end t)
		(setq annotate-start (match-beginning 0))
		(if (re-search-forward 
		     rdebug-annotation-end-regexp annotate-end t)
		    (delete-region annotate-start (point))
		;else
		  (forward-line)))
	      )))
	)))
    ))

(defun rdebugtrack-get-source-buffer (block-str)
  "Return line number and buffer of code indicated by block-str's traceback 
text.

We look first to visit the file indicated in the trace.

	    ;; it to gud-marker-acc after normal output has been processed
	    (setq tmp (substring gud-marker-acc s))
	    (setq gud-marker-acc (substring gud-marker-acc 0 s)))))

      (when (setq s (string-match rdebug-annotation-end-regexp gud-marker-acc))
	;; save the beginning of gud-marker-acc to tmp, remove it and restore it
	;; after normal output has been processed
	(setq tmp (substring gud-marker-acc 0 s))
	(setq gud-marker-acc (substring gud-marker-acc s)))

      ;; Process all the complete markers in this chunk.
      ;; Format of line looks like this:
      ;;   /etc/init.d/ntp.init:16:
      (while (string-match gud-rdebug-marker-regexp gud-marker-acc)
	(setq

	 ;; Extract the frame position from the marker.
	 gud-last-frame
	 (cons (substring gud-marker-acc
			  (match-beginning 1) (match-end 1))
	       (string-to-number
		(substring gud-marker-acc
			   (match-beginning 2) (match-end 2))))

	 ;; Append any text before the marker to the output we're going
	 ;; to return - we don't include the marker in this text.
	 output (concat output
			(substring gud-marker-acc 0 (match-beginning 0)))

	 ;; Set the accumulator to the remaining text.
	 gud-marker-acc (substring gud-marker-acc (match-end 0))))

      ;; Does the remaining text look like it might end with the
      ;; beginning of another marker?  If it does, then keep it in
      ;; gud-marker-acc until we receive the rest of it.  Since we
