From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: overlay showing computed value of macro? Date: Thu, 22 Nov 2018 13:19:05 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006030ba057b44e56c" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPtfy-0002pr-CL for emacs-orgmode@gnu.org; Thu, 22 Nov 2018 13:26:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPtYn-0007Hb-DJ for emacs-orgmode@gnu.org; Thu, 22 Nov 2018 13:18:42 -0500 Received: from mail-it1-x135.google.com ([2607:f8b0:4864:20::135]:53986) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gPtYn-0007Eu-5H for emacs-orgmode@gnu.org; Thu, 22 Nov 2018 13:18:41 -0500 Received: by mail-it1-x135.google.com with SMTP id g85so15250265ita.3 for ; Thu, 22 Nov 2018 10:18:40 -0800 (PST) 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 --0000000000006030ba057b44e56c Content-Type: text/plain; charset="UTF-8" I use macros in my course syllabi to automate creation of timestamps It looksl ike this: # see bottom of this email for the defn of ~get-ts~ #+MACRO: ts (eval (get-ts+7)) ** Week {{{n}}} ({{{ts}}}): Time Scales in Rivers, Geology, and Human Relationships * Week {{{n}}} ({{{ts}}}): +READING WEEK: NO CLASS ** Week {{{n}}} ({{{ts}}}): Communities, States, and Water Governance This makes it much easier for me to re-arrange headings while I'm planning schedules. But it's a little hard to tell, for instance, if I have the right number of class meetings, or if the University holidays are in the right place, etc. 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? Thanks as always! --0000000000006030ba057b44e56c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I use macros in my course syllabi to automate creation of ti= mestamps It looksl ike this:

# see bottom of this = email for the defn of ~get-ts~
#+MACRO: ts (eval (get-ts+7)) =


** Week {{{n}}} ({{{ts}}}): Ti= me Scales in Rivers, Geology, and Human Relationships
* Week {{{n= }}} ({{{ts}}}): +READING WEEK: NO CLASS
** Week {{{n}}} ({{{t= s}}}): Communities, States, and Water Governance

T= his makes it much easier for me to re-arrange headings while I'm planni= ng schedules.=C2=A0 But it's a little hard to tell, for instance, if I = have the right number of class meetings, or if the University holidays are = in the right place, etc.=C2=A0

It would be ni= ce for me to overlay the macro invocations with the values that they will e= valuate to on export. I guess I would have to figure out when to trigger re= calculation 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 str= ucture editing.=C2=A0=C2=A0

I do not understa= nd emacs overlays very well so this feels a little daunting to me.=C2=A0 Do= es anyone out there have ideas about how to do it effectively?
Thanks as always!

=
--0000000000006030ba057b44e56c--