Org-mode mailing list
 help / color / mirror / Atom feed
From: "Sébastien Miquel" <sebastien.miquel@posteo.eu>
To: No Wayman <iarchivedmywholelife@gmail.com>
Cc: Bastien <bzg@gnu.org>, emacs-orgmode@gnu.org
Subject: Re: Bug: [PATCH] org-babel-tangle: persmission denied when tangling [9.4.5 (9.4.5-gbc2659 @ /home/n/.emacs.d/straight/build/org/)]
Date: Wed,  5 May 2021 06:49:56 +0000
Message-ID: <eee44f40-9123-24e8-dbbc-b0ed8f77942a@posteo.eu> (raw)
In-Reply-To: <87y2ctlviu.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 746 bytes --]

No Wayman writes:
> Another related bug to the changes:
>
> I have the :tangle header-arg set to evaluate some elisp to return the 
> file name:
>
> org-babel no longer interprets this elisp. It is being used literally 
> as the file name:
> e.g.
>
> Wrote /home/n/.emacs.d/(concat (file-name-sans-extension 
> (buffer-file-name)) ".el") 
Here's another patch, to be applied on top of the previous one, that
fixes this.

The specific case you mention can also be achieved by setting the
:tangle argument to `yes`: in this case, the tangled file name is
computed using the buffer file name and changing the extension
according to the src block language.


Thank you again for the report, and sorry for breaking everything.

-- 
Sébastien Miquel


[-- Attachment #2: 0001-ob-tangle.el-org-babel-tangle-collect-blocks-Use-cor.patch --]
[-- Type: text/x-patch, Size: 1143 bytes --]

From b7c5103fdd05c3d30805ebcc5084ef82c44cd8ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= <sebastien.miquel@posteo.eu>
Date: Wed, 5 May 2021 08:31:43 +0200
Subject: [PATCH] ob-tangle.el: (org-babel-tangle-collect-blocks): Use correct
 tangle name

* lisp/ob-tangle.el: (org-babel-tangle-collect-blocks): Use correct
tangle name.

The :tangle header argument might be some elisp, to be evaluated.
---
Range-diff:
-:  --------- > 1:  b7c5103fd ob-tangle.el: (org-babel-tangle-collect-blocks): Use correct tangle name

 lisp/ob-tangle.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 96a4ef049..8af03b11a 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -377,6 +377,7 @@ be used to limit the collected code blocks by target file."
 	    ;; Add the spec for this block to blocks under its tangled
 	    ;; file name.
 	    (let* ((block (org-babel-tangle-single-block counter))
+                   (src-tfile (cdr (assq :tangle (nth 4 block))))
 		   (base-name (cond
 			       ((string= "yes" src-tfile)
                                 ;; buffer name
-- 
2.31.1

  reply	other threads:[~2021-05-05  6:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 18:26 Bug: " No Wayman
2021-05-04 19:25 ` Sébastien Miquel
2021-05-04 19:33   ` No Wayman
2021-05-04 20:27     ` Sébastien Miquel
2021-05-04 20:32       ` Bastien
2021-05-04 21:19         ` Sébastien Miquel
2021-05-05  3:15           ` No Wayman
2021-05-05  6:49             ` Sébastien Miquel [this message]
2021-05-05  7:03               ` Bug: [PATCH] " Bastien
2021-05-05 13:53               ` No Wayman
2021-05-05  6:43           ` Bug: " Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://orgmode.org

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eee44f40-9123-24e8-dbbc-b0ed8f77942a@posteo.eu \
    --to=sebastien.miquel@posteo.eu \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=iarchivedmywholelife@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git