emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* new link parameters and link abbreviations
       [not found] <m1a8g992vh.fsf@aiguphonie.com>
@ 2016-08-19  4:13 ` mc
  2016-08-20 14:17   ` John Kitchin
  0 siblings, 1 reply; 7+ messages in thread
From: mc @ 2016-08-19  4:13 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

The new link parameters are fabulous!

Only the parameter ':help-echo' seems not to be respected, if a link is used by an abbreviated form as defined by the 'org-link-abbrev-alist'.

Would be nice, if this could be fixed.

Anyway, thank you for this big step forward,
mc

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2667 bytes --]

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

* Re: new link parameters and link abbreviations
  2016-08-19  4:13 ` new link parameters and link abbreviations mc
@ 2016-08-20 14:17   ` John Kitchin
  2016-08-20 14:55     ` mc
  0 siblings, 1 reply; 7+ messages in thread
From: John Kitchin @ 2016-08-20 14:17 UTC (permalink / raw)
  To: mc; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

that isn't a feature I have used too often. Could you post a small example
that illustrates the problem? Thanks,

John

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


On Fri, Aug 19, 2016 at 12:13 AM, mc <mc@aiguphonie.com> wrote:

> The new link parameters are fabulous!
>
> Only the parameter ':help-echo' seems not to be respected, if a link is
> used by an abbreviated form as defined by the 'org-link-abbrev-alist'.
>
> Would be nice, if this could be fixed.
>
> Anyway, thank you for this big step forward,
> mc

[-- Attachment #2: Type: text/html, Size: 1293 bytes --]

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

* Re: new link parameters and link abbreviations
  2016-08-20 14:17   ` John Kitchin
@ 2016-08-20 14:55     ` mc
  2016-08-23  1:03       ` John Kitchin
  0 siblings, 1 reply; 7+ messages in thread
From: mc @ 2016-08-20 14:55 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode@gnu.org


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

Yes, with pleasure:

Let's put it the most simple way:


1. Here is my new-link definition:

#+begin_src emacs-lisp
  (org-link-set-parameters "new-link" :help-echo "show new-link's help echo")
#+end_src

