From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 8B7JIivOkWLiTgEAbAwnHQ (envelope-from ) for ; Sat, 28 May 2022 09:24:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0EfKIivOkWLAUgAA9RJhRA (envelope-from ) for ; Sat, 28 May 2022 09:24:27 +0200 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 BEA2C226E8 for ; Sat, 28 May 2022 09:24:26 +0200 (CEST) Received: from localhost ([::1]:33674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nuqoC-0004UE-Rv for larch@yhetil.org; Sat, 28 May 2022 03:24:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuqnB-0004Se-8O for emacs-orgmode@gnu.org; Sat, 28 May 2022 03:23:22 -0400 Received: from mout01.posteo.de ([185.67.36.65]:60197) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuqn9-0002QA-5h for emacs-orgmode@gnu.org; Sat, 28 May 2022 03:23:20 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 7022A240026 for ; Sat, 28 May 2022 09:23:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1653722596; bh=MUYEwsl74seBovZAKX3dW2zozKsHfvPXJH7vOUYfw5M=; h=From:To:Cc:Subject:Date:From; b=kixM0eiRMXHNbln0hTvlH3RXgpexMDJvPA59DvVJyKA86l062NHlzRYfwRJxP8lQD Y5ZUWzYwIqa9OCjq8P1j0JiZzoRYnb3riHjE4zp3mKY6aXuMUh7amRxig/OP/Q3P+l dr2l5XygbeGXHPjDYKGQPhwVabEhlZVtKvcTm2RFGR54GyahqxAzvubEW06gwdOvA0 o/7iGoVkvdgCdcElKQjTzKyDF7M0rOp+RYlk/Hl6qZLs6Vu86BCkGirN80J3jvBVJi HaLmlm/ma8FZXxQzpzxlaeNvRPewSaL/+Rht8fyl/E2uJMahLk6fpbYDK5377vTTIr kow/tQMogl1Fw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4L9Cnb54Hrz9rxL; Sat, 28 May 2022 09:23:15 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Uwe Brauer Cc: orgmode Subject: Re: how to export an org file, to 2 different locations (in to different formats) References: <87r14flzaa.fsf@mat.ucm.es> <87a6b2stoy.fsf@posteo.net> <87y1ymqzlh.fsf@posteo.net> <87h75a5fl4.fsf@mat.ucm.es> Date: Sat, 28 May 2022 07:23:13 +0000 In-Reply-To: <87h75a5fl4.fsf@mat.ucm.es> (Uwe Brauer's message of "Sat, 28 May 2022 08:36:07 +0200") Message-ID: <87h75a2k9q.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653722667; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=5pjTlSpx0qU0QVAX5leMCLPbdX6GmBq6MnO8mCDZ4EU=; b=WP9nx121jYq8WLBASIz1xpM/Px5TquOaZYwkAVtzEjaYmwR2K9LgnN8Fk4hsEORF3F4Nnh b8dZ1/3VwZONDpftGoBD5wWQbzHV+h3xN6j7okEJhZ5EZNaW202hD8N/tQadMaGDaelTyD DYhVp0B8R+6b1NaiGEz7EtFjUUH9sfb4OHgm1sO78wirBFGtifvLRQmIpQ7KEM94mN+IYC X/7kyb4Rgrqu8Z0QW4Lqct2yTvScwj4W/wqRFmknbhmbgjCu01z1fTtO/T8K3VfN035Yr8 i+QM+S7sqs/rqyQXbrBuDJObuE8FjIYlnYdRakYeHbI6eKOUONZxRPKs1Mr27A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653722667; a=rsa-sha256; cv=none; b=mlynXTxt7NaYyzzeGmltfSbdMyS6EartZpsfBEYyN7AUMyE7x82fZhXDz/wYZtzwRoBL3d r/ENN3a8w57KT+kgEC8JSkuKbJnPfHnheYfOv7kjsB0vF+4W9sWHYDOyaFSA4v+mbsJMbV /j5Qmf4jzFyrEOuF5tM4CjL09uxfMs5MVhIi8NZapJJGS/o+MFNBIwBW/UiBvSXNqjLwLo 0H+aBwSeN0piY3a1FGMP9Z8e3ezVp7fULsx90KVjveEPbBXrU8UviNzEzKMtid8sYb2C2a rdUi3j2JXppLXk992VBrBON5JO4OBoyAwCxAB4uz8qqn2OyY5E5WubnNRSRw1g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=kixM0eiR; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Spam-Score: -4.55 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=kixM0eiR; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Queue-Id: BEA2C226E8 X-Spam-Score: -4.55 X-Migadu-Scanner: scn0.migadu.com X-TUID: t1p1tJtZApUf Uwe Brauer writes: > When I run it I obtain=20 > if: Symbol=E2=80=99s value as variable is void: my-latex-export-path > > Another point is if I decide to export it to ods, I need to modify that > advice, but I agree the new function is more convenient. You must add the variables to the document as local variables, at the end of the document, like this: # Local Variables: # my-latex-export-path: "~/path/myfile.tex" # my-html-export-path: "~/path/myfile.html" # End: But (it's important, I didn't tell you, sorry) before you must globally define the variables with nil value, so that you don't get an error in other documents: (setq my-latex-export-path nil my-html-export-path nil) With this 'define-advice' procedure you don't need the other code I gave you. You can export in the usual way, using the dispatcher. The only difference is that in any document where these variables exist, the resulting file will be saved in the directory/name specified in the variables, depending on whether you export to latex or html. To add more cases, like odt, simply: (1) you define a new variable: (setq my-latex-export-path nil my-html-export-path nil my-odt-export-path nil) and locally: # Local Variables: # my-latex-export-path: "~/path/myfile.tex" # my-html-export-path: "~/path/myfile.html" # my-odt-export-path: "~/path/myfile.html" # End: (2) And you add a new condition at the end of the define-advice: [...] (if (and my-latex-export-path my-html-export-path my-odt-export-path) (cond ((equal extension ".tex") my-latex-export-path) ((equal extension ".html") my-html-export-path) ((equal extension ".odt") my-odt-export-path)) (apply old-func args))) It means that: if those variables exist, it returns as a result the path/name that you have specified for each case. Otherwise, the org-export-output-file-name function is executed normally. Best regards, Juan Manuel=20