From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin =?utf-8?Q?Carl=C3=A9?= Subject: Re: abbreviations of link-type "file" Date: Mon, 22 Aug 2016 01:38:32 +0300 Message-ID: References: <423A612C-90D6-4E92-9221-65E71E8E0C05@aiguphonie.com> <874m6e1n8d.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=sha256; protocol="application/pkcs7-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbbOE-0001O9-Ua for emacs-orgmode@gnu.org; Sun, 21 Aug 2016 18:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbbOA-0005aF-Ow for emacs-orgmode@gnu.org; Sun, 21 Aug 2016 18:38:49 -0400 Received: from mail.gispack.com ([212.204.56.78]:36826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbbOA-0005YZ-Ds for emacs-orgmode@gnu.org; Sun, 21 Aug 2016 18:38:46 -0400 In-reply-to: <874m6e1n8d.fsf@saiph.selenimh> 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: Nicolas Goaziou Cc: "emacs-orgmode@gnu.org" , John Kitchin --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-org Content-Disposition: attachment; filename=link_ECM.org 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 --=-=-= Content-Type: text/x-org Content-Disposition: attachment; filename=someFile.org * goto_target another link target --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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, =2D-=20 Fetch my gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 7E3CA33F --=-=-=-- --==-=-= Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 Content-Disposition: attach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