From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: order of evaluation upon export: macros are evaluated too soon Date: Thu, 08 Jun 2017 12:39:53 +0100 Message-ID: <87tw3qn1x2.fsf@delle7240.chemeng.ucl.ac.uk> References: <874lvriyuv.fsf@delle7240.chemeng.ucl.ac.uk> <51249f80b2dc43118f5855b8d0ce737e@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> Reply-To: Eric S Fraga Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIvnG-0004Kg-EF for emacs-orgmode@gnu.org; Thu, 08 Jun 2017 07:40:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIvnD-0004Fg-9R for emacs-orgmode@gnu.org; Thu, 08 Jun 2017 07:40:02 -0400 Received: from mail-ve1eur01on0109.outbound.protection.outlook.com ([104.47.1.109]:55991 helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIvnC-0004EI-UJ for emacs-orgmode@gnu.org; Thu, 08 Jun 2017 07:39:59 -0400 In-Reply-To: <51249f80b2dc43118f5855b8d0ce737e@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> (Charles C. Berry's message of "Wed, 7 Jun 2017 18:43:02 +0000") 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain On Wednesday, 7 Jun 2017 at 18:43, Charles C. Berry wrote: [...] > Maybe implement somethng like this: > > #+BEGIN_SRC emacs-lisp > (defun n-noexport (x y) > (let ((tags (nth 5 (org-heading-components)))) > (unless (and tags > (string-match ":noexport:" tags)) > (org-macro--counter-increment x y)))) > #+END_SRC > > #+MACRO: n2 (eval (n-noexport "$1" "$2")) This is really straightforward and solves my problem perfectly. Thank you! -- : Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.7-531-g530113 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSPXCedOQfhSlwpVw3IkZPY//z2fQUCWTk3iQAKCRDIkZPY//z2 fYLsAJ0RHpfykjf67Ars5jhJ7oPkMFDvrACdGybto7PTcCmPGB18yf2Ww1lgJtE= =oNu+ -----END PGP SIGNATURE----- --=-=-=--