unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: comint or start-process
Date: Thu, 10 Dec 2009 20:58:31 -0700	[thread overview]
Message-ID: <hfsg13$qfq$1@ger.gmane.org> (raw)
In-Reply-To: <200912101200.nBAC0dWn001131@fed.local>

Xavier Maillard wrote:
> Ok. I have tried to get something but failed:
> 
>  (defun sqlite-connect (db)
>    (let ((sql-database db))
>      (sql-connect-sqlite)))
> 
>  (sqlite-connect "/tmp/foo.db")
>  (with-current-buffer (process-buffer (get-process "SQL")))
>    (sql-send-string "select * from foo;"))
> 
> =>
> 
> No SQL process started.
> 
> M-x list-process:
> 
> Proc	  Status   Buffer	 Tty	    Command
> ----	  ------   ------	 ---	    -------
> SQL	  run	   *SQL*	 /dev/pts/2 sqlite /tmp/foot.db
> 
> What is the problem ?

Use the source: "No SQL process started" is reported by sql-send-string
when (buffer-live-p sql-buffer) returns nil.  Usually, sql-buffer is
set by sql-product-interactive, which you have circumvented by calling
sql-connect-sqlite directly.

Perhaps all you need to do is:

(let ((sql-buffer (process-buffer (get-process "SQL"))))
   (with-current-buffer sql-buffer
     (sql-send-string "select * from foo;")))

-- 
Kevin Rodgers
Denver, Colorado, USA





      reply	other threads:[~2009-12-11  3:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09 23:29 comint or start-process Xavier Maillard
2009-12-10  3:00 ` Kevin Rodgers
2009-12-10  7:29   ` Xavier Maillard
2009-12-10 12:00   ` Xavier Maillard
2009-12-11  3:58     ` Kevin Rodgers [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='hfsg13$qfq$1@ger.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=help-gnu-emacs@gnu.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).