From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.help Subject: Re: Sql-mode calls tramp for no reason Date: Wed, 23 Oct 2013 08:26:13 +0200 Message-ID: <878uxkjyey.fsf@gmx.de> References: <526741FC.4010604@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1382509605 18554 80.91.229.3 (23 Oct 2013 06:26:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2013 06:26:45 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Nikolay Kudryavtsev Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 23 08:26:48 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VYru4-0004Tm-D3 for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Oct 2013 08:26:48 +0200 Original-Received: from localhost ([::1]:47907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYru3-0005ZD-Vz for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Oct 2013 02:26:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYrti-0005PP-O2 for help-gnu-emacs@gnu.org; Wed, 23 Oct 2013 02:26:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYrtZ-00043C-OV for help-gnu-emacs@gnu.org; Wed, 23 Oct 2013 02:26:26 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:57430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYrtZ-00042a-F4 for help-gnu-emacs@gnu.org; Wed, 23 Oct 2013 02:26:17 -0400 Original-Received: from detlef.gmx.de ([87.146.62.147]) by mail.gmx.com (mrgmx003) with ESMTPS (Nemesis) id 0M0gcI-1Vr4lk3bLy-00uuR4 for ; Wed, 23 Oct 2013 08:26:15 +0200 In-Reply-To: <526741FC.4010604@gmail.com> (Nikolay Kudryavtsev's message of "Wed, 23 Oct 2013 07:26:52 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V03:K0:VYEk98C253nsFEzKSY5tbPhnJxTNaONEOiJu05GVuL2O1LLEEro uv8C2B6NqTas4FmeqWpobMebKE8Gsq9oLP+cHnCUvZqwJ+GjjusvGjTnEAFQMY5k9t5pCNz eOZZMjGs7zuWv2vFvoSDtPLZ8/fh5HdmAEfIoOrkkwsDd7w0qrHHxMpU4TI0TWkYq5NtwJ6 Ikwv0TP93DhGMtP2BfLgg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.18 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94162 Archived-At: Nikolay Kudryavtsev 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.