[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: comint or start-process
From: |
Kevin Rodgers |
Subject: |
Re: comint or start-process |
Date: |
Thu, 10 Dec 2009 20:58:31 -0700 |
User-agent: |
Thunderbird 2.0.0.23 (Macintosh/20090812) |
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