emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-link interface
@ 2016-10-11 22:48 Daniele Nicolodi
       [not found] ` <m2eg3kibdu.fsf@andrew.cmu.edu>
  0 siblings, 1 reply; 4+ messages in thread
From: Daniele Nicolodi @ 2016-10-11 22:48 UTC (permalink / raw)
  To: emacs-orgmode

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

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

* Re: org-link interface
       [not found] ` <m2eg3kibdu.fsf@andrew.cmu.edu>
@ 2016-10-13 16:23   ` Daniele Nicolodi
  2016-10-13 18:02     ` John Kitchin
  0 siblings, 1 reply; 4+ messages in thread
From: Daniele Nicolodi @ 2016-10-13 16:23 UTC (permalink / raw)
  To: John Kitchin, emacs-orgmode

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

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

* Re: org-link interface
  2016-10-13 16:23   ` Daniele Nicolodi
@ 2016-10-13 18:02     ` John Kitchin
  2016-10-13 18:08       ` Daniele Nicolodi
  0 siblings, 1 reply; 4+ messages in thread
From: John Kitchin @ 2016-10-13 18:02 UTC (permalink / raw)
  To: Daniele Nicolodi; +Cc: emacs-orgmode

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


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

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

* Re: org-link interface
  2016-10-13 18:02     ` John Kitchin
@ 2016-10-13 18:08       ` Daniele Nicolodi
  0 siblings, 0 replies; 4+ messages in thread
From: Daniele Nicolodi @ 2016-10-13 18:08 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode

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

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

end of thread, other threads:[~2016-10-13 18:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 22:48 org-link interface Daniele Nicolodi
     [not found] ` <m2eg3kibdu.fsf@andrew.cmu.edu>
2016-10-13 16:23   ` Daniele Nicolodi
2016-10-13 18:02     ` John Kitchin
2016-10-13 18:08       ` Daniele Nicolodi

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