Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [literate-programming]

The tag has no usage guidance.

0
votes
1answer
41 views

No org-babel execute function for go

#+Begin_SRC go package main import ("fmt") func main(){ fmt.Println("emacs") } #+End_Src ~/.emacs.d/init.el: (when (memq window-system '(mac ns)) (exec-path-from-shell-initialize) (exec-path-...
0
votes
0answers
19 views

Org Babel Tangle Jump for noweb code

I am using noweb with org-babel. What I enter in org-mode is as follows #+BEGIN_SRC python :tangle yes :noweb tangle :comments noweb import sys import os def main(args): <<...
0
votes
1answer
29 views

is there something like org-babel for arbitrary major modes? [duplicate]

org-babel allows editing source code of arbitrary modes inside an .org file. I'd like to do this (with different syntactic markers) inside my major mode, but org-babel is very specific to org. Is ...
8
votes
1answer
79 views

Does org have any “inverse-tangle” operations e.g. for collaborating with non-org users?

I would like to write my own notes/tests/code in org and then use org-bable-tangle to produce source files. However, all of these files are subject to version control and hence subject to change from ...
7
votes
2answers
152 views

It is possible to instrument a literate Org-mode configuration file with a backing Emacs Lisp file?

It is a common practice to write Emacs configuration files using literate-programming style in Org mode. Unfortunately, while improving readability, this comes with significant programming ...
1
vote
1answer
98 views

Generate different markup for not-tangled code blocks in org-mode

Is there a way in org-mode's HTML export to make it so that code blocks that have :tangle no will appear differently? Even adding a different HTML class will do, as one can then probably add some CSS ...
1
vote
0answers
43 views

C-c ' for editing all code blocks (to handle imports and variables)?

The Org manual says: C-c ' for editing the current code block. It opens a new major-mode edit buffer containing the body of the ‘src’ code block, ready for any edits. This feature is sweet. ...
2
votes
1answer
48 views

How to call org-lint against org-mode file from command-line

I am configuring a CI/CD pipeline to process org-mode files into documentation, source code, and other file formats. I would like to add a call to org-lint to do basic syntax checking against org ...
1
vote
1answer
60 views

Managing source code annotations and version control

I would like to be able to annotate source code files with my own personal notes, strip these notes out before committing to version control, and merge changes back in from version control without ...
2
votes
2answers
225 views

ob-tangle or not?

I'm experimenting with Uncle Dave's config which is using a minimum init.el to launch config.org, which is full of elisp babel source blocks. Here's his relevant launching code: (when (file-readable-...
3
votes
2answers
232 views

Managing code libraries with org-babel

I want to take a literate programming approach to managing my library of code snippets with org-babel. I have a ~/Code folder which I use to save various org-mode documents, each of which contains a ...
2
votes
1answer
61 views

How to make org-babel call all remote code blocks under a specific headline?

For example, I have following org file: ***** user level ****** copy system service file At first copy system's systemd service file to systemd user level. by check it out, and tangle it to target ...
2
votes
1answer
49 views

How to avoid accidentally writing temporary source-block-edit-buffers to file

When doing literate programming in org-mode, I frequently use C-c '[aka M-x org-edit-special] to enter the source-block-edit-buffer, so that I have appropriate yasnippets etc. I then accidentally ...
4
votes
4answers
703 views

literate programming: do folks revise tangle blocks or make copies

So I'm making a website using an org document and tangling. I've created the basic structure of the site using * file coolsite.org #+BEGIN_SRC sh rails new coolapp #+END_SRC This creates a app/...
5
votes
1answer
157 views

switch-buffer for literate programming

When doing literate programming, I do web development in a single org file, and do org tangle to generate the relevant html and css files. This works, for a few hours/days. When the number of files in ...
2
votes
1answer
108 views

Can tangling embed code in external files? instead of recreating files

I'm building a web application using the literate programming style. At least trying to. I wanted to "hit the ground running", so I decided "make a copy" of one of the many "starter apps" https://...
1
vote
1answer
139 views

noweb function call with variable arguments

I get error "reference y not found in this buffer" when trying to evaluate cubed-plus-cubed: #+NAME: cubed #+BEGIN_SRC python :var x=3 return x * x * x #+END_SRC #+RESULTS: cubed : 27 #+NAME: cubed-...
1
vote
2answers
295 views

Order of blocks in org tangle

I want to create an org file with two sections, that reads in that order but "tangles" first the second section. For example, if my org file is * Generic section #+BEGIN_SRC python :tangle yes print(...
4
votes
1answer
84 views

EMACS shell mode that supports annotations

I often find myself doing things like installations or debugging where I would like to be able to work in shell mode but be able to insert annotations as I go. BBEdit has something like this but ...
3
votes
1answer
49 views

How to stop main wrapping when tangling C in org-babel?

Please consider the following self-contained, minimal example org file: #+name: zepto-c #+CAPTION: A tiny C file #+begin_src C++ :tangle zepto.c #include "zepto.h" void foo (void) {} #+end_src #+...
2
votes
0answers
78 views

