From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: org link to OCaml comment Date: Thu, 6 Feb 2020 09:58:54 -0500 Message-ID: References: <87a75vu60w.fsf@polytechnique.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ab43e1059de983a1" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45860) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izicX-0005Nu-2B for emacs-orgmode@gnu.org; Thu, 06 Feb 2020 09:59:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izicV-0007ee-FU for emacs-orgmode@gnu.org; Thu, 06 Feb 2020 09:59:08 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:50590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1izicU-0007Tw-Uz for emacs-orgmode@gnu.org; Thu, 06 Feb 2020 09:59:07 -0500 Received: by mail-wm1-x32c.google.com with SMTP id a5so341585wmb.0 for ; Thu, 06 Feb 2020 06:59:06 -0800 (PST) In-Reply-To: <87a75vu60w.fsf@polytechnique.org> 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: Alan Schmitt Cc: emacs-orgmode --000000000000ab43e1059de983a1 Content-Type: text/plain; charset="UTF-8" I think you need to do it like this: #+BEGIN_SRC test.ml -r (* Object projection functions *) (ref:opf) #+END_SRC [[file:2020-02-05.org::(opf)]] The -r in the header removes the coderef when you run it. 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 Thu, Feb 6, 2020 at 9:48 AM Alan Schmitt wrote: > Hello, > > I'm trying to create an org link to a specific place in an OCaml file. I > thought I would use some specific target in an OCaml comment, but it > does not work. > > Here is an OCaml comment: > > (* Object projection functions *) > > Here is the link create by `org-store-link` (I put it here with no > description) > > [[file:~/work/jsexplain/jsexplain/jsref/JsSyntax.ml::(* Object projection > functions *)]] > > When I try to follow this link, I get the following error (note the > missing parentheses): > > org-open-file: No match for coderef: * Object projection functions * > > and I am moved to the top of the file (instead of where I stored the > link). > > Is there an escape problem here? And if so, is it a bug of > `org-store-link` of not doing the escaping? > > Thanks, > > Alan > > --000000000000ab43e1059de983a1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think you need to do it like this:

#+BEGIN_SRC test.ml -r

(* Object pr= ojection functions =C2=A0*) (ref:opf)


#+END_SRC


[[fil= e:2020-02-05.org::(opf)]]

The -r in the header removes th= e coderef when you run it.

John

-----------------------------------
Professor J= ohn Kitchin=C2=A0
Doherty Hall A207F
Department of Chemical Engineeri= ng
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803


On Thu, Feb 6, 2020 at 9:48 AM Alan Schm= itt <alan.schmitt@poly= technique.org> wrote:
Hello,

I'm trying to create an org link to a specific place in an OCaml file. = I
thought I would use some specific target in an OCaml comment, but it
does not work.

Here is an OCaml comment:

(* Object projection functions *)

Here is the link create by `org-store-link` (I put it here with no
description)

[[file:~/work/jsexplain/jsexplain/jsref/JsSyntax.ml::(* Object projection f= unctions *)]]

When I try to follow this link, I get the following error (note the
missing parentheses):

org-open-file: No match for coderef: * Object projection functions *

and I am moved to the top of the file (instead of where I stored the
link).

Is there an escape problem here? And if so, is it a bug of
`org-store-link` of not doing the escaping?

Thanks,

Alan

--000000000000ab43e1059de983a1--