     ))
 
 
-(defun cscope-call (msg args &optional directory filter-func)
+(defun cscope-call (msg args &optional directory filter-func sentinel-func)
   "Generic function to call to process cscope requests.
-ARGS is a list of command-line arguments to pass to the cscope process.
-DIRECTORY is the current working directory to use (generally, the
-directory in which the cscope database is located, but not necessarily),
-if different that the current one.  FILTER-FUNC is an optional process
-filter."
-  (let ( (outbuf (get-buffer-create cscope-output-buffer-name))
-	 info options cscope-directory database-file
-	 )
+ARGS is a list of command-line arguments to pass to the cscope
+process.  DIRECTORY is the current working directory to use (generally,
+the directory in which the cscope database is located, but not
+necessarily), if different that the current one.  FILTER-FUNC and
+SENTINEL-FUNC are optional process filter and sentinel, respectively."
+  (let ( (outbuf (get-buffer-create cscope-output-buffer-name)) )
     (if cscope-process
 	(error "A cscope search is still in progress -- only one at a time is allowed"))
-    (if cscope-display-times
-	(let ( (times (current-time)) )
-	  (setq cscope-start-time (+ (* (car times) 65536.0) (car (cdr times))
-				     (* (car (cdr (cdr times))) 1.0E-6)))))
     (setq directory (cscope-canonicalize-directory directory))
     (save-excursion
       (set-buffer outbuf)
+      (if cscope-display-times
+	  (let ( (times (current-time)) )
+	    (setq cscope-start-time (+ (* (car times) 65536.0) (car (cdr times))
+				       (* (car (cdr (cdr times))) 1.0E-6)))))
       (setq default-directory directory
 	    cscope-search-list (cscope-find-info directory)
 	    cscope-searched-dirs nil
 	    cscope-command-args args
 	    cscope-filter-func filter-func
+	    cscope-sentinel-func sentinel-func
 	    cscope-first-match nil
 	    cscope-stop-at-first-match-dir-meta (memq t cscope-search-list)
 	    cscope-matched-multiple nil

		    )
	      (setq cscope-process
		    (apply 'start-process "cscope" outbuf cscope-program options))
	      (set-process-filter cscope-process 'cscope-process-filter)
	      (set-process-sentinel cscope-process 'cscope-process-sentinel)
	      (set-marker (process-mark cscope-process) (point))
	      (process-kill-without-query cscope-process)
	      (setq modeline-process ": Searching ..."

	(progn
	  (set-buffer (process-buffer process))
	  ;; Make buffer-read-only nil
	  (let (buffer-read-only line file function-name line-number moving)
	    (setq moving (= (point) (process-mark process)))
	    (save-excursion
	      (goto-char (process-mark process))
