From: Adam Sneller <adam@earth2adam.com>
To: John Kitchin <jkitchin@andrew.cmu.edu>
Cc: Kyle Meyer <kyle@kyleam.com>,
"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Auto-activate new <<<radio targets>>>
Date: Mon, 8 Feb 2021 17:43:07 +0000 [thread overview]
Message-ID: <57A50164-0D47-45A3-B92A-305E8EF9B81A@earth2adam.com> (raw)
In-Reply-To: <CAJ51ETpuOdrSvouHP5HG8j-aDemM4u2KhG0QOm_36Z57nmA_GQ@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1807 bytes --]
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 <jkitchin@andrew.cmu.edu> 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 <http://kitchingroup.cheme.cmu.edu/>
>
>
>
> On Sun, Feb 7, 2021 at 8:48 PM Kyle Meyer <kyle@kyleam.com <mailto: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 <<<target>>>
> fontification happens through a simple 'regular expression => 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.
>
[-- Attachment #1.2: Type: text/html, Size: 3712 bytes --]
next prev parent reply other threads:[~2021-02-08 21:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-06 22:36 Auto-activate new <<<radio targets>>> Adam Sneller
2021-02-08 1:47 ` Kyle Meyer
2021-02-08 13:44 ` John Kitchin
2021-02-08 17:43 ` Adam Sneller [this message]
2021-02-09 5:06 ` Kyle Meyer
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=57A50164-0D47-45A3-B92A-305E8EF9B81A@earth2adam.com \
--to=adam@earth2adam.com \
--cc=emacs-orgmode@gnu.org \
--cc=jkitchin@andrew.cmu.edu \
--cc=kyle@kyleam.com \
/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).