From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IFDmJl0iz16CcwAA0tVLHw (envelope-from ) for ; Thu, 28 May 2020 02:30:53 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id MLXKIl0iz179AwAA1q6Kng (envelope-from ) for ; Thu, 28 May 2020 02:30:53 +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 E5CFE9403EA for ; Thu, 28 May 2020 02:30:52 +0000 (UTC) Received: from localhost ([::1]:39702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1je8Jm-0005Uy-Vq for larch@yhetil.org; Wed, 27 May 2020 22:30:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1je8JD-0005Ub-3J for emacs-orgmode@gnu.org; Wed, 27 May 2020 22:30:15 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:64283) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1je8JB-0005pQ-Hs; Wed, 27 May 2020 22:30:14 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id F215B78B79; Wed, 27 May 2020 22:30:09 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=TunZHaVp7U43 C57vdCbqlkLLDuA=; b=XH6q9Ab8d7KU8Q7IqkWfyzX+8FEKAK2zbo9inHuPe9/n L+QPjzV6KGEFNUccMlJljcFMi2yFVnzc6/L9FUMuOagUtoKqYb/60dj46vjG1QDV UWBPMObLXakjVZtUdJQw7FiF49NclLXIkvP0SYRS1oeziMAhH0UzrGPZ0N/qoRc= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id DC76978B77; Wed, 27 May 2020 22:30:09 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=TFzNEVfhW00qNKu/JtacVqYKUQomQKba8QUKqOMk+Wg=; b=oJUmTCtijyniM926AX7njlPA/eGG0cYOhZPKm2ZC8n3ILZAeqQsy5S+Ek9S5FGwXPgqXK70IWxSOSo+047Mhj0qy8tlBbhFvF5nmj4TPvjEGXkCgpwQWS/RUHC69M0l6AfcHXNQmtBmL7wkagsSuhWmHoZEsK3A7w8jwfpUVZLw= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 1DB3578B75; Wed, 27 May 2020 22:30:09 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec , Bastien Subject: Re: Possible fix for :includes header argument in org-babel C source blocks In-Reply-To: <875zchyq7y.fsf@gmail.com> References: <21b0cd85-d678-2fe6-3c22-e41abc6cf242@guttersohn.org> <87wo51jo5w.fsf@gnu.org> <875zchyq7y.fsf@gmail.com> Date: Thu, 28 May 2020 02:30:02 +0000 Message-ID: <87imggx045.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: 2649DA20-A08B-11EA-8E9F-D1361DBA3BAF-24757444!pb-smtp2.pobox.com Received-SPF: pass client-ip=64.147.108.71; envelope-from=kyle@kyleam.com; helo=pb-smtp2.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/27 21:23:09 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: , Cc: Brandon Guttersohn , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=XH6q9Ab8; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=oJUmTCti; dmarc=none; 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-Spam-Score: 0.29 X-TUID: BarPPr4RX1YT K=C3=A9vin Le Gouguec writes: > Bastien writes: > >> Brandon Guttersohn writes: >> >>> Hey all, I think I may have a small fix for executing C source blocks >>> in org-babel. Or, possibly just a bad case of user error. >>> >>> The issue (in emacs 27 with -q) is that it doesn't seem possible to >>> specify non-system header files with the :includes header argument. >>> >>> [...] >>> >>> The attached patch will wrap filenames in quotes if they do not begin >>> with "<", and works for me. >> >> Thanks for reporting this and for suggesting this patch, I think it is >> good enough. I have applied it to the master branch of Org: >> >> https://code.orgmode.org/bzg/org-mode/commit/44cb98fdb6 I think this discussion was on emacs-devel only, so here are some links for others who might go looking for more context: https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg01880.html https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg03051.html > I think this commit might have broken test ob-C/string-var: running > "make test" on master (516c038e5) right now I get: > >> Test ob-C/string-var condition: >> (wrong-type-argument sequencep ) >> FAILED 8/834 ob-C/string-var (0.004651 sec) Thanks. I started seeing that as well but hadn't looked into it yet. > The following patch fixes the test: > > diff --git a/lisp/ob-C.el b/lisp/ob-C.el > index c3e72c680..ae7b2ed1c 100644 > --- a/lisp/ob-C.el > +++ b/lisp/ob-C.el > @@ -233,6 +233,7 @@ its header arguments." > ;; includes > (mapconcat > (lambda (inc) > + (when (symbolp inc) (setq inc (symbol-name inc))) > (if (string-prefix-p "<" inc) > (format "#include %s" inc) > (format "#include \"%s\"" inc))) > > I don't know if it's the best way forward; another way to make the test > pass is double-quoting "" and "" in ob-C-test.org: The above looks reasonable to me... > diff --git a/testing/examples/ob-C-test.org b/testing/examples/ob-C-test.= org > index 0faf630b9..efae02a19 100644 > --- a/testing/examples/ob-C-test.org > +++ b/testing/examples/ob-C-test.org > @@ -38,7 +38,7 @@ > #+end_src >=20=20 > #+source: string_var > -#+begin_src cpp :var q=3D"word" :includes '( ) :resul= ts silent > +#+begin_src cpp :var q=3D"word" :includes '("" "") :r= esults silent > std::cout << q << ' ' << std::strlen(q); > return 0; > #+end_src ...given this test seems to be explicitly checking that case. > I guess there might be some people out there who will expect things to > keep working without double-quotes? I have never used Babel, so I have > no idea=E2=80=A6 I don't know either, but the test does make me think so. Hopefully Brandon, Bastien, or someone else will chime in if that's not the case. Could you send the first patch with a commit message tacked on? Thanks again!