From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: order of evaluation upon export: macros are evaluated too soon Date: Wed, 07 Jun 2017 21:56:58 +0200 Message-ID: <87bmpzzi45.fsf@nicolasgoaziou.fr> References: <874lvriyuv.fsf@delle7240.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIh4l-0003as-4k for emacs-orgmode@gnu.org; Wed, 07 Jun 2017 15:57:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIh4g-0005Sb-BB for emacs-orgmode@gnu.org; Wed, 07 Jun 2017 15:57:07 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:54227) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIh4g-0005SK-4O for emacs-orgmode@gnu.org; Wed, 07 Jun 2017 15:57:02 -0400 In-Reply-To: (Charles C. Berry's message of "Wed, 7 Jun 2017 11:43:02 -0700") 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: "Charles C. Berry" Cc: emacs-orgmode@gnu.org Hello, "Charles C. Berry" writes: > 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")) > > * heading 1 > > {{{n2()}}} > > > * heading 2 :noexport:notever: > > {{{n2()}}} > > * heading 3 > {{{n2()}}} > What about simply removing macros in :noexport: trees from a pre-processing-hook? Regards, -- Nicolas Goaziou