Thanks! Yes, I add the statement , but result the same. So, I believe it's not the problem of (buffer-string) ------------------------------- (defun startup (check-command wanted start-command) "check whether the 'wanted' state satisfied, if not, launch the start-command" (interactive) (save-excursion (let* ((d-buf (get-buffer-create "diagnose")) (process-connection-type nil) (process-status (eval `(call-process (car check-command) nil d-buf t ,@(cdr check-command))))) (switch-to-buffer d-buf) (print `(,(buffer-modified-p) ,(buffer-size) ,(point-min) ,(point) ,(point-max)) d-buf) ;;(debug) (if (not (string-match wanted (buffer-string))) (progn (print (concat "starting command " (stringlist-to-string start-command " ")) d-buf) (eval `(start-process "start up" d-buf (car start-command) ,@(cdr start-command))) ) (print (concat wanted " matched! no need to start " (stringlist-to-string start-command " ")) d-buf) )))) and aux function (defun stringlist-to-string (list connector) "translate string list to string , cons using connector" (let ((result "")) (mapcar (lambda (string) (setq result (concat result string connector)) ) list) (substring result 0 -1))) On 5/29/07, Thien-Thi Nguyen wrote: > > () "Yu,Gang" > () Tue, 29 May 2007 14:12:46 +0800 > > How can I solve the problem? thanks > > determine the current buffer at the moment `(buffer-string)' is > evaluated. if it is not as you expect, learn how to make it so. > > thi > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs > -- YuGang