unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Sql-mode calls tramp for no reason
@ 2013-10-23  3:26 Nikolay Kudryavtsev
  2013-10-23  6:26 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolay Kudryavtsev @ 2013-10-23  3:26 UTC (permalink / raw)
  To: help-gnu-emacs

Hello.

Is there any way to force sql-product-interactive to run sql program on 
local machine only?

After I use tramp for some time and then call sql-product-interactive it 
tries to run sql program on one of the open tramp connections, instead 
of my local machine. It does not matter if I call it while having dired 
open on local machine or even local sql file open. Even calling M-x cd 
beforehand does not help. It still tries to run sql program on a host 
over tramp. After some sequence of actions that I haven't fully figured 
out, it finally goes away and uses local machine paths.

-- 
Best Regards,
Nikolay Kudryavtsev




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sql-mode calls tramp for no reason
  2013-10-23  3:26 Sql-mode calls tramp for no reason Nikolay Kudryavtsev
@ 2013-10-23  6:26 ` Michael Albinus
  2013-10-24 14:40   ` Nikolay Kudryavtsev
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2013-10-23  6:26 UTC (permalink / raw)
  To: Nikolay Kudryavtsev; +Cc: help-gnu-emacs

Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com> writes:

> Hello.

Hi,

> Is there any way to force sql-product-interactive to run sql program
> on local machine only?
>
> After I use tramp for some time and then call sql-product-interactive
> it tries to run sql program on one of the open tramp connections,
> instead of my local machine. It does not matter if I call it while
> having dired open on local machine or even local sql file open. Even
> calling M-x cd beforehand does not help. It still tries to run sql
> program on a host over tramp. After some sequence of actions that I
> haven't fully figured out, it finally goes away and uses local machine
> paths.

I don't know sql.el, but it looks like it uses comint. When a new sql call
is run, comint uses either the local host or the remote one, depending
on default-directory of the current buffer.

Further calls of sql-product-interactive seem to reuse the buffer, its
name is kept in the variable sql-buffer.

Maybe you could add some code via sql-set-sqli-hook. Something like
(completely untested):

;; Force sql-product-interactive to run on the local host.
(add-hook 'sql-set-sqli-hook (lambda () (setq default-directory "/")))

Best regards, Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sql-mode calls tramp for no reason
  2013-10-23  6:26 ` Michael Albinus
@ 2013-10-24 14:40   ` Nikolay Kudryavtsev
  2013-10-24 15:00     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolay Kudryavtsev @ 2013-10-24 14:40 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

Yeah, sql.el is based on comint.

Tested that hook. It does not work.

Thanks for the help anyway.

-- 
Best Regards,
Nikolay Kudryavtsev




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sql-mode calls tramp for no reason
  2013-10-24 14:40   ` Nikolay Kudryavtsev
@ 2013-10-24 15:00     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2013-10-24 15:00 UTC (permalink / raw)
  To: Nikolay Kudryavtsev; +Cc: help-gnu-emacs

Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com> writes:

> Yeah, sql.el is based on comint.
>
> Tested that hook. It does not work.

You could write an own function, which let-binds default-directory to a
local dir, and calls sql-product-interactive then.

Or you advice sql-product-interactive accordingly (see the Elisp manual
how to do this).

> Thanks for the help anyway.

Best regards, Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-24 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23  3:26 Sql-mode calls tramp for no reason Nikolay Kudryavtsev
2013-10-23  6:26 ` Michael Albinus
2013-10-24 14:40   ` Nikolay Kudryavtsev
2013-10-24 15:00     ` Michael Albinus

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).