emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Maus <dmaus@ictsoc.de>
To: Leo Alekseyev <dnquark@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Help with org-link-translation-function
Date: Sun, 16 Jan 2011 11:15:49 +0100	[thread overview]
Message-ID: <87tyh9upbe.wl%dmaus@ictsoc.de> (raw)
In-Reply-To: <AANLkTikiNbzESJKn_gi1W1BGzzyeNi8MifJg4RU-qV2G@mail.gmail.com>


[-- 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

      reply	other threads:[~2011-01-16 11:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 11:40 Help with org-link-translation-function Leo Alekseyev
2011-01-16 10:15 ` David Maus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tyh9upbe.wl%dmaus@ictsoc.de \
    --to=dmaus@ictsoc.de \
    --cc=dnquark@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

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