From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: Building a database interface in Emacs Date: Wed, 20 Dec 2006 17:02:05 +0100 Message-ID: References: <1166629368.130069.193700@80g2000cwy.googlegroups.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1166632974 19724 80.91.229.10 (20 Dec 2006 16:42:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 20 Dec 2006 16:42:54 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 20 17:42:52 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gx4Wh-0005Gi-2p for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Dec 2006 17:42:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gx4Wg-0001XV-Me for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Dec 2006 11:42:42 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!news.germany.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-X-Trace: individual.net X/pDsbFKCQEqZulkdH3a4AF7oQaNHU6uipCr8VkZv2CM3PbJGZ User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (windows-nt) Cancel-Lock: sha1:pgWXh+TetnsA2HtF0KdvRXkjdYY= Original-Xref: shelby.stanford.edu gnu.emacs.help:144167 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:39772 Archived-At: "aartist" writes: > You might want to look at Widget and Skeleton. M-x Customize-browse > is one classic example, you might want to follow. I am afraid I did not express myself clearly enough; I am not so interested in the actual building of a form or similar, what I want to know is what the best way is to communicate with the database. I have read up on receiving data from an asynchronous process and there is one thing I have trouble with, how do I send input to the process and wait until I get output back, from the same function? An example: (defun foo () (process-send-string process "blabla") (wait-for-and-get-result) (use-the-result)) I can attach a process filter function to the process but I don't understand how to "pause" my main code until my filter function has been called. Well, I came up with a hack, that seems really ugly: (defvar foo-output nil) (defun foo () (process-send-string process "blabla") (setq foo-output nil) (while (not foo-output) (sleep-for 0 10)) (use-result)) (defun foo-filter (proc string) (setq foo-output string)) There must be a neater way to do this, right? /Mathias