Literate agda programming in org-mode

How could I write literate (and exportable to latex) Agda code in org-mode? Org-babel would be a great option, but there is no ob-agda2 (I think?). I have tried defining an org-babel-execute function ...
2
votes
1answer
77 views

The correct way to declare common vars in babel

I'm playing with the idea of "literate devops" with org-mode. To simplify scripts i've extracted common values into :PROPERTIES: drawer, which looks like this: * Scripts ** Subscripts-A *** ...
1
vote
1answer
291 views

org-babel-load-file doesn't load entire file

In ~/.emacs.d/init.el I'm calling my annotated configurations file settings.org like so: (require 'ob-tangle) (org-babel-load-file (expand-file-name "~/.emacs.d/settings.org")) This generates ...
0
votes
0answers
155 views

Literate Programming with non org-mode Collaborators

I've been starting to take a literate programming approach using org-mode for school assignments. However a lot of assignments require working in a group with other students who typically don't have ...
3
votes
1answer
571 views

Correct way to configure the lastest `org-mode` (literate programming)

Update: 11/Aug: I forgot to mention that I'm using literate programming to build the init.el from an org file. It seems that the problem appears when emacs opens the configure.org to generate the .el ...
6
votes
1answer
222 views

One-liner org source tangle

At times, especially when taking notes, a literate org file can contain one-line source blocks, as follows: * Taking notes :PROPERTIES: :tangle: whatever.pl :comments: org :END: Perl set command #+...
4
votes
0answers
215 views

Indentation using multiple org src block

So, say I have a literate org file as follows: #+TITLE: Random Scrap * Do something :PROPERTIES: :tangle: scrap.pl :comments: org :END: #+BEGIN_SRC perl sub my_func{ my $var = pop; #+END_SRC ...
2
votes
1answer
131 views

Use noweb reference in eLisp code in source block in org-mode

I want to manipulate an org mode source block that is referenced with noweb in an eLisp source block: #+name: conceptmap #+begin_src org :results value raw :exports results (ONE) {TWO} (THREE) (FOUR) ...
1
vote
1answer
498 views

How to get fixed-pitch code blocks in variable-pitch Spacemacs org-mode?

I like to use variable-pitch mode when working with prose in org-mode, but I have to turn it off when I involve tables or code blocks. Using answers found elsewhere, such as https://stackoverflow.com/...
1
vote
2answers
771 views

Reference a variable in a 2nd org-babel code block

How can I define vars in one org-babel code block and use them in a second? This closely follows the tutorial section block-to-block variable passing linked in the first answer. # file test.org * ...
3
votes
1answer
1k views

graphing R in org-babel

How can I get a graph back in my org-babel results for R code? #+BEGIN_SRC R :results output latex boxplot(islands) #+END_SRC Islands is a baked in dataset for R. Do you do it with #+resname: ...
2
votes
1answer
147 views

Why does inserting a new R chunk inside `ess-noweb-mode` give me a leading @ symbol?

I am writing a statistical report using .Rnw buffer and enjoying the very nice ess-noweb-mode, which I see very promising indeed, but what struck me is the strange behavior when I hit the keybinding ...
4
votes
0answers
90 views

Get describe-key links to bring me to org-mode config files, not .el config files?

For my Emacs configuration, I use a literate programming setup. My config files are in org-mode format, and my init.el file consists mostly of org-babel lines like (org-babel-load-file "~/emacs/...
1
vote
1answer
295 views

org-mode babel python code block to get current org file's location

I would like to use some python code with babel to output some computation result about the current org file. As I'll be doing this quite often, I'd like ideally to have access to it's file name ...
4
votes
0answers
115 views

How to link from parent source block to child block (included via <<noweb>>)?

When exporting the documentation (HTML or PDF) for a literate program that uses noweb references in blocks, how can I get the output to actually hyperlink the <<noweb_snippet_name>> line (...
3
votes
1answer
1k views

executing scheme in org-mode babel

I want to write a scheme program in an org file. I want to be able to execute the #+SRC blcoks and see the result in #+RESULT: block. However, when I execute the #+SRC_BEGIN/END I get no output. ...
3
votes
1answer
86 views

Using a different major mode in comments

A programming language that I use lets me format comments and docstrings using markdown, and then export my code and documentation to PDF. When I edit the file, though, Emacs doesn't see comments as ...
2
votes
1answer
152 views

Does org-babel for groovy take arguments?

I am trying to pass an argument to a groovy babel block but I'm not sure it accepts arguments? The documentation says that it is language-specific but I didn't find any documentation for ob-groovy. ...
5
votes
1answer
184 views

Support to refactor/convert source into literate programming with org-mode/babel?

I'm thinking of using literate programming to investigate large amount, or hard to understand source code. For the purpose, I'd like refactor the source code into literate programming text with org-...
45
votes
5answers
9k views

Can I use org-mode to structure my .emacs or other .el configuration file?

My .emacs configuration file gets bigger and bigger and I'd like to get a better overview and structuring by adding headings, subheadings and being able to hide or show them like I can do with Emacs ...