help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: process communication help


From: Yu,Gang
Subject: Re: process communication help
Date: Tue, 29 May 2007 17:08:27 +0800

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 < address@hidden> wrote:
() "Yu,Gang" < address@hidden>
() 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
address@hidden
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs



--
YuGang
reply via email to

[Prev in Thread] Current Thread [Next in Thread]