Open winny- opened 8 years ago
This is probably because I'm using read-file-name
. I used to have it so that a prefix key would instead make transmission-add use read-string
(now a prefix key prompts for download directory) because yanking arch's magnet link into the prompt would do this nonsense because of the forward slashes.
Does it happen if you, for instance, move your emacs.d so there's no tramp history around and do the same thing? I have not encountered this, but I also never use tramp. Edit: I repro'd
OK, so this isn't really a bug, just annoying. I actually experienced the same thing in the past and just worked around it by either pasting into M-:
or the scratch buffer. In any case, there seems to be no simple way to temporarily disable tramp. Even if it was possible, doing so would preclude using tramp to add remote files, which is a pretty nifty use of tramp.
Reverting back to the previous behavior, which was to use read-string
instead of read-file-name
when a prefix key is used, is not an option for me because I think the new behaviour of adding prompts with a prefix key is better (plus, it was a feature request).
I will try to deal with this by teaching transmission-add
default arguments; that is, it will try to guess torrents at point: URLs, file names, or info hashes. I suppose this could be extended to look at the kill ring as well.
Hey, thanks for looking into this. That is a neat use for TRAMP. It sounds like a good idea to guess what the arg to transmission-add
actually is.
By the way, I added this to my init.el
, and it seems to work perfectly:
(add-hook 'transmission-mode-hook
(lambda ()
(local-set-key
(kbd "A")
(lambda ()
(interactive)
(transmission-add (read-string "Magnet URI: "))))))
(define-key transmission-mode-map (kbd "A")
(lambda ()
(interactive)
(transmission-add (read-string "Magnet URI: "))))
No need for a hook just set the key for the mode. Should do the same, except dont waste a few cpu cycles each time you switch to transmission.
A question can you set the normal transmission standart path to nil? so that the prompt is empty? Have to delete it always.
A question can you set the normal transmission standart path to nil? so that the prompt is empty? Have to delete it always.
let-binding default-directory
to the empty string seems sufficient.
@spiderbit that looks much cleaner, thanks for pointing that out!
Not sure what's going on here. I have used magnets for weeks now, and haven't had this odd behavior happen to me before:
Steps to reproduce
M-x transmission
.a
to add a new torrent.magnet:?xt=urn:btih:09e37f73e51f403bb543517f0d0a2e1283d61eb0&dn=archlinux-2015.12.01-dual.iso&tr=udp://tracker.archlinux.org:6969&tr=http://tracker.archlinux.org:6969/announce
from the Archlinux download page.Expected result
transmission-mode
adds the torrent, ignoring any sort of TRAMP shenanigans.Gif of the issue