From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UPhYHTRtX2CLwAAAgWs5BA (envelope-from ) for ; Sat, 27 Mar 2021 18:36:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aF4SGDRtX2COZAAAbx9fmQ (envelope-from ) for ; Sat, 27 Mar 2021 17:36:52 +0000 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 C11801FC20 for ; Sat, 27 Mar 2021 18:36:51 +0100 (CET) Received: from localhost ([::1]:35726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQCri-0004aY-14 for larch@yhetil.org; Sat, 27 Mar 2021 13:36:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQCYV-0003Wt-DX for emacs-orgmode@gnu.org; Sat, 27 Mar 2021 13:16:59 -0400 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]:38908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lQCYT-0002kB-A3 for emacs-orgmode@gnu.org; Sat, 27 Mar 2021 13:16:59 -0400 Received: by mail-qt1-x82e.google.com with SMTP id j7so6508892qtx.5 for ; Sat, 27 Mar 2021 10:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=fhjNo/pgNv/8cK+82Fi210trTqIi9ILUdQU1uWLiwDk=; b=QITnRWRlrDzT9LoerHEksJ6HLZ7ZUaPWMC0YvSUvRZ67QuZSQBYX6I/G049iS9QvjC YjXKVa3NEx+FJYRcxSISsxQWYEHm38SN5kJ+ukxO1BJpZchE2D26dKbMxBU1mKir+r5U vxzyGWRPVdx5MCdRRZ4Gh9vp+AMlqtyOXs0nTPf+46lHVzTo45U8GFJ6iGNrwfNn6320 Zzijwu/4zCYyqrP+6bfTYwW2BWFrZ/V1tlL7s95fIpdkUIzsMvd9NaFBr9niuyAX5JPo OMRWm99BA8L4dIR5l38/hW0I3iL9ZCe4PURKEdh+WsubguY5JKG4tOf7lI8bm/eiS9+1 UQZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=fhjNo/pgNv/8cK+82Fi210trTqIi9ILUdQU1uWLiwDk=; b=edgfmlIULa9jZdD7lvUgiCB+FC+rAm4WJ3fLMsfU2egFTTnaXjfnhtglYQKNus7nKD K0iKmQycf9K011azRLLB2RovFT5dMzbxHq3IsbZ+Ccd+zR55pMw9fRI3H1Hpl53Dcu1i 4aorh83JOlroOZI6WmYKuHgiFK/jjeslOWckU3JIzC2CB+Mqokh9mXNq0hljuni79wSM XEU1MLCnhUCTWKibhHv/cxPqXbK4wjn1xO9FSvZkzW4xAAIuOFFTcSaAJHuj59ebY1F2 dNkGSJ71Exj0UCcHz17MW7GIRu2Y4jPT6muxVl/CSATJFWiko92mz2jOu7GdT4xQ7S0s QvVw== X-Gm-Message-State: AOAM532b+KFcLGCH4pUFVApDZwR0Zfa3TeyJ7ZB1vx0ktiLKtzgSanJQ l6QGb551cDPoh1UGCB3iHdBsa6uBKrE= X-Google-Smtp-Source: ABdhPJwuV5NY3K8GGkUPTcZKURFm2BIKLf+J8AGCLjsa74jn3rH5bJ7yVPmH4GN9xObpT9fk1pdA/Q== X-Received: by 2002:ac8:708:: with SMTP id g8mr16568216qth.316.1616865415306; Sat, 27 Mar 2021 10:16:55 -0700 (PDT) Received: from localhost ([190.239.232.210]) by smtp.gmail.com with ESMTPSA id o36sm7985239qtd.89.2021.03.27.10.16.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Mar 2021 10:16:54 -0700 (PDT) User-agent: mu4e 1.4.14; emacs 27.2 From: Rodrigo Morales To: emacs-orgmode@gnu.org Subject: org-babel-tangle throws an error when :tangle is not set Date: Sat, 27 Mar 2021 12:12:38 -0500 Message-ID: <877dlsldvd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::82e; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-qt1-x82e.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616866611; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fhjNo/pgNv/8cK+82Fi210trTqIi9ILUdQU1uWLiwDk=; b=p7PdBSEgXGQ5oMVD4tS/5w/q/zUATJLrJI6pWQqxW2Ps19Dk7oQb1uViPkxySk4b3GAEdQ Gi/H1lB5yy+dHQtvLj3MSLYs2ZF6xf1iNQUgJBOx5NCn/HILEl5keN6FM/LoH7OlIEvV6t Zj41XDsmup9juQzD+mUmXwvmIviUMKGK4rcFOZsbR5bTVpUJ/jm2PWuGX8LSrqKHO9+Hph 2OmNhAbMjcbmHZnz6VZlOgxo8SS655vc6r9ibYsQUBfjw8KPew7WAhiLeSmu63eAMrv11D 6usFN2H5J2hSxykw2g78VmrqXAAdHHnN75dqzVGL5ezYmZH4o9697W2Sme0Qug== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616866611; a=rsa-sha256; cv=none; b=L3h4W6Cu9y/1+Ry4uldOhg5IlYGZIlhUjiK0Uo3CL9VIgE9ubhIZJTUqkT0Os0U+BWf76N YSyim6IIBJjtkRJP2ncGC9zwJpBsNlE34LydE69TcVF29/Hgy6Z1vhwjJH0rKD62MSxNMQ pyXBXrio6CCi07t/nbOdS9je5+S5qCvQ4YcHxfSPPTIXLMPFszcGTUKAIKckHy0oi19WGt gDEY2x/opAYGR+p2SESkdBXzCa5AShWWkEFsLg/kvSF6+MiVEPP1KryiY/em66zcWIsyG9 3KduEGUzRfQPO+38FW4TfAu56VeasVnPSJRTUI9eRR0nCkQt+EWybtPO49lV6g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=QITnRWRl; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=QITnRWRl; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: C11801FC20 X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6P+He90N7tQg * System information Emacs version: GNU Emacs 27.2 Org Mode version: Org mode version 9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/) Operating system: Arch Linux * The issue In a freshly started Emacs (i.e. Emacs when it has been started through =emacs -Q=), the value of the variable =org-babel-default-header-args= is #+begin_src emacs-lisp ((:session . "none") (:results . "replace") (:exports . "code") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no"))) #+end_src If we delete the cons cell whose car is =:tangle=. That is, if we evaluate the following expression, #+name: value-for-variable #+begin_src emacs-lisp :results silent (setq org-babel-default-header-args '((:session . "none") (:results . "replace") (:exports . "code") (:cache . "no") (:noweb . "no") (:hlines . "no"))) #+end_src then the function =org-babel-tangle= will throw the following error =Wrong type argument: stringp, nil= with the following backtrace #+begin_example Debugger entered--Lisp error: (wrong-type-argument stringp nil) file-name-directory(nil) org-babel-tangle-single-block(1) org-babel-tangle-collect-blocks(nil nil) org-babel-tangle(nil) funcall-interactively(org-babel-tangle nil) call-interactively(org-babel-tangle nil nil) command-execute(org-babel-tangle) #+end_example * Reproducing the issue You can reproduce this issue by 1. Start Emacs by executing =emacs -Q=. 2. Save the content of this message to a file whose extension is =org=. 3. Evaluate the expression shown above from the code block named =value-for-variable=. 4. Execute =org-babel-tangle= be it interactively or through =eval-expression=. * Additional information This error can be avoided by explicitly having a =:tangle= header argument in each code block. * Personal thoughts I had to spend more than 90 minutes looking for the expression in my configuration that was causing this error. I think that either + showing a error message expressing that the =:tangle= header argument is not set for some code blocks when =org-babel-tangle= is executed. + explicitly stating in the documentation that the =:tangle= header argument is necessary for some functions to correctly work (e.g. =org-babel-tangle=) could help other users to find this root cause so that they don't spend the time I spent looking for the issue. -- Greetings, Rodrigo Morales. IRC: rdrg109 (freenode)