From unknown Mon Aug 11 21:36:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79147: Tangling source blocks with variables using drawer output includes unwanted new line in variable definition Resent-From: Vincent Koppelmans Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Aug 2025 06:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 79147 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 79147@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.175411599211137 (code B ref -1); Sat, 02 Aug 2025 06:27:03 +0000 Received: (at submit) by debbugs.gnu.org; 2 Aug 2025 06:26:32 +0000 Received: from localhost ([127.0.0.1]:33195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ui5hO-0002tW-Uq for submit@debbugs.gnu.org; Sat, 02 Aug 2025 02:26:31 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47814) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uhuHB-0000K4-ME for submit@debbugs.gnu.org; Fri, 01 Aug 2025 14:14:44 -0400 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 1uhuGn-0006nw-8y for bug-gnu-emacs@gnu.org; Fri, 01 Aug 2025 14:14:19 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uhuGl-0003aX-0k for bug-gnu-emacs@gnu.org; Fri, 01 Aug 2025 14:14:16 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-23fe9a5e5e8so9173695ad.0 for ; Fri, 01 Aug 2025 11:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754072052; x=1754676852; darn=gnu.org; h=mime-version:message-id:date:user-agent:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=/dmaZa9O5eJ/+c409dkFZyD88+U/D6PBLO4sjtYnZ44=; b=mg1tn2EY5lH6tznoNJZgXt5MC1TcIdRkKQLRh/Nv26dJUGgOo7cKrjUvqvll6bOjNZ qWvDO+AA3JRpcTcBKGPmsvs4EH0QCYTz/F/bkd47YLQLkuanoFv1ANNMUe8iV+e/q7/8 z7Bv760Ev7KyXlEiNhEcEWdYre8BYmo6Uf3AWelOmjjm6lRLYPEJUbAX7FNaLjrInFEp 3p1JxkE+7AnbPgyV6snALt5eHiCFkw8xCnLbjr2McFSMlpztRGktvWL2Sk32MYjMaFCI kpjC1NucRFp2PSSvadeNIWacyZd3taM8hYv+68kuswDN7B1f0L5Z0MXFHfY5+vLfq1sL si1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754072052; x=1754676852; h=mime-version:message-id:date:user-agent:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/dmaZa9O5eJ/+c409dkFZyD88+U/D6PBLO4sjtYnZ44=; b=d6qe6Jbnp9GHa1XcejMKXs021fv9g6CMvdljEYvnSb742jOlxHl6MOc174r4kRmlVq MfHfuTtHHzT9dokz3Jb62ZfosfZIACM1AxbyatAgv60f+dNJ7lZOZGtuHOGxqeliQ9um lBJT10x7qb/bsTkVXjX0xBwNb2O7Q92GiUyUhfaNMul7/KzM7VRBiVBBEEcj0t6DDLjR GnZpZ6xxkHhkcn3akFarKYAfPtAbPbhJpmkZdKmCRSMB1oAn0d5kxptKMU38Er/MMG2+ oD6nxmfmdFZS3V7eusJfbDfMmO89HPxrNTKNUw+pA/PXOjG2+SWrHmettL6PaPxZBRLF q1EQ== X-Gm-Message-State: AOJu0YwN2jej6IBYoXNmTt4i357lCI7wTvy+zNn/hbwcfM6FwxpVfzz3 /Izmi3L9AzwvMXoW4E/NYfsSlKWeHenvGVyqSTCbwMecyguKkMCktlp5wEkWHO1Lv3M= X-Gm-Gg: ASbGnctJT2CK5NldRX8a0gHFDD0XuyP6PxMxTPox5mU1lIzWqzxB6+xnVEp4N8z9jgW FeK25GLzvn/R3PQ2hkJieYzRrqECItvC/wJNXID94ep5rAf9IRIn1Fan1vX783mLP0Oa3L4+DE1 PLGAJfaUkosuIsbItqd3wF69uI4ay0L0Dz7fyWSh2onWZx81t9WmVpu3MRF5dkzS6KyjE+GnWkE GZuPbzTyCNCGS3F2PCziUjTkzx3z3Z1feiotP1RiX+XNPeRlFpkdOWlEwlslJfe+T/jybZ9NJ7d DpdiaCfZE5ekaFLud19WrQDEpPdatek/ltAjJg2WAX0zzQmTXMwQfK8cgwOI8BCW3syv1Z6lK+h YzaOqlyILE0nrXlGiXDLAgcKR X-Google-Smtp-Source: AGHT+IEgKOgaqRBSsSOJ4peVrHpiHWkQ9G9epIVMA7NdJspmVg0bF06PVpn7rM0wLGQ31oMPu1kp4A== X-Received: by 2002:a17:902:c9cd:b0:240:11cd:8502 with SMTP id d9443c01a7336-24246f6d417mr4044115ad.13.1754072052026; Fri, 01 Aug 2025 11:14:12 -0700 (PDT) Received: from Tuxedo ([155.98.225.50]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-241d1ef6cb7sm48527555ad.26.2025.08.01.11.14.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 11:14:11 -0700 (PDT) From: Vincent Koppelmans User-Agent: mu4e 1.12.11; emacs 31.0.50 Date: Fri, 01 Aug 2025 12:14:10 -0600 Message-ID: <87cy9eq58t.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=vincentkoppelmans@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Mailman-Approved-At: Sat, 02 Aug 2025 02:26:29 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Tangling a source block that contains a variable from another source block results in an additional incorrect new line at the end of the variable value in the tangled output file, /only/ when source block output type is set to 'drawer'. Here is a minimal example comparing regular source block output (correct) versus drawer output (error), tested with emacs -Q, GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2025-05-27 and Org 9.7.11: * Allow org blocks to evaluate shell code #+begin_src elisp :tangle no :results output none (org-babel-do-load-languages 'org-babel-load-languages '((shell . t))) #+end_src * Tangle code block with variable input from other source block ** Using regular source block output *** Source block that generates the variable #+name: my_temp_dir1 #+begin_src bash :tangle no echo "/example/path" #+end_src #+RESULTS: my_temp_dir1 : /example/path *** Source block that takes in the variable and which gets tangled #+begin_src sh :var idir=my_temp_dir1 :tangle test_default.sh echo "${idir}" #+end_src *** Display the tangled block #+begin_src sh :tangle no :results output drawer cat test_default.sh #+end_src #+RESULTS: :results: idir='/example/path' echo "${idir}" :end: Looks okay! ** Using drawer source block output *** Source block that generates the variable #+name: my_temp_dir2 #+begin_src bash :tangle no :results output drawer echo "/example/path" #+end_src #+RESULTS: my_temp_dir2 :results: /example/path :end: *** Source block that takes in the variable and which gets tangled #+begin_src sh :var idir=my_temp_dir2 :tangle test_drawer.sh echo "${idir}" #+end_src *** Display the tangled block #+begin_src sh :tangle no :results output drawer cat test_drawer.sh #+end_src #+RESULTS: :results: idir='/example/path ' echo "${idir}" :end: We have a problem: the closing quote starts on a new line. Best, Vincent From unknown Mon Aug 11 21:36:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79147: Tangling source blocks with variables using drawer output includes unwanted new line in variable definition Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Aug 2025 08:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79147 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Koppelmans Cc: 79147@debbugs.gnu.org Received: via spool by 79147-submit@debbugs.gnu.org id=B79147.175412171526705 (code B ref 79147); Sat, 02 Aug 2025 08:02:02 +0000 Received: (at 79147) by debbugs.gnu.org; 2 Aug 2025 08:01:55 +0000 Received: from localhost ([127.0.0.1]:33830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ui7Bi-0006wf-Q2 for submit@debbugs.gnu.org; Sat, 02 Aug 2025 04:01:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35708) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ui7Be-0006wJ-BX for 79147@debbugs.gnu.org; Sat, 02 Aug 2025 04:01:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ui7BY-0002oj-R5; Sat, 02 Aug 2025 04:01:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cNtWSufWwRxnXxDDPmsLBG5P9js3hMKn2Vv3L7KH9iQ=; b=j99+y9QSi7C2 D21r+ocpmlSNFGDHZVBF6yEJyPZ80n/87yW27YgVikHkpADs4b50H2VzeeWh4PKjZn2uqHLCcz4qL ujuYFLVSx96YiPx4f4y3Lcy4fSbAm2mOigQPX2L7Eu2qSXMBMyAazwjMzGRnidw5w7VfgQHT2HuY5 xSu/ntJ+LChHi4MMaCKZ/e209k6BUO2StPpttC4bByw5/RO63snGS0T5r5DmZ4Q2VdEfHlhpoW6US iB51zT2PK+WVTrt9Zqx6wmXE5HTiiEvWQ9IxZLvVt6LO5I1AcV67QcXP0dv0pUhtuWXSJdIABk1YG smpxGjTFcwXSUQCPQhfokA==; Date: Sat, 02 Aug 2025 11:01:35 +0300 Message-Id: <86qzxurw2o.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87cy9eq58t.fsf@gmail.com> (message from Vincent Koppelmans on Fri, 01 Aug 2025 12:14:10 -0600) References: <87cy9eq58t.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Vincent Koppelmans > Date: Fri, 01 Aug 2025 12:14:10 -0600 > > Tangling a source block that contains a variable from another source block results in an additional incorrect new line at the end of the variable value in the tangled output file, /only/ when source block output type is set to 'drawer'. > > Here is a minimal example comparing regular source block output (correct) versus drawer output (error), tested with emacs -Q, GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2025-05-27 and Org 9.7.11: > > * Allow org blocks to evaluate shell code > #+begin_src elisp :tangle no :results output none > (org-babel-do-load-languages > 'org-babel-load-languages > '((shell . t))) > #+end_src > > * Tangle code block with variable input from other source block > ** Using regular source block output > *** Source block that generates the variable > #+name: my_temp_dir1 > #+begin_src bash :tangle no > echo "/example/path" > #+end_src > > #+RESULTS: my_temp_dir1 > : /example/path > > *** Source block that takes in the variable and which gets tangled > #+begin_src sh :var idir=my_temp_dir1 :tangle test_default.sh > echo "${idir}" > #+end_src > > *** Display the tangled block > #+begin_src sh :tangle no :results output drawer > cat test_default.sh > #+end_src > > #+RESULTS: > :results: > idir='/example/path' > echo "${idir}" > :end: > > Looks okay! > > ** Using drawer source block output > *** Source block that generates the variable > #+name: my_temp_dir2 > #+begin_src bash :tangle no :results output drawer > echo "/example/path" > #+end_src > > #+RESULTS: my_temp_dir2 > :results: > /example/path > :end: > > *** Source block that takes in the variable and which gets tangled > #+begin_src sh :var idir=my_temp_dir2 :tangle test_drawer.sh > echo "${idir}" > #+end_src > > *** Display the tangled block > #+begin_src sh :tangle no :results output drawer > cat test_drawer.sh > #+end_src > > #+RESULTS: > :results: > idir='/example/path > ' > echo "${idir}" > :end: > > We have a problem: the closing quote starts on a new line. Thanks. This seems to be a problem with Org, so please report it to the Org developers first.