From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id nl+ROT+X1V4HNwAA0tVLHw (envelope-from ) for ; Tue, 02 Jun 2020 00:03:11 +0000 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 wD7WND+X1V5QLAAAbx9fmQ (envelope-from ) for ; Tue, 02 Jun 2020 00:03:11 +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 34A4A9404D1 for ; Tue, 2 Jun 2020 00:03:11 +0000 (UTC) Received: from localhost ([::1]:35348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfuOa-00066f-Tv for larch@yhetil.org; Mon, 01 Jun 2020 20:03:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfuO2-00065J-Uv for emacs-orgmode@gnu.org; Mon, 01 Jun 2020 20:02:35 -0400 Received: from mout-p-102.mailbox.org ([80.241.56.152]:26540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1jfuNz-0007IO-Ck; Mon, 01 Jun 2020 20:02:34 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 49bXKb0X9LzKmTx; Tue, 2 Jun 2020 02:02:27 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id YnLu9PTT4uJX; Tue, 2 Jun 2020 02:02:21 +0200 (CEST) Subject: Re: Possible fix for :includes header argument in org-babel C source blocks To: =?UTF-8?Q?K=c3=a9vin_Le_Gouguec?= , Bastien References: <21b0cd85-d678-2fe6-3c22-e41abc6cf242@guttersohn.org> <87wo51jo5w.fsf@gnu.org> <875zchyq7y.fsf@gmail.com> <87imggx045.fsf@kyleam.com> <875zcgwjo7.fsf@gmail.com> <87blm8v09s.fsf@gmail.com> <87tuzzukqe.fsf@gmail.com> <1821ea63-9168-bc02-377a-5429cbbf2f7c@guttersohn.org> <877dwqzy8l.fsf@bzg.fr> <87pnaiwngc.fsf@gmail.com> From: Brandon Guttersohn Message-ID: <305f20cb-66e7-cc8e-3baa-c383913eb533@guttersohn.org> Date: Mon, 1 Jun 2020 19:02:08 -0500 MIME-Version: 1.0 In-Reply-To: <87pnaiwngc.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DC97C1758 X-Rspamd-Score: -3.42 / 15.00 / 15.00 Received-SPF: pass client-ip=80.241.56.152; envelope-from=brandon@guttersohn.org; helo=mout-p-102.mailbox.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/01 20:02:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-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: 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=none; 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.49 X-TUID: CseN0go50aI0 > Note that IIUC, for non-system includes to work, either > > - the filenames must be absolute, or > - the compiler must be given -I arguments through org-babel-C-compiler. > > This variable can be set (e.g. to "gcc -I .") with file or > directory-local variables. Should we promote this method in NEWS? A > downside is that the user will be warned about the variable's value > being potentially unsafe, and we can't really avoid that unless we throw > a blanket :safe #'stringp on this defcustom. > Yeah, when I used it, I just used an absolute path. It's not entirely intuitive. Would it be reasonable to automatically add the value of (file-name-directory buffer-file-name) to GCC's search path when (1) non-system imports are used and (2) buffer-file-name is non-nil? If we do, then any header in the same directory as the *.org file should "just work". Seems like it would be safe, and I'm happy to try putting that together if there's interest.