From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id xtzwB6Of0GDDJwEAgWs5BA (envelope-from ) for ; Mon, 21 Jun 2021 16:18:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gPz4AqOf0GAGJwAAbx9fmQ (envelope-from ) for ; Mon, 21 Jun 2021 14:18:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 525EA27365 for ; Mon, 21 Jun 2021 16:18:10 +0200 (CEST) Received: from localhost ([::1]:51228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvKkZ-0008Oe-IP for larch@yhetil.org; Mon, 21 Jun 2021 10:18:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvKjW-0008Mx-Cr for emacs-orgmode@gnu.org; Mon, 21 Jun 2021 10:17:03 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:41846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvKjR-0004u6-KQ for emacs-orgmode@gnu.org; Mon, 21 Jun 2021 10:17:02 -0400 Received: by mail-wr1-x42f.google.com with SMTP id f15so4423828wro.8 for ; Mon, 21 Jun 2021 07:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ocY3bjnv3s0qY5L4iovHtqdmFgrlf5Wsy4GTVRadt3Q=; b=lqna9SvkFH0nUUrrupBeOrDDoqZy5D1ZvPTOF9x4wmf+fju++0E6Oez/HULZe7CXWu 19PjynoYbcl86IXM7Jvckix/TDLx+Ob3Zc1Y1PLrF8xmtI8S1t8Mc9sCoL9hoMNLJzuf 8f1PA9aUwnAxbMuaehcEdWVl7ae0G9/QR+bm1HDCeUYiZlRyMfNf0UTaIFaJ5ryDtP6L +ONrbi7QIKp3VbngLsWAOuN7ycTq3OHlHUq9pN9ucjGUoMRgESxmkR5lci4SeeGYuNK0 6qwCpcrjunvDhu64RoZx9bngpepFG3DpYY/b3zkixN5tToKA4W+3HcaY5yurx5BWHVc6 MOdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ocY3bjnv3s0qY5L4iovHtqdmFgrlf5Wsy4GTVRadt3Q=; b=gpcfjYuip+2wUv5GbpmI8xzUfJgR8Ni3xlcB3cNSrfFN8a81u/aTyNZpjgiPumlOZa swUmiIrmwIyDjVaO4d3HZQIT58lr22r87Ppm2u8Nck9THE5b4Br+25dPUXDn/0qHMVIz RFCry0qEaa3c7WKfEVTbEMDW7J3X5GE4ZBnwm6pe2ucPb8f8hDcFdJxjGYuZr9vRiIq8 6IvB/hFlYkg8lNeXCxnuhL46If8MrkC6DWOAFgrbENx3GVOOdZXBILPOtYbqA9Ka2CvJ DqS2B4De1zEbz5T0PETGAlTXPk6m2Rh6QUbCsDdtQj30CSsHAjTKFoCsGiHx4BNgjrpL ht8g== X-Gm-Message-State: AOAM531y2F7RG6oDm2BZfX35UKgUhdzE2rCw19qc6GN5aZPa71PGJL4/ 2rLo7rVxDV66y470fSDVweiBw4MlC+I9OJrOUMmi2TcQHNu0DA== X-Google-Smtp-Source: ABdhPJzj2pe0nXRCtnCJbCCzVhf2qcv+uzXyelgLZo6MRBqIucbQo/3EpOfcTZf3D1W/R5EtEmdTJNrJyacROp8s798= X-Received: by 2002:a5d:5388:: with SMTP id d8mr27883852wrv.423.1624285015488; Mon, 21 Jun 2021 07:16:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Bruce D'Arcus" Date: Mon, 21 Jun 2021 10:16:47 -0400 Message-ID: Subject: Re: [org-cite] request for coding help on a capf to insert citation key To: org-mode-email Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=bdarcus@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624285090; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ocY3bjnv3s0qY5L4iovHtqdmFgrlf5Wsy4GTVRadt3Q=; b=Cm/u0EhHf2nllLszxNJPbXJDwz+Zz2fi0j0GcAxUPlsUPc+Bd95eg1pHNFeiP/jTNKj6HI Hnw3MowkNak5XBrcfGSFYS8dFz4YfTSosqrngNtxuPH8aips2yk6zuSeWRlM7RRtQUd7jz L33pFKbXMp8EoJ1FHjoCKQF92fXGr6mHzv6wDxVas1wB7sRAJi/nkofarmqpH8z/z0BJwP X2IIMCdT/KkwttRC5KaVNorXIWHhtflu/IETI69MvS37U9ns2/rkg/LhchKNS9EQfj/Rrb 8FqaW5uB8qsp799D5NLU4Qz3y7Nu6X35kzrsajess2h+Q2W7xW0vxrhaXUpNTg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624285090; a=rsa-sha256; cv=none; b=tGzwSq4wth8o96mDAoh3nLtKi4FHz8JV6x+j2PFiULNYWiBehbZ+p5xfc/Bb0P5UDMEbMK c+di9oK8JRG03/BJLGC6ozQ+b8H7kvlAAMyYNYA+Zm0bj11Q7+moi59A0+Waj5aR1oxJ59 OadwdN8180YAsibZF7Yhu5OidelrV4n9WsbeCSnbvBduq4yls7bXxB3LTJwA0zIpWnx2SD JqBlEnBXpGEjiSK2KGEcebBnza46gOaBkfX/48rJ3gRb8gld06YA/6BUM2ybsAv0k7sHu3 75yCBY+2mhYzrvx1J2qPmJwnz5s+mkxF4Pmt9zPFb4nSoQn2v3e7oBkwKRbyrw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=lqna9Svk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=lqna9Svk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 525EA27365 X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: IP/ZA1plV1eS On Sat, Jun 5, 2021 at 12:13 PM Bruce D'Arcus 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