all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Help with org-link-translation-function
@ 2011-01-04 11:40 Leo Alekseyev
  2011-01-16 10:15 ` David Maus
  0 siblings, 1 reply; 2+ messages in thread
From: Leo Alekseyev @ 2011-01-04 11:40 UTC (permalink / raw)
  To: emacs-orgmode

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!

--Leo

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

* Re: Help with org-link-translation-function
  2011-01-04 11:40 Help with org-link-translation-function Leo Alekseyev
@ 2011-01-16 10:15 ` David Maus
  0 siblings, 0 replies; 2+ messages in thread
From: David Maus @ 2011-01-16 10:15 UTC (permalink / raw)
  To: Leo Alekseyev; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1074 bytes --]

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.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2011-01-16 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-04 11:40 Help with org-link-translation-function Leo Alekseyev
2011-01-16 10:15 ` David Maus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.