From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.help Subject: Re: Org mode & "literate programming": including files Date: Wed, 07 Apr 2021 18:47:03 +0200 Message-ID: References: <20210406183852.67ucwze6yxugvgrl@bob-nuc> <20210407082833.xtrxpwyczgghxb7l@bob-nuc> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9639"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Cc: Emacs mailing list To: Bob Heffernan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 07 19:02:53 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUBZt-0002Oq-CF for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Apr 2021 19:02:53 +0200 Original-Received: from localhost ([::1]:38412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUBZs-0001ZQ-Db for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Apr 2021 13:02:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUBZJ-0001YJ-5N for help-gnu-emacs@gnu.org; Wed, 07 Apr 2021 13:02:18 -0400 Original-Received: from mail-oln040092075085.outbound.protection.outlook.com ([40.92.75.85]:64773 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUBZF-0001Nl-Al for help-gnu-emacs@gnu.org; Wed, 07 Apr 2021 13:02:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hKpMO5iB4OpUmlcv1pf3HpCuZjVdzm30W2EM7195GR8mDwN1L++gdlsxuaVjTyZnceOWef93uJp87vd1VorTw3QiGv4Z58VkHqWbsRM8MW1raWbIgKfWThtCJ8cnGT60xsRY6DyVBqsw1JpaQq+PUbIcJig6Xv3a2cCcqoMIZXAc+ddgO6kKNnBEONusfOIm+hmw+PP15QVBegbStXjwKylyg9X2nepOm2kH2VHQMqiSOFFFJbvop7ZJ/EUSYUQc1TgG9OUij4tYpqWibMtHsIsExmk39xnOhx1fzEhNZytvfb79Rkf2QOhRQuBrdOWEP0IgDpDC7uw10DoCruI0Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=69LyDHNYsNpwAkFQOIMqIveQ5HvYn/bgSWWuoPHbSlY=; b=AFsuMSeAeGr3oZOdTh92iDF6a9IfVygJrXvFOSRmsj49audMXx5+I1QDf0iVZXYYuvwfmczopQl+faH9GNVHOBozpJ52h7YWr/Tex/hn0c+FgsGHNT1Yo1Xqj505eNIaRWjYZRcSyAv1nZNR/Qtn2LakTXau0vazWawz6I/byaV0NlOgO1PwyFPQ1KCd83/7OBk8xXm2Hx+kqridRY7LkS9GAwqHNcemtxlF333lxbeonG4N+rO5Cr6j9LMa+DTHS7NnFXYGPDTBVGfZ5Qf2iXdx9qWVZqg8G6/FmoDKzpvEj6BOuu9WZCzWMEMDDqzG4CWcVZUslPXp1zoQV6WbDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=69LyDHNYsNpwAkFQOIMqIveQ5HvYn/bgSWWuoPHbSlY=; b=YlmHXsKSPFlGqIkoWCMSBJzNEVmpAmuO7PY8iFiD2x7NiIZD6mlyjB+aSsSbk46Z9n7N9p24SCbNgCTsUJl02JmZeepDbmzDdXD3PY5+1T7vpmCHQ9Tr6h+rU49vxaf8/XSR1moZmzIUEfPXfh1uGuKfsazrrO6pbeZGGEbZnCO8RIacAL3EOKXquPVw7NJA99tgeB4Ud6qWIZ+jn0AZK25waJyxddb1ZGeXCiWKpPWZFZuRP7dW0Ta9iaGf9vEZyOSDW1aPy90zjX8PM1XjTjod4CYNlTV0SeL5NG97eKRY3URTiDUs7sKo5kWtAKw6wwQtlUEtH+86+5JJ6Y4ccQ== Original-Received: from VI1EUR04FT042.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::53) by VI1EUR04HT220.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Wed, 7 Apr 2021 16:47:06 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e0e::52) by VI1EUR04FT042.mail.protection.outlook.com (2a01:111:e400:7e0e::68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 16:47:06 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:B6ABAF3326233B4A738003C2DCCDF54218C3F8259D85B894E261BE922C0359C4; UpperCasedChecksum:B848FEBC235C7994943541EC6AD1914332404F8250C84565DC3713367C2E54B3; SizeAsReceived:7572; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b%6]) with mapi id 15.20.4020.017; Wed, 7 Apr 2021 16:47:06 +0000 In-Reply-To: <20210407082833.xtrxpwyczgghxb7l@bob-nuc> (Bob Heffernan's message of "Wed, 7 Apr 2021 09:28:33 +0100") X-TMN: [ZDGneYtay3qyJSuDO90UPyH0iuzvDULa] X-ClientProxiedBy: AM6PR04CA0049.eurprd04.prod.outlook.com (2603:10a6:20b:f0::26) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82mtuadou0.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from HP-Laptop.homepc (81.232.177.30) by AM6PR04CA0049.eurprd04.prod.outlook.com (2603:10a6:20b:f0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 16:47:06 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 7665b6c1-4424-477b-c742-08d8f9e4c727 X-MS-TrafficTypeDiagnostic: VI1EUR04HT220: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p4XsnKhVsCRNoxRDBmP6jYiRQZPEHivGTyMq8dUbiL+oJpmMoTcX0LjfdwPsPOXJ3qcl4CFYv9aagRUKmSfAfV1M5ICjxvR5A8CTamIdOhqQSF9+oTe954P3B8q/e/N82WOefnfM3vgwHK6Swhm6CJP2rDza3eysZJquvA5A2VodE/Ao+FLwv68Uge/C1bP6CID2eD1K7RxRf4fUGCMntGQCdaLqfXj577FEJakTRMYmFKPYEVFBU64ZAtQYoUWT4z8q/qbFEBlnenXHkkJ5Z1OHB3OkbZiIKhJc+sPTGXRZidB+I/BRa339eaWEEEyIBlWKzfPBThpjAg493kFUPAdywX96qZawxrv7d0b/lZXy8RRh2rutrAI5GW3FiwUT+tGWkdnMdfacP57Gbqfmea2sPNutuM8AX2hazMiDXDTkmznvuav07zmNuzuT+H7r X-MS-Exchange-AntiSpam-MessageData: XcE9mhygG5pAm3jZ0M5+C0enZ26RiQqdB6QVDsjyUrpAZInEmCpG2qJz3IXHaBN+ltgfNLkVgiVCUy59sHqicdy3K6BgwmxrPI6elI7Bk14ze+ZksTwAIfYw4lpiOCtPhHzWAB4b6n0QKO6a1EIT/g== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7665b6c1-4424-477b-c742-08d8f9e4c727 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 16:47:06.5761 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR04FT042.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR04HT220 Received-SPF: pass client-ip=40.92.75.85; envelope-from=arthur.miller@live.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128888 Archived-At: Bob Heffernan writes: > On 21-04-07 05:54, Arthur Miller wrote: >> I saw your question on reddit, and I saw somebody already posted you an >> answer. You are looking for `org-babel-lob-ingest`. >> >> Check the SX link posted to you on Reddit, it has what you are asking for: >> >> https://emacs.stackexchange.com/questions/31999/config-examples-and-use-cases-of-library-of-babel > > Arthur, > > From what I understand, the library of babel is a feature to glob > regularly used (named) code blocks into a single file, for use in > other org files. While this looks as if it could be used to achieve > what I want (first, ingest some code into the library, then use it > elsewhere) I was hoping for something similar to the sort of thing > that is present in most programming language REPLs: load whatever > source file you want, then use the procedures therein. I found the org-babel to be much better option since it will save you exporting (tangle) and evaluate org files everytime you load them. It is more efficient. It also let's you use named blocks, so you potentially don't need to load everything, just what you need. If you really wish to do this in style oc #include , look at the org-babel-load-file. It will do what you ask, but it is slow. It will export your .org file (tangle it) to .el and then load the produced lisp file. As a note, you can look up any elisp function in Emacs with C-h f RET function-name. Now imagine doing that for many files. The applications will load quite slow if they include many files and load them that way. Somebody above already posted you an answer that you are rather supposed to export your org files to el, and import those el files. So it is probably better to either export your code to .el files and byte/native compile them and use orinary `require' or `load' or use `library-of-babel'. I am not an expert, but that is how I understand it to be in Emacs. I am sure if I am wrong someone here will correct me :-). >> Hope it works for you and don't forgett to say thanks to the guy on Reddit. > > I'll take a closer look at it and thanks for your help. > (& you're right, I need to go back to reddit and respond!) > Regards, > Bob Best regards /a