(it doesn't change matter, if there would be :follow or :store function etc.)


2. the 'tooltip' shows my :help-echo string as expected.

[[new-link:awesome]]


3. Then I add the following abbreviation of the above link:

#+begin_src emacs-lisp
  (setq org-link-abbrev-alist '(("nl" . "new-link::%s")))
#+end_src


4. the 'tooltip' does not work but shows the default:

[[nl:awesome]]


Hope that clarifies the issue.


Thanks once more for your sustained patience making link handling much
easier and more powerful!
mc



> On 20 Aug 2016, at 17:17, John Kitchin <jkitchin@andrew.cmu.edu> wrote:
> 
> that isn't a feature I have used too often. Could you post a small example that illustrates the problem? Thanks,
> 
> John
> 
> -----------------------------------
> 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 <http://kitchingroup.cheme.cmu.edu/>
> 
> 
> On Fri, Aug 19, 2016 at 12:13 AM, mc <mc@aiguphonie.com <mailto:mc@aiguphonie.com>> wrote:
> The new link parameters are fabulous!
> 
> Only the parameter ':help-echo' seems not to be respected, if a link is used by an abbreviated form as defined by the 'org-link-abbrev-alist'.
> 
> Would be nice, if this could be fixed.
> 
> Anyway, thank you for this big step forward,
> mc
> 


[-- Attachment #1.2: Type: text/html, Size: 3820 bytes --]

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2667 bytes --]

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

* Re: new link parameters and link abbreviations
  2016-08-20 14:55     ` mc
@ 2016-08-23  1:03       ` John Kitchin
  2016-08-23  6:25         ` Martin Carlé
  2016-08-23  7:44         ` Nicolas Goaziou
  0 siblings, 2 replies; 7+ messages in thread
From: John Kitchin @ 2016-08-23  1:03 UTC (permalink / raw)
  To: mc; +Cc: emacs-orgmode@gnu.org

I can confirm this happens. I think it happens because the abbreviation
is not listed in org-plain-link-re, so when the bracket link is
activated, no type is ever defined (it is done by a group in the
org-plain-link-re). The type is somewhat fundamental to the activation
function, as it is used to look up all the link properties, and hence
you get the default help (and all other properties too).

I haven't thought of a simple fix though. It would involve adding the
abbreviations to the known link types, and some kind of lookup for when
the type in a link is not in org-link-parameters that resolves the type
to something in org-link-parameters. Since the abbreviations seem to
have quite flexible format, it isn't obvious how to do that robustly,
without changing the abbreviation syntax. 

I would suggest just defining short links ;) It seems like you can
probably build the abbreviation functionality into the follow function
right?


mc writes:

> Yes, with pleasure:
>
> Let's put it the most simple way:
>
>
> 1. Here is my new-link definition:
>
> #+begin_src emacs-lisp
>   (org-link-set-parameters "new-link" :help-echo "show new-link's help echo")
> #+end_src
>
> (it doesn't change matter, if there would be :follow or :store function etc.)
>
>
> 2. the 'tooltip' shows my :help-echo string as expected.
>
> [[new-link:awesome]]
>
>
> 3. Then I add the following abbreviation of the above link:
>
> #+begin_src emacs-lisp
>   (setq org-link-abbrev-alist '(("nl" . "new-link::%s")))
> #+end_src
>
>
> 4. the 'tooltip' does not work but shows the default:
>
> [[nl:awesome]]
>
>
> Hope that clarifies the issue.
>
>
> Thanks once more for your sustained patience making link handling much
> easier and more powerful!
> mc
>
>
>
>> On 20 Aug 2016, at 17:17, John Kitchin <jkitchin@andrew.cmu.edu> wrote:
>> 
>> that isn't a feature I have used too often. Could you post a small example that illustrates the problem? Thanks,
>> 
>> John
>> 
>> -----------------------------------
>> 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 <http://kitchingroup.cheme.cmu.edu/>
>> 
>> 
>> On Fri, Aug 19, 2016 at 12:13 AM, mc <mc@aiguphonie.com <mailto:mc@aiguphonie.com>> wrote:
>> The new link parameters are fabulous!
>> 
>> Only the parameter ':help-echo' seems not to be respected, if a link is used by an abbreviated form as defined by the 'org-link-abbrev-alist'.
>> 
>> Would be nice, if this could be fixed.
>> 
>> Anyway, thank you for this big step forward,
>> mc
>> 


-- 
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] 7+ messages in thread

* Re: new link parameters and link abbreviations
  2016-08-23  1:03       ` John Kitchin
@ 2016-08-23  6:25         ` Martin Carlé
  2016-08-23  7:44         ` Nicolas Goaziou
  1 sibling, 0 replies; 7+ messages in thread
From: Martin Carlé @ 2016-08-23  6:25 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 3591 bytes --]

Thank you for this confirmation of the abbreviation issue. 

> I would suggest just defining short links ;)

Well, there are limits to this approach e.g. file+mnl {mnl = myNewLink}.
Furthermore, link definitions then tend to become pretty cryptic :-(.

Optimally, the 'org-link-abbrev-alist' could (optionally) even been made
buffer-local, in order to safe typing efforts in different work context.

I wouldn't mind changing the abbreviation syntax, if necessary.

> It seems like you can probably build the abbreviation functionality into the follow function
> right?

Don't really get what you mean by this.


On 2016-08-23 Tue 01:03, John Kitchin wrote:

> I can confirm this happens. I think it happens because the abbreviation
> is not listed in org-plain-link-re, so when the bracket link is
> activated, no type is ever defined (it is done by a group in the
> org-plain-link-re). The type is somewhat fundamental to the activation
> function, as it is used to look up all the link properties, and hence
> you get the default help (and all other properties too).
>
> I haven't thought of a simple fix though. It would involve adding the
> abbreviations to the known link types, and some kind of lookup for when
> the type in a link is not in org-link-parameters that resolves the type
> to something in org-link-parameters. Since the abbreviations seem to
> have quite flexible format, it isn't obvious how to do that robustly,
> without changing the abbreviation syntax. 
>
> I would suggest just defining short links ;) It seems like you can
> probably build the abbreviation functionality into the follow function
> right?
>
>
> mc writes:
>
>> Yes, with pleasure:
>>
>> Let's put it the most simple way:
>>
>>
>> 1. Here is my new-link definition:
>>
>> #+begin_src emacs-lisp
>>   (org-link-set-parameters "new-link" :help-echo "show new-link's help echo")
>> #+end_src
>>
>> (it doesn't change matter, if there would be :follow or :store function etc.)
>>
>>
>> 2. the 'tooltip' shows my :help-echo string as expected.
>>
>> [[new-link:awesome]]
>>
>>
>> 3. Then I add the following abbreviation of the above link:
>>
>> #+begin_src emacs-lisp
>>   (setq org-link-abbrev-alist '(("nl" . "new-link::%s")))
>> #+end_src
>>
>>
>> 4. the 'tooltip' does not work but shows the default:
>>
>> [[nl:awesome]]
>>
>>
>> Hope that clarifies the issue.
>>
>>
>> Thanks once more for your sustained patience making link handling much
>> easier and more powerful!
>> mc
>>
>>
>>
>>> On 20 Aug 2016, at 17:17, John Kitchin <jkitchin@andrew.cmu.edu> wrote:
>>> 
>>> that isn't a feature I have used too often. Could you post a small example that illustrates the problem? Thanks,
>>> 
>>> John
>>> 
>>> -----------------------------------
>>> 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 <http://kitchingroup.cheme.cmu.edu/>
>>> 
>>> 
>>> On Fri, Aug 19, 2016 at 12:13 AM, mc <mc@aiguphonie.com <mailto:mc@aiguphonie.com>> wrote:
>>> The new link parameters are fabulous!
>>> 
>>> Only the parameter ':help-echo' seems not to be respected, if a link is used by an abbreviated form as defined by the 'org-link-abbrev-alist'.
>>> 
>>> Would be nice, if this could be fixed.
>>> 
>>> Anyway, thank you for this big step forward,
>>> mc
>>> 


-- 
Fetch my gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 7E3CA33F

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 805 bytes --]

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

* Re: new link parameters and link abbreviations
  2016-08-23  1:03       ` John Kitchin
  2016-08-23  6:25         ` Martin Carlé
@ 2016-08-23  7:44         ` Nicolas Goaziou
  2016-08-23  9:20           ` Martin Carlé
  1 sibling, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2016-08-23  7:44 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode@gnu.org, mc

Hello,

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> I can confirm this happens. I think it happens because the abbreviation
> is not listed in org-plain-link-re, so when the bracket link is
> activated, no type is ever defined (it is done by a group in the
> org-plain-link-re). The type is somewhat fundamental to the activation
> function, as it is used to look up all the link properties, and hence
> you get the default help (and all other properties too).
>
> I haven't thought of a simple fix though. It would involve adding the
> abbreviations to the known link types, and some kind of lookup for when
> the type in a link is not in org-link-parameters that resolves the type
> to something in org-link-parameters. Since the abbreviations seem to
> have quite flexible format, it isn't obvious how to do that robustly,
> without changing the abbreviation syntax.

I pushed a simple fix as 112463cbffb8bec7ec318c27d3b862e9ddcf76f3 that
avoids extending `org-plain-link-re'. Link abbreviation is limited to
bracket links whereas `org-link-parameters' helps defining plain links.

Let me know if it isn't a sufficient solution.


Regards,

-- 
Nicolas Goaziou

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

* Re: new link parameters and link abbreviations
  2016-08-23  7:44         ` Nicolas Goaziou
@ 2016-08-23  9:20           ` Martin Carlé
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Carlé @ 2016-08-23  9:20 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org, John Kitchin

[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]

Great! I'd think that shall do.

Thank you for this fast fix!

On 2016-08-23 Tue 07:44, Nicolas Goaziou wrote:

> Hello,
>
> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> I can confirm this happens. I think it happens because the abbreviation
>> is not listed in org-plain-link-re, so when the bracket link is
>> activated, no type is ever defined (it is done by a group in the
>> org-plain-link-re). The type is somewhat fundamental to the activation
>> function, as it is used to look up all the link properties, and hence
>> you get the default help (and all other properties too).
>>
>> I haven't thought of a simple fix though. It would involve adding the
>> abbreviations to the known link types, and some kind of lookup for when
>> the type in a link is not in org-link-parameters that resolves the type
>> to something in org-link-parameters. Since the abbreviations seem to
>> have quite flexible format, it isn't obvious how to do that robustly,
>> without changing the abbreviation syntax.
>
> I pushed a simple fix as 112463cbffb8bec7ec318c27d3b862e9ddcf76f3 that
> avoids extending `org-plain-link-re'. Link abbreviation is limited to
> bracket links whereas `org-link-parameters' helps defining plain links.
>
> Let me know if it isn't a sufficient solution.
>
>
> Regards,


-- 
Fetch my gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 7E3CA33F

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 805 bytes --]

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

end of thread, other threads:[~2016-08-23  9:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m1a8g992vh.fsf@aiguphonie.com>
2016-08-19  4:13 ` new link parameters and link abbreviations mc
2016-08-20 14:17   ` John Kitchin
2016-08-20 14:55     ` mc
2016-08-23  1:03       ` John Kitchin
2016-08-23  6:25         ` Martin Carlé
2016-08-23  7:44         ` Nicolas Goaziou
2016-08-23  9:20           ` Martin Carlé

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