filmov
tv
Tangle C code, compile and run it in an Emacs shell

Показать описание
Org-mode allows you to tangle (or extract) source code files from code blocks. Watch "Running a C program inside Emacs" before this video, if you don't know how to create a named code block.
- Add header information: :tangle hello.c :comments both
- Inside the code block, enter M-x org-babel-tangle (C-c C-v t)
- Open a UNIX shell in Emacs with M-x eshell
- At the command prompt, enter ls -la to see all content
- Compile hello.c by entering: gcc -o hello hello.c
- At the command prompt, enter ls -la to see all content
- Open Dired (C-x d) and look at the file hello.c
- Add header information: :tangle hello.c :comments both
- Inside the code block, enter M-x org-babel-tangle (C-c C-v t)
- Open a UNIX shell in Emacs with M-x eshell
- At the command prompt, enter ls -la to see all content
- Compile hello.c by entering: gcc -o hello hello.c
- At the command prompt, enter ls -la to see all content
- Open Dired (C-x d) and look at the file hello.c