From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0JVTCk1E7WPJZAAAbAwnHQ (envelope-from ) for ; Wed, 15 Feb 2023 21:45:01 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YdxXCU1E7WOsLAAAG6o9tA (envelope-from ) for ; Wed, 15 Feb 2023 21:45:01 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E703AC269 for ; Wed, 15 Feb 2023 21:45:00 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSOdX-0002de-HF; Wed, 15 Feb 2023 15:44:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSOdV-0002b1-S2 for emacs-orgmode@gnu.org; Wed, 15 Feb 2023 15:44:17 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSOdU-00048i-1s for emacs-orgmode@gnu.org; Wed, 15 Feb 2023 15:44:17 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7F6362405F7 for ; Wed, 15 Feb 2023 21:44:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1676493853; bh=JoBzd8EmUayUoAfZbOBL/wTXHY702B+bUVpVwixOeOI=; h=From:To:Cc:Subject:Date:From; b=rF9has6wTDwstF8+Bv46TgX1LINd5wjhrYs4RHwpD8veLnLGhczaM4t4YA8cUM58H KOEfmUfHL144Orwufdbl0Q2dkZ0P5mmP5cs4NKkvWwy5JAvxsbyuOise1JaaBQ5fcu 0iM6ZZGwxKdARGYCprnvWMLZBu6rMdWZZGXcPW8CzuCQuqMsM3M2k3pjXhqqNXGxdI PtV8DK+YGtQCFcau9/iUJSP12582LKeiKQBTlayUMxb0UIX+itOFY9IJq44a+1u/gy 4kEu8MdP8PoYcnycrkb3wl+whlES8Bsiu/fwagzDWh0DuqCGdQXSJ8dF0CmtiaV44/ OBV8DOehUtSww== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PH96K1s0Wz6tnq; Wed, 15 Feb 2023 21:44:09 +0100 (CET) From: Ihor Radchenko To: reza Cc: "emacs-orgmode@gnu.org" Subject: Re: Cannot expand macros through included org file In-Reply-To: <0102018656c98091-28c05c5e-9dbd-449a-8af2-dbe7908056c4-000000@eu-west-1.amazonses.com> References: <7d032f82-9d16-edff-b548-3c01f6ea68cb@housseini.me> <0102018656c98091-28c05c5e-9dbd-449a-8af2-dbe7908056c4-000000@eu-west-1.amazonses.com> Date: Wed, 15 Feb 2023 20:44:40 +0000 Message-ID: <877cwi4q13.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676493900; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DrmqC6ndEiQSSNj01EZJfmA7uVLkGi/2uFAt1KVAEYY=; b=uxQEyj/pXb3DedxYBCoGQmrRCiGkELl2mJ+jCXHUFS3t54vJEpSsBZFDY8r5Um1eR8AAc6 g3ofP/iQ3LAVaOtgThKwMIi8twV3Z+iKHgiy9x6cN42NDnjNDvM9Ep+eCLnPMbyz0zUQVI SLq4jzplvuE32vrAHXoKMYRurgyMfvost75xb8JiZJ6n5hoBA2yb0sI/+T8jOLqLwvzmG1 +Cp7qtL5mfgRuz3A3vYguwxRXT4CJrqzzTNwabWkV64vudgPqZB01FyGOe0D5EWqCHP6oK bB9V6ylxDSfJpiwl8cE7DOFiiOyShDjUKxCTZzA0UtxKxmcDgesEEq3GBldLtA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=rF9has6w; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676493901; a=rsa-sha256; cv=none; b=dZTvQuR3Wceg4inOwLOKnaOj87GAazQ//+E4fnLslEECU3TCPpIMp/yATHoHofP73Bs24j HWUGqQwDpxQ7UqX/6DW0btswsW4T6VTjG8WrxoDvHqWCD3RdqdaM6OSJ7L6c4UqocFD/h7 A0s++fFyLRSBaZbOjSLgE8LvZ6N+C1S8nIovNx+KhrZkBZWp+yMFKmdZJkkuDTh0K2ol5O T10B9nsN9TqdGYIH/dpj7woc5zlTG7KO7SblhjAFkyaLCap71oh+HCsFaChLtYIgDVXPre 6wYcdA2WB2Ugq8WLuRQqADqqbkpOFWEkmk3JZtICHxPM+T81RW2DoAToMhAAbQ== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -6.09 X-Spam-Score: -6.09 X-Migadu-Queue-Id: E703AC269 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=rF9has6w; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net X-TUID: JwabtZCLSnIZ reza writes: > #+BEGIN_SRC bash :file log_{{{year}}}.csv > ./get_log_file --start={{{year}}}-01-01 --end={{{year}}}-12-31 > #+END_SRC > > #+BEGIN_SRC python > log = pd.read_csv("log_{{{year}}}.csv") > #END_SRC > ... > But that does not seem to work. It looks like the macro expansion does > not happen for included content. Is this a bug or correct behavior, what > would be the approach to not repeat the content for several reports? Macro expansion only works inside Org proper markup. Macros are only recognized withing non-verbatim contexts. Src blocks are considered verbatim and macros are not expanded there. Otherwise, Org would risk interfering with proper programming language syntax. What you can do instead is creating a named Org paragraph with macro, like #+name: year {{{year}}} and then refer to it via variable assignments. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at