all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Yu,Gang" <wuhanyugang@gmail.com>
To: "Thien-Thi Nguyen" <ttn@gnuvola.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: process communication help
Date: Tue, 29 May 2007 17:08:27 +0800	[thread overview]
Message-ID: <48378d570705290208m5b13d036v3121d8e3679777e3@mail.gmail.com> (raw)
In-Reply-To: <878xb8kqje.fsf@ambire.localdomain>


[-- Attachment #1.1: Type: text/plain, Size: 1793 bytes --]

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 <ttn@gnuvola.org> wrote:
>
> () "Yu,Gang" <wuhanyugang@gmail.com>
> () 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

[-- Attachment #1.2: Type: text/html, Size: 2967 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

  reply	other threads:[~2007-05-29  9:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1377.1180419176.32220.help-gnu-emacs@gnu.org>
2007-05-29  8:00 ` process communication help Thien-Thi Nguyen
2007-05-29  9:08   ` Yu,Gang [this message]
2007-05-29 10:19     ` Yu,Gang
     [not found]   ` <mailman.1381.1180429716.32220.help-gnu-emacs@gnu.org>
2007-05-29 10:22     ` Thien-Thi Nguyen
2007-05-29 11:57       ` Yu,Gang
     [not found]       ` <mailman.1388.1180439874.32220.help-gnu-emacs@gnu.org>
2007-05-29 15:08         ` Thien-Thi Nguyen
2007-05-30  7:53           ` Yu,Gang
2007-05-29  6:12 Yu,Gang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48378d570705290208m5b13d036v3121d8e3679777e3@mail.gmail.com \
    --to=wuhanyugang@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=ttn@gnuvola.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.