From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniele Nicolodi Subject: Re: org-link interface Date: Thu, 13 Oct 2016 12:08:48 -0600 Message-ID: References: <44bd1778-3b7f-4507-c949-7825552cb871@grinta.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bukR5-0008BQ-Tp for emacs-orgmode@gnu.org; Thu, 13 Oct 2016 14:08:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bukR1-0007Yw-IZ for emacs-orgmode@gnu.org; Thu, 13 Oct 2016 14:08:54 -0400 Received: from zed.grinta.net ([109.74.203.128]:59162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bukR1-0007Yj-9L for emacs-orgmode@gnu.org; Thu, 13 Oct 2016 14:08:51 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: John Kitchin Cc: emacs-orgmode@gnu.org On 10/13/16 12:02 PM, John Kitchin wrote: > I do not know if you can do that. I would do something like this. > > (defun insert-foo-link (path) > (interactive "sfoo path: ") > (insert (format "[[foo:%s][%s]]" path path))) This has the drawback that it requires a different key-bind, instead than using the org standard interface. If it is not possible to teach org-insert-link to do that, it would be an useful addition, I think. It looks like it is possible to hook into org-store-link to derive a description from the link type and path, but the same is not possible with org-insert-link. I may propose a patch to add this. Cheers, Daniele > > Daniele Nicolodi writes: > >> On 10/13/16 8:14 AM, John Kitchin wrote: >>> In org8, this is not that easy to do, but not impossible. >>> >>> Why do not you want to use [[foo:bar][bar]]? >> >> Hi John, >> >> I'm fine using [[foo:bar][bar]], but it is much longer to type. >> >> Slightly changing my question: there is a way to instruct >> org-insert-link to derive a default value for the description from the >> path? I had a look at the code, and it does not seem so. >> >> Thanks! >> >> Cheers, >> Daniele >> >> >>> Daniele Nicolodi writes: >>> >>>> Hello, >>>> >>>> I would like to add a new link type to org-mode. Following the example >>>> in the manual it is a very easy task. However I would like to customize >>>> how the link is visualized, specifically I would like a link like >>>> "[[foo:bar]]" to be visualized simply as "bar" where the protocol type >>>> has been hidden (same effect I would obtain with a link in the form >>>> "[[foo:bar][bar]]". >>>> >>>> Is it possible to hook somehow into org-mode to have that transformation >>>> done, or there is an easy way to accomplish that? >>>> >>>> Thank you! >>>> >>>> Cheers, >>>> Daniele >>> >>> > >