[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Help with org-link-translation-function
From: |
David Maus |
Subject: |
Re: [Orgmode] Help with org-link-translation-function |
Date: |
Sun, 16 Jan 2011 11:15:49 +0100 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.2 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
At Tue, 4 Jan 2011 05:40:30 -0600,
Leo Alekseyev wrote:
>
> Hi All,
> I am trying to achieve the following: any link of the form
> [[/ssh:host:/path/to/file]] should, when followed, be translated to
> [[/plink:host:/path/to/file]] (without being textually altered, of
> course).
>
> The reason for this is that Emacs Tramp under Windows refuses to
> cooperate with OpenSSH and can't handle SSH links. The only
> workaround I've found is to use the plink protocol instead of SSH.
>
> I think what I'm trying to achieve is possible with
> org-link-translation-function, but my naive attempts haven't been
> successful... Any help would be greatly appreciated!
Maybe this might help:
(defun dmaus/org-mode/org-link-ssh-to-plink (type path)
"Return plink: link with PATH if TYPE is ssh."
(cons type (if (string-match "/ssh:" path)
(replace-match "/plink:" nil nil path)
path)))
(setq org-link-translation-function 'dmaus/org-mode/org-link-ssh-to-plink)
HTH,
-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden
pgpyhiokTqBj3.pgp
Description: PGP signature