From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bob Heffernan Newsgroups: gmane.emacs.help Subject: Re: Org mode & "literate programming": including files Date: Tue, 6 Apr 2021 22:59:44 +0100 Message-ID: <20210406215944.7mlxinyzlec46fao@bob-nuc> References: <20210406183852.67ucwze6yxugvgrl@bob-nuc> <2f0f11ce-0616-9437-475d-d31165bb02a1@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10803"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Nikolay Kudryavtsev Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 07 00:01:17 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 1lTtl7-0002ic-Pc for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Apr 2021 00:01:17 +0200 Original-Received: from localhost ([::1]:37792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTtl6-0006Z9-Oj for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 06 Apr 2021 18:01:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTtjs-0006AO-1U for help-gnu-emacs@gnu.org; Tue, 06 Apr 2021 18:00:00 -0400 Original-Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:41505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTtjq-0001FC-7O for help-gnu-emacs@gnu.org; Tue, 06 Apr 2021 17:59:59 -0400 Original-Received: by mail-wm1-x335.google.com with SMTP id t5-20020a1c77050000b029010e62cea9deso153518wmi.0 for ; Tue, 06 Apr 2021 14:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=A0//xr8yhPYQI3n+OziSYzAR6svZwIVLzXBLAdzvJVo=; b=tf28g4jOrbmbIPflGdz8KaHVKrwaeYG1S7HnKwMdG020vKKnOGL0i2BdQKxmjmUeQN L5lgFik+Ap4ZijU8JAYJtVrMmlX7gc1b5EJaCP98elwR4sF099jrha0O48fUcf8jrReJ H6TAoWlPhOsuIleaKSugiMyToq2wIl5i41d4veifd1iCLTrJxRr/HAT9kiI/EUWWqobW V4V+FisjjlntMdaaMbYxtOo465zo1GkxBtdzwhO4OoBCK9L9OLq6cLJa/X8uMGaU9JGo 6qnoGjGqAbcXvqX8R0d9xYBod+rAldzOLf9W6Laygr53YTZoWnDdGJdNZxvyEUkgdtft FEDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A0//xr8yhPYQI3n+OziSYzAR6svZwIVLzXBLAdzvJVo=; b=Tp/au0Hkr1atlpXLJyex2xJNOImWNE1X+nox9V4TSJ0b0/Fmtc7IUT4oRvLU4GNtDV g65kJltQzMMSgHLH7d0kYoao7p/mm4eTxPsXPlgsIs1tkuBrFhxtvhkfonkPS8cqADFv s5j+ZpCnYib42bwv9lG+PFLQNtUD6vvOwSCDUEt6QYGnV9FeJlM+HxmV9Xe5RSN61IeD OBpkoGS0w55VPIs39m1fu4bjev94XoRhBZEi/2SP7HuWtsxtyDCw9vNmAppD5oqPXHCn EG+0eV6e7evhz5ZD6pl51wL1i3/rA9OjJEk8rQjTaIUkHTuHdbrN6N8JOWQDbUWdbu5D G25Q== X-Gm-Message-State: AOAM533BEFYsC2bV/dksfi9noapRoyLRW/h3vNM/J0AruvPgvZ+7xWZC BcV1WAIdoZXqV9r3Ct4XNPU= X-Google-Smtp-Source: ABdhPJxoG+6dzNkqn3fG+cs0+ig+t8YHUCBbHT8t/Ma2xzOBiToPFPYf+oT7XFJNld3ibdbmm/5hew== X-Received: by 2002:a1c:220a:: with SMTP id i10mr65268wmi.121.1617746392921; Tue, 06 Apr 2021 14:59:52 -0700 (PDT) Original-Received: from localhost ([2a02:8084:9841:6600:d098:f653:b555:7e49]) by smtp.gmail.com with ESMTPSA id v189sm4870532wme.39.2021.04.06.14.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 14:59:52 -0700 (PDT) Content-Disposition: inline In-Reply-To: <2f0f11ce-0616-9437-475d-d31165bb02a1@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=bob.heffernan@gmail.com; helo=mail-wm1-x335.google.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, 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: 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:128875 Archived-At: On 21-04-06 23:18, Nikolay Kudryavtsev wrote: > In org mode you can extract your source code from the org file into a proper > language specific file. The general idea is that you write your library in > org, then you tangle it into a proper scheme file and then just import that. > See this part of the manual for more info (info "(org) Extracting Source > Code") . Nikolay, Thank you for your help. Something like the following isn't particularly elegant, but it works. Perhaps as I learn more I'll be able to clean it up. #+name: lib #+begin_src emacs-lisp :results silent (car (org-babel-tangle-file "/home/bob/projects/literate/foo.org")) #+end_src #+begin_src scheme :var input=lib :results silent (load input) #+end_src #+begin_src scheme (f 1) #+end_src #+RESULTS[7f10...]: : 2 > Also, while you can expect people on this list to have a reasonable amount > of org knowledge, the best place to ask org questions is actually > emacs-orgmode@gnu.org mailing list. I'll bear this in mind. Thanks. Regards, Bob