emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Bruce D'Arcus" <bdarcus@gmail.com>
To: org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: [org-cite] request for coding help on a capf to insert citation key
Date: Mon, 21 Jun 2021 10:16:47 -0400	[thread overview]
Message-ID: <CAF-FPGMbaywtJ+q4Nkb15C4OdkNwy60VLDcmK77A0qKuJYrrOw@mail.gmail.com> (raw)
In-Reply-To: <CAF-FPGNKumD+c0onD3bzp=DCt26B4RffXtZC6JsH2PVi2nb9tQ@mail.gmail.com>

On Sat, Jun 5, 2021 at 12:13 PM Bruce D'Arcus <bdarcus@gmail.com> wrote:
>
> I've been struggling with this for a while, and am a mediocre programmer, so thought I'd ask for help here.

I made progress on this, with one question, for Nicolas:

What's the best way to constrain the capf?

Idea is if a user is within a citation, and types "@a", it activates.

Here's what I have now, but it's too tight; I'm assuming that second
line is the issue.

  (when (and (eq major-mode 'org-mode)
             (eq (car (org-element-context)) 'citation)
             (looking-back "@[a-zA-Z]*" 5))

Bruce


      parent reply	other threads:[~2021-06-21 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05 16:13 [org-cite] request for coding help on a capf to insert citation key Bruce D'Arcus
2021-06-05 21:14 ` Bruce D'Arcus
2021-06-06 16:21   ` Bruce D'Arcus
2021-06-21 14:16 ` Bruce D'Arcus [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=CAF-FPGMbaywtJ+q4Nkb15C4OdkNwy60VLDcmK77A0qKuJYrrOw@mail.gmail.com \
    --to=bdarcus@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).