Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tramp related execution #59

Closed
spiderbit opened this issue Nov 27, 2016 · 6 comments
Closed

tramp related execution #59

spiderbit opened this issue Nov 27, 2016 · 6 comments
Labels
need info Can't address the problem wihtout more information

Comments

@spiderbit
Copy link

I have following problem:

I use request to send a json message to a webserver in my lan. I have set that to a Shortcut (F6)
Normaly that works just fine, but if I am in a Eshell window that is connected to another pc over ssh or in a open file that is on another pc accessed through tramp, it just refuses to work.

It looks to me that it tries to execute the curl program then on that pc or something like that?

Is there a way to overwrite the executable url to lets say /~ or /tmp or something like that?

to be more precise I am the author or the package:
https://github.com/spiderbit/kodi-remote.el

which is using request.el to send the json messages to kodi.

And I bound kodi-remote-music to F6:

(global-set-key (kbd "<f6>") 'kodi-remote-music)

@juergenhoetzel
Copy link
Contributor

Is there a way to overwrite the executable url to lets say /~ or /tmp or something like that?

to be more precise I am the author or the package:
https://github.com/spiderbit/kodi-remote.el

I ran into the same issue. Actually the Tramp support has some quirks:

  • curl backend is chosen even if it is not installed remotely: executable-find is evaluated locally to set the request-backend
  • Tramp support is not consistent: url-retrieve backend doesn't have Tramp support

You might just bind default-directory to enforce execution of curl on your local machine:

(let ((default-directory nil))
  (request "http://amazon-1d35745cb.fritz.box:8080"
	   :success (cl-function
		     (lambda (&key data &allow-other-keys)
		       (message "OK")))))

@titaniumbones
Copy link
Collaborator

Is there a way to overwrite the executable url to lets say /~ or /tmp or something like that?

to be more precise I am the author or the package:
https://github.com/spiderbit/kodi-remote.el

I ran into the same issue. Actually the Tramp support has some quirks:

  • curl backend is chosen even if it is not installed remotely: executable-find is evaluated locally to set the request-backend
  • Tramp support is not consistent: url-retrieve backend doesn't have Tramp support

You might just bind default-directory to enforce execution of curl on your local machine:

(let ((default-directory nil))
  (request "http://amazon-1d35745cb.fritz.box:8080"
	   :success (cl-function
		     (lambda (&key data &allow-other-keys)
		       (message "OK")))))

if you have a fix for this issue please feel free to submit a PR, even for the documentation ,and I will merge it!

@titaniumbones
Copy link
Collaborator

@spiderbit @juergenhoetzel does #82 fix your issue?

@titaniumbones titaniumbones added the need info Can't address the problem wihtout more information label Nov 30, 2018
@juergenhoetzel
Copy link
Contributor

@spiderbit @juergenhoetzel does #82 fix your issue?

I'm afraid not. #82: is about invalid use of internal tramp functions. This issue is about different
behavior when using request on remote hosts: curl is executed on the remote host (contrary to the url-retrieve backend).

if you have a fix for this issue please feel free to submit a PR, even for the documentation ,and I will merge it!

I will check it out.

Thanks for taking care of this nice Emacs package 👍

@juergenhoetzel
Copy link
Contributor

if you have a fix for this issue please feel free to submit a PR, even for the documentation ,and I will merge it!

IMO this issue can be closed, because Tramp support for curl is intended and there is no way to implement tramp support using the url-retrieve backend.

@titaniumbones
Copy link
Collaborator

thanks @juergenhoetzel -- sorry for the slow response. Closing this now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info Can't address the problem wihtout more information
Projects
None yet
Development

No branches or pull requests

3 participants