unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Find file locally from Tramp buffer
@ 2016-01-06 19:35 Alexander Shukaev
  2016-01-07  8:42 ` tomas
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Shukaev @ 2016-01-06 19:35 UTC (permalink / raw)
  To: help-gnu-emacs

Hey everyone,

Suppose I run builds on a dedicated build machine with `compile' via 
Tramp.  When there is an error displayed and one follows it, clearly 
Emacs tries to access the corresponding file remotely.  But in my case, 
I have mounted the same source code directory structure as is on the 
build machine in order to develop the code locally.  Hence, it would be 
nice to somehow teach Emacs to first probe whether it can access the 
corresponding file locally, and if not, fallback to accessing it 
remotely via Tramp.  It would also be nice if the implementation of this 
feature would apply not only to compilation buffers, but would be rather 
located on a lower level to intercept all file finding requests from 
Tramp buffers.

I do realize that the use case is very special and is not meant for 
broad audience, so this should not be considered as a feature request. 
That is I merely want to know how to implement it properly on my own. 
Any suggestions or ideas on improvement or generalization of this idea 
are very welcome.

Kind regards,
Alexander



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

* Re: Find file locally from Tramp buffer
  2016-01-06 19:35 Find file locally from Tramp buffer Alexander Shukaev
@ 2016-01-07  8:42 ` tomas
  2016-01-07 20:14   ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: tomas @ 2016-01-07  8:42 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Jan 06, 2016 at 08:35:52PM +0100, Alexander Shukaev wrote:
> Hey everyone,
> 
> Suppose I run builds on a dedicated build machine with `compile' via
> Tramp. [...]
> it would be nice to somehow teach Emacs to first probe whether it
> can access the corresponding file locally, and if not, fallback to
> accessing it remotely via Tramp [...]

> I do realize that the use case is very special and is not meant for
> broad audience [...]

This isn't as crazy as it sounds. Actually I would have had use for
that from time to time.

Kind of a file name mapping layer (perhaps the local files have a
somewhat different path, typically one could get away by re-mapping
some stem of the complete path).

Hmmm.

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlaOJP0ACgkQBcgs9XrR2kZdZACfbwo5+2ycpsQwde+Pi31APu7B
SO8AnR+uLdAPNemGEFQj1pVlHoXrEdAo
=/PD+
-----END PGP SIGNATURE-----



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

* Re: Find file locally from Tramp buffer
  2016-01-07  8:42 ` tomas
@ 2016-01-07 20:14   ` Michael Albinus
  2016-01-08  7:54     ` tomas
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2016-01-07 20:14 UTC (permalink / raw)
  To: tomas; +Cc: help-gnu-emacs

<tomas@tuxteam.de> writes:

> On Wed, Jan 06, 2016 at 08:35:52PM +0100, Alexander Shukaev wrote:
>> Hey everyone,
>>
>> Suppose I run builds on a dedicated build machine with `compile' via
>> Tramp. [...]
>> it would be nice to somehow teach Emacs to first probe whether it
>> can access the corresponding file locally, and if not, fallback to
>> accessing it remotely via Tramp [...]
>
>> I do realize that the use case is very special and is not meant for
>> broad audience [...]
>
> This isn't as crazy as it sounds. Actually I would have had use for
> that from time to time.
>
> Kind of a file name mapping layer (perhaps the local files have a
> somewhat different path, typically one could get away by re-mapping
> some stem of the complete path).

In the compilation buffer, the buffer-local variable `default-directory'
points to the remote directory. If you change it to the corresponding
local directory path, it could do the trick. Just call in that buffer
"M-x cd".

> regards
> -- t

Best regards, Michael.



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

* Re: Find file locally from Tramp buffer
  2016-01-07 20:14   ` Michael Albinus
@ 2016-01-08  7:54     ` tomas
  0 siblings, 0 replies; 4+ messages in thread
From: tomas @ 2016-01-08  7:54 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Jan 07, 2016 at 09:14:21PM +0100, Michael Albinus wrote:
> <tomas@tuxteam.de> writes:

[...]

> > Kind of a file name mapping layer [...]

> In the compilation buffer, the buffer-local variable `default-directory'
> points to the remote directory. If you change it to the corresponding
> local directory path, it could do the trick. Just call in that buffer
> "M-x cd".

Wow, thanks Michael. Will have to give that a try :-)

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlaPaywACgkQBcgs9XrR2kbwKgCfYZDTs/EmTsNUpfu/YVfN3gwC
Ip0AnAw7wXR9H7tk71ErB1X1sjdmwfyc
=vn1t
-----END PGP SIGNATURE-----



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

end of thread, other threads:[~2016-01-08  7:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-06 19:35 Find file locally from Tramp buffer Alexander Shukaev
2016-01-07  8:42 ` tomas
2016-01-07 20:14   ` Michael Albinus
2016-01-08  7:54     ` tomas

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