Re: [O] abbreviations of link-type "file"

2016-09-10 Thread Nicolas Goaziou
Hello,

Martin Carlé  writes:

> Now only the :help-echo, not being triggered by an abbreviated link,
> remains still an issue as demonstrated by the ECM below.

I cannot reproduce it, so I assume this is fixed.

> I shall consider your suggestion. However, I like the application-link
> feature for its convenience not being forced to duplicate quite some
> code in the :follow and :store functions.

I'm not sure what you mean here.


Regards,

-- 
Nicolas Goaziou



Re: [O] abbreviations of link-type "file"

2016-08-21 Thread Martin Carlé
Thank your for taking up this quick posting.

While writing up the attached 'Exemple Complet Minimal', the
parsing turned out to work well.

Now only the :help-echo, not being triggered by an abbreviated link,
remains still an issue as demonstrated by the ECM below.


I shall consider your suggestion. However, I like the application-link
feature for its convenience not being forced to duplicate quite some
code in the :follow and :store functions.

Best,
mc


Demonstrate parsing of an abbreviated link:


Define the link
#+begin_src emacs-lisp
  (org-link-set-parameters "file+my-lengthy-application-link"
 :help-echo "help-echo not showing, if mouse is on abbreviated link!")
#+end_src

#+RESULTS:


Set some abbreviations
#+begin_src emacs-lisp
  (setq org-link-abbrev-alist
'(
  ("_" . "file+my-lengthy-application-link:::%s")
  ("__" . "file+my-lengthy-application-link:%s")
  ))
#+end_src

#+RESULTS:
: ((_ . file+my-lengthy-application-link:::%s) (__ . file+my-lengthy-application-link:%s))



* in-buffer links


the plain link: [[file+my-lengthy-application-link:::goto_in_buffer_target]]

=check :help-echo by mouse roll-over=

the abbreviated link: [[_:goto_in_buffer_target]]



* links with a relative path

to ~./someFile.org~


the plain link: [[file+my-lengthy-application-link:./someFile.org::goto_target]]

=check :help-echo by mouse roll-over=

the abbreviated link: [[__:./someFile.org::goto_target]]



* goto_in_buffer_target
a link target


* parse the links in this buffer
#+begin_src emacs-lisp :results verbatim
  (org-element-map (org-element-parse-buffer) 'link
(lambda (el)
  ;; (message "link: %s" (org-element-type el))
  (let* ((link (org-element-context el))
 (path (org-link-unescape (org-element-property :path link)))
 (option (org-element-property :search-option link)))
 (message "path: %s \noption: %s \n\n" path option)
 )))
#+end_src

#+RESULTS:
#+begin_example
("path:
option: goto_in_buffer_target

" "path:
option: goto_in_buffer_target

" "path: ./someFile.org
option: goto_target

" "path: ./someFile.org
option: goto_target

")
#+end_example
* goto_target
another link target


On 2016-08-21 Sun 09:32, Nicolas Goaziou wrote:

> Hello,
>
> mc  writes:
>
>> As we talk about link abbreviations, another issue might add some useful 
>> information:
>>
>> links of link-type "file" (e.g. "file+new-link"), if follow via an
>> abbreviation, is not parsed correctly:
>
> I suggest to avoid using so called "application" links, i.e.,
> type+application syntax as it may be ditched at some point. You can
> define a new link type instead, e.g., "newlink" or "applink".
>
> In any case, could you provide an ECM?
>
> Thank you.
>
> Regards,


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


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] abbreviations of link-type "file"

2016-08-21 Thread Nicolas Goaziou
Hello,

mc  writes:

> As we talk about link abbreviations, another issue might add some useful 
> information:
>
> links of link-type "file" (e.g. "file+new-link"), if follow via an
> abbreviation, is not parsed correctly:

I suggest to avoid using so called "application" links, i.e.,
type+application syntax as it may be ditched at some point. You can
define a new link type instead, e.g., "newlink" or "applink".

In any case, could you provide an ECM?

Thank you.

Regards,

-- 
Nicolas Goaziou



[O] abbreviations of link-type "file"

2016-08-20 Thread mc
As we talk about link abbreviations, another issue might add some useful 
information:

links of link-type "file" (e.g. "file+new-link"), if follow via an 
abbreviation, is not parsed correctly:

The element property :path is always an empty string while the whole string 
ends up as the :search-option.

Best,
mc

smime.p7s
Description: S/MIME cryptographic signature