From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: new link parameters and link abbreviations Date: Mon, 22 Aug 2016 21:03:59 -0400 Message-ID: References: <6BCC30BB-2488-4BA2-8661-8C6AF99061C6@aiguphonie.com> <8861C3F7-1B34-4752-9935-1F0ED80136A2@aiguphonie.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bc09K-0001wg-GS for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 21:05:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bc09G-0004O0-7I for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 21:05:05 -0400 Received: from mail-qk0-f170.google.com ([209.85.220.170]:33408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bc09G-0004Nu-2s for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 21:05:02 -0400 Received: by mail-qk0-f170.google.com with SMTP id z190so94909776qkc.0 for ; Mon, 22 Aug 2016 18:05:02 -0700 (PDT) In-reply-to: <8861C3F7-1B34-4752-9935-1F0ED80136A2@aiguphonie.com> 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: 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 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 >> >> >> On Fri, Aug 19, 2016 at 12:13 AM, mc > 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