[Top][All Lists]

[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 18:19:59 +0800

Surprisely, this time, after I add

(switch-to-buffer d-buf)

it works now!!


On 5/29/07, Yu,Gang < address@hidden> wrote:

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"
    (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)
      (if (not (string-match wanted (buffer-string)))
        (print (concat "starting command " (stringlist-to-string start-command " ")) d-buf)
        (eval `(start-process "start up" d-buf (car start-command) ,@(cdr start-command)))
     (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.

help-gnu-emacs mailing list


reply via email to

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