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 kI3bC+Hnzl7xYgAA0tVLHw (envelope-from ) for ; Wed, 27 May 2020 22:21:21 +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 UDW+B+Hnzl5wWAAA1q6Kng (envelope-from ) for ; Wed, 27 May 2020 22:21:21 +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 980F294030A for ; Wed, 27 May 2020 22:21:20 +0000 (UTC) Received: from localhost ([::1]:35558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1je4QI-00073J-6V for larch@yhetil.org; Wed, 27 May 2020 18:21:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1je4Pv-000738-HO for emacs-orgmode@gnu.org; Wed, 27 May 2020 18:20:55 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:36863) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1je4Pu-0007aY-HA; Wed, 27 May 2020 18:20:55 -0400 Received: by mail-wm1-x32e.google.com with SMTP id d128so55342wmc.1; Wed, 27 May 2020 15:20:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=W7B0p8SbVJKV4cV40GlY3tU+Z/r3SWyntP/kDSxUG6o=; b=YqqElECGxSWt6wXnz1z38qky3DJjJyENIzylWwuayc9d1BL8KaymiSgsFjeJqeUCyD HWDwt0FSCWlTlosvbGR+DSla7a1BCMib9xGyANMM9RipiyCBqWFLceGGjldqmjuRhmH7 jkcLfvrtAhWgGqnPeYSKOuz701egcAZyq/Eig600916rMSREKaU2lg2edVIjmtPRtk+B EBDhpLyHE5ISv0eCTxnc8JiAguJLbCfRm6ojQlOZwFXf9cRKKqcq/cojsTdW3gpOVvx3 uoXFQNQuOwQ+mdv1behpirEj/ehJPrbTFlhb2tb0FfaiHV4vxaF9I3uiIuLJwZLee89b +1CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=W7B0p8SbVJKV4cV40GlY3tU+Z/r3SWyntP/kDSxUG6o=; b=RocYE6Ewd1Gcg5PXpcutLwJ1O0Z2/G0WaU/VOoqP78dsR1C3j5rQQh7CWvadn0ApaI 2wEvlyrzhD8MUb7FjYyWrDZPmgx7j7lZKYBSdmlps2HRYdmvzmYGsEz7WPfzHvJ69WT6 10U9h2rA7RvW2GM1oxrMz89TMfsfJ5/oCfSMWr5y1NLxtR0tbZexAwMWj1hHYPT6nzGk TI95TST9dcl1Ebhzs1TyrAA4Vc7TPHsoB8zXz7qFf8hYwMoEcmJdV4aEyPzXlW/3hjls JLuzHoT4n12CD3u98Ls5t93lDGA0a+0ZlsI/ZP2DkVqCqRnARqlRgxTsuHtFmnR+doEX yHrg== X-Gm-Message-State: AOAM5316c9+n7lEd+I6UyPC4cEERMNS78eMHqrO7IQi5I4npTEQFb79J sBGhGlVnUpbLKd9oryRZgZP0qT1o X-Google-Smtp-Source: ABdhPJxLDIRrQfWqS1871GIxqW1gqsuDFtWxNV9yWyXU2TE55/oqdOHVzegcGCchRXqDoNvnU88W8A== X-Received: by 2002:a1c:1f85:: with SMTP id f127mr225196wmf.163.1590618051688; Wed, 27 May 2020 15:20:51 -0700 (PDT) Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id a1sm4782105wmd.28.2020.05.27.15.20.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 15:20:50 -0700 (PDT) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: Bastien Subject: Re: Possible fix for :includes header argument in org-babel C source blocks References: <21b0cd85-d678-2fe6-3c22-e41abc6cf242@guttersohn.org> <87wo51jo5w.fsf@gnu.org> Date: Thu, 28 May 2020 00:20:49 +0200 In-Reply-To: <87wo51jo5w.fsf@gnu.org> (Bastien's message of "Sun, 24 May 2020 18:25:15 +0200") Message-ID: <875zchyq7y.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=kevin.legouguec@gmail.com; helo=mail-wm1-x32e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_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=gmail.com header.s=20161025 header.b=YqqElECG; 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-Spam-Score: -0.21 X-TUID: xD4YsK+J26V4 --=-=-= Content-Type: text/plain Hi, 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 > > Best, 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) The following patch fixes the test: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=ob-C.patch 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))) --=-=-= Content-Type: text/plain 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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=ob-C-test.patch 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 #+source: string_var -#+begin_src cpp :var q="word" :includes '( ) :results silent +#+begin_src cpp :var q="word" :includes '("" "") :results silent std::cout << q << ' ' << std::strlen(q); return 0; #+end_src --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 hope this has not already been brought up; apologies if so. --=-=-=--