From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qK1qCJOtIWBeFgAA0tVLHw (envelope-from ) for ; Mon, 08 Feb 2021 21:30:59 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GJhLBJOtIWBkGQAA1q6Kng (envelope-from ) for ; Mon, 08 Feb 2021 21:30:59 +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 5EDDF940439 for ; Mon, 8 Feb 2021 21:30:58 +0000 (UTC) Received: from localhost ([::1]:57616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9E7U-0003cr-Mh for larch@yhetil.org; Mon, 08 Feb 2021 16:30:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9AZ9-0007qS-BD for emacs-orgmode@gnu.org; Mon, 08 Feb 2021 12:43:15 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:39308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9AZ6-0007V2-Q6 for emacs-orgmode@gnu.org; Mon, 08 Feb 2021 12:43:15 -0500 Received: by mail-wm1-x32c.google.com with SMTP id u14so13956999wmq.4 for ; Mon, 08 Feb 2021 09:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=earth2adam-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=ypor4T2tMAuGFYEockmffZtpNZ/pMsluXaEh4/S6saA=; b=REmy3QSwGxBZQDjY5eNqL5LR0EdXA0l1+RQjOKn1CnM1wQQ/IzowTIgQXo1yJHC67n ZTq9GSDh9QJy8IsT5AOJkjkcJynrxV0Hl+Cou7/AfRfKe8v3FNgdcppv1fsB79P9ctqR mkdTRWa5LIQJdo7iXbsQL3hKlLOo6JE0oGC2VwlyUz3na8lT5/UjGGu28YvEZ8V/Emw3 5WEoVeWodevXd5/zv3IjFQRJZe6fpP/O58mqq3s5iQia83TT5EfyOiq0zpKIuL7TQ3Vx shuZxooohd1Py7uqoH1ZlcOSNFKrkdrBAaDiV3R4t1r1hHaNC3CIUH7gdvmfB9x6hYoy MSiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=ypor4T2tMAuGFYEockmffZtpNZ/pMsluXaEh4/S6saA=; b=uABeihLVAECJcUOrIJE/QIPvKtIKf2s4BYwNvCtgY9SJNDZaeQTpnofhyq1VuGX9QP fE+sbROGFKwMcz3P1ss29rqpvNcgQYZABkHxWXcwl/Zauh1qf53p9OkAg8wEPFHrm+GW LRDXm8dz8VRlfwfaIKVpxROU1WFNcaiQ4oUzbf1bms1HWyoVf6A2YodGBX4s0Em5cf4+ Edjtb/Tzam9LQ+NFJdqNYfzf3uH1cg0YhaVr/ndAHzlIP5trJfWoE+wIB/7lL08ZlCkv llU7Dn8c/HBzpbNhGSRDZN9aVsyzJJr/hKnrpnsvSIhRaNUfc7LkB7kUkHGvm4UwYM0j 90rA== X-Gm-Message-State: AOAM533+k5dqF8LzV/S0lUGxmF2kWCOpt5KlHYFTCfABtTzyZVycQG9x ksEw2v9Dyx9j509GB2p2bVY55A== X-Google-Smtp-Source: ABdhPJy2CKPku+q2WpSo1409uIIBlSdVJVcZSUEq17K0leonkrxehMccJisHpReRONWdRJuP3JZ7YQ== X-Received: by 2002:a1c:f60b:: with SMTP id w11mr10097552wmc.134.1612806189670; Mon, 08 Feb 2021 09:43:09 -0800 (PST) Received: from [192.168.1.14] ([84.9.34.195]) by smtp.gmail.com with ESMTPSA id o12sm29977130wrx.82.2021.02.08.09.43.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2021 09:43:08 -0800 (PST) Content-Type: multipart/related; type="multipart/alternative"; boundary="Apple-Mail=_645F8259-65EB-4EB2-89FB-E3C51EAD57F9" Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.7\)) Subject: Re: Auto-activate new <<>> From: Adam Sneller In-Reply-To: Date: Mon, 8 Feb 2021 17:43:07 +0000 X-Mao-Original-Outgoing-Id: 634498987.22115-ef71d4b027933c661ffd66cdebd167ee Message-Id: <57A50164-0D47-45A3-B92A-305E8EF9B81A@earth2adam.com> References: <86311E4A-E38F-4173-A662-922F82B7FCEB@ms2.digital> <87o8gvxrdg.fsf@kyleam.com> To: John Kitchin X-Mailer: Apple Mail (2.3445.9.7) Received-SPF: none client-ip=2a00:1450:4864:20::32c; envelope-from=adam@earth2adam.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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: , Cc: Kyle Meyer , "emacs-orgmode@gnu.org" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.06 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=earth2adam-com.20150623.gappssmtp.com header.s=20150623 header.b=REmy3QSw; dmarc=none; 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: 5EDDF940439 X-Spam-Score: -2.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: PJFSHX2b0Op5 --Apple-Mail=_645F8259-65EB-4EB2-89FB-E3C51EAD57F9 Content-Type: multipart/alternative; boundary="28B023e0BF9a8FCAEfaBb8dAF45eadf_eb3F8D34507e7aFA8c33cB_fdD8DE" --28B023e0BF9a8FCAEfaBb8dAF45eadf_eb3F8D34507e7aFA8c33cB_fdD8DE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Thanks John! It looks like there is also an org-activate-target-links which = may narrow the field a bit. Here is what I have so far: (defadvice org-activate-target-links (after ad-update-target-links ()) "Activate radio target links as soon as a new target is created." (lambda () (interactive) (when (and (org-in-regexp org-target-regexp) (not (org-in-regexp org-target-regexp nil t))) (org-update-radio-target-regexp)))) (ad-activate 'org-activate-target-links) Unfortunately, this is not working for me... Any ideas? > On 8 Feb 2021, at 13:44, John Kitchin wrote: > > I guess the place to do it is with an advice on org-activate-links. Maybe= a simple after advice would do. > > 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 Sun, Feb 7, 2021 at 8:48 PM Kyle Meyer > wrote: > Adam Sneller writes: > > > I want to call org-update-radio-target-regexp as soon as org-mode > > recognises a new <<>> has been created (which seems to > > happen as soon as the third ">" is typed). > > > > What hook can I use to get this done? > > I'm not spotting any hook that could be used for this. The <<>> > fontification happens through a simple 'regular expression =3D> face' > mapping in org-font-lock-keywords. > > You're probably aware of this and it's just not as automatic as you'd > like, but just in case: pressing `C-c C-c' with point on <<> > will call org-update-radio-target-regexp. > --28B023e0BF9a8FCAEfaBb8dAF45eadf_eb3F8D34507e7aFA8c33cB_fdD8DE Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
Thank= s John! It looks like there is also an org-activate-target-links which may n= arrow the field a bit. Here is what I have so far:

(defadvice org-a= ctivate-target-links (after ad-update-target-links ())
=   "Activate radio target links as soon as a new target is created."
  (lambda ()
    (inte= ractive)
    (when (and (org-in-regexp org-ta= rget-regexp)
       (not (org-in-regexp org-= target-regexp nil t)))
      (org-update= -radio-target-regexp))))
(ad-activate 'org-activate-tar= get-links)

U= nfortunately, this is not working for me...

Any ideas?

On 8 Feb 2021, at 13:44, John= Kitchin <jkitchin@= andrew.cmu.edu> wrote:

<= div class=3D"">
I guess the place to do i= t is with an advice on org-activate-links. Maybe a simple after advice would= do.

John

-----------------------------------
Pr= ofessor John Kitchin 
Doherty Hall A207F
De= partment of Chemical Engineering
Carnegie Mellon UniversityPittsburgh, PA 15213
412-268-7803


On Sun, Feb 7, 2021 at 8:48 PM Kyle Meyer <kyle@kyleam.com> wrote:
Adam Sneller = writes:

> I want to call org-update-radio-target-regexp as soon as org-mode
> recognises a new <<<radio target>>> has been created= (which seems to
> happen as soon as the third ">" is typed).
>
> What hook can I use to get this done?

I'm not spotting any hook that could be used for this.  The <<&l= t;target>>>
fontification happens through a simple 'regular expression =3D> face' mapping in org-font-lock-keywords.

You're probably aware of this and it's just not as automatic as you'd
like, but just in case: pressing `C-c C-c' with point on <<<target= >>
will call org-update-radio-target-regexp.


--28B023e0BF9a8FCAEfaBb8dAF45eadf_eb3F8D34507e7aFA8c33cB_fdD8DE-- --Apple-Mail=_645F8259-65EB-4EB2-89FB-E3C51EAD57F9--