all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* abbreviations of link-type "file"
@ 2016-08-20 18:51 mc
  2016-08-21  9:32 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: mc @ 2016-08-20 18:51 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode@gnu.org

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

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

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

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

* Re: abbreviations of link-type "file"
  2016-08-20 18:51 abbreviations of link-type "file" mc
@ 2016-08-21  9:32 ` Nicolas Goaziou
  2016-08-21 22:38   ` Martin Carlé
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2016-08-21  9:32 UTC (permalink / raw)
  To: mc; +Cc: emacs-orgmode@gnu.org, John Kitchin

Hello,

mc <mc@aiguphonie.com> 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

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

* Re: abbreviations of link-type "file"
  2016-08-21  9:32 ` Nicolas Goaziou
@ 2016-08-21 22:38   ` Martin Carlé
  2016-09-10  9:41     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Carlé @ 2016-08-21 22:38 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org, John Kitchin


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

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



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: link_ECM.org --]
[-- Type: text/x-org, Size: 1749 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: someFile.org --]
[-- Type: text/x-org, Size: 34 bytes --]

* goto_target
another link target

[-- Attachment #1.4: Type: text/plain, Size: 674 bytes --]



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

> Hello,
>
> mc <mc@aiguphonie.com> 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

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

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

* Re: abbreviations of link-type "file"
  2016-08-21 22:38   ` Martin Carlé
@ 2016-09-10  9:41     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2016-09-10  9:41 UTC (permalink / raw)
  To: Martin Carlé; +Cc: emacs-orgmode@gnu.org, John Kitchin

Hello,

Martin Carlé <mc@aiguphonie.com> 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

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

end of thread, other threads:[~2016-09-10  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-20 18:51 abbreviations of link-type "file" mc
2016-08-21  9:32 ` Nicolas Goaziou
2016-08-21 22:38   ` Martin Carlé
2016-09-10  9:41     ` Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.