From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: overlay showing computed value of macro? Date: Thu, 22 Nov 2018 16:06:10 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ef2f6e057b473a22" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPwGU-0002GL-A6 for emacs-orgmode@gnu.org; Thu, 22 Nov 2018 16:11:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPwAU-0007Fj-Fe for emacs-orgmode@gnu.org; Thu, 22 Nov 2018 16:05:47 -0500 Received: from mail-it1-x130.google.com ([2607:f8b0:4864:20::130]:55844) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gPwAU-0007F8-9y for emacs-orgmode@gnu.org; Thu, 22 Nov 2018 16:05:46 -0500 Received: by mail-it1-x130.google.com with SMTP id o19so15729841itg.5 for ; Thu, 22 Nov 2018 13:05:46 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode --000000000000ef2f6e057b473a22 Content-Type: text/plain; charset="UTF-8" On Thu, Nov 22, 2018 at 1:19 PM Matt Price wrote: > It would be nice for me to overlay the macro invocations with the values > that they will evaluate to on export. I guess I would have to figure out > when to trigger recalculation of the values (maybe not too often, say only > when the macro is first created, when it's edited or deleted/deformed, and > perhaps on structure editing. > > I do not understand emacs overlays very well so this feels a little > daunting to me. Does anyone out there have ideas about how to do it > effectively? > > This is what I've come up with; it feels somewhat close but not quite there yet. I can create, remove, and the overlays, which is great. What I miss is the awesomeness of the way that overlays work with org links. I love how the link target and the enclosing [[ ][ ]] are invisible until I delete one of the "[" elements. However, with my code, the whole macro expression {{{macroname}}} ius invisible until I delete the whole thing, at which point the overlay helpfully disappears. Is htere a way to get something like the link behaviour? > Thanks as always! > > --000000000000ef2f6e057b473a22 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu= , Nov 22, 2018 at 1:19 PM Matt Price <moptop99@gmail.com> wrote:
It would be nice for me to overlay the macro invocations with = the values that they will evaluate to on export. I guess I would have to fi= gure out when to trigger recalculation of the values (maybe not too often, = say only when the macro is first created, when it's edited or deleted/d= eformed, and perhaps on structure editing.=C2=A0=C2=A0

<= div>I do not understand emacs overlays very well so this feels a little dau= nting to me.=C2=A0 Does anyone out there have ideas about how to do it effe= ctively?


This is what I've come up with; it feels somewhat clos= e but not quite there yet. I can create, remove, and the overlays, which is= great.=C2=A0 What I miss is the awesomeness of the way that overlays work = with org links. I love how the link target and the enclosing [[=C2=A0 ][=C2= =A0 ]] are invisible until I delete one of the "[" elements.=C2= =A0 However, with my code, the whole macro expression {{{macroname}}} ius i= nvisible until I delete the whole thing, at which point the overlay helpful= ly disappears.=C2=A0 Is htere a way to get something like the link behaviou= r? =C2=A0
=C2=A0
Thanks as always!

<= /div>
--000000000000ef2f6e057b473a22--