emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: help with a regexp
Date: Thu, 15 Jul 2021 08:58:15 -0400	[thread overview]
Message-ID: <m2czrjentk.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <87r1g0hsvr.fsf@gmx.net>

Thanks everyone, these are all good suggestions.

I realized though the problem is that org-mode is recognizing something
like [cite:@darby-2018-lonel-atoms] as a cite link because of the cite:
part of it. In fact org-mode seems to recognize all [link:path] as an
org link.

In general that seems ok, but it leads to overlapping syntax with
org-cite and the one org-ref link.

It seems to be a partial solution to remove the cite link from
org-link-parameters, but that isn't ideal to me because older documents
won't work with org-ref that way (most of mine use cite: very
extensively).

The best solution in my opinion would be for org-mode to not recognize
[cite:...] as a link. Other ideas?

Thanks,



Stephen Berman <stephen.berman@gmx.net> writes:

> On Wed, 14 Jul 2021 20:43:24 -0400 John Kitchin <jkitchin@andrew.cmu.edu> wrote:
>
>> Hi all, I could use a bit of help with a regexp. I am trying to fine tune the org-ref citation regexp to
>> make it orthogonal to org-cite.
>>
>> I want to recognize these as org-ref links
>>
>> [[cite:schuett-2018-schnet]]
>>    cite:schuett-2018-schnet
>>
>> but not
>>
>>  [cite:@schuett-2018-schnet]
>>
>> so either 0 or 2 [[ can prefix it to be a cite link in org-ref, but not 1 [.
>>
>> right now the cite: in the org-cite syntax is getting flagged as bad cite link which I want to avoid.
>>
>> is this doable?
>
> For your example this is sufficient (for real usage you probably want to
> add more context to the right of 'cite'):
>
> (re-search-forward "\\[\\[cite:\\|[^[]cite:")
>
> Steve Berman


--
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
Pronouns: he/him/his


      parent reply	other threads:[~2021-07-15 12:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15  0:43 help with a regexp John Kitchin
2021-07-15  4:41 ` Timothy
2021-07-15  6:04   ` Jean-Christophe Helary
2021-07-15  8:40 ` Stephen Berman
2021-07-15  8:46   ` Stephen Berman
2021-07-15 12:58   ` John Kitchin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2czrjentk.fsf@andrew.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).