[Doc] Creating a common org files for personal Emacs notes
This commit is contained in:
parent
25ec604019
commit
b724f3129d
|
@ -1,10 +1,11 @@
|
|||
#+TITLE: Notes on “Babel: Introduction”
|
||||
#+AUTHOR: Daniel
|
||||
#+DATE: 2016-06-26
|
||||
#+title: Notes on Emacs
|
||||
#+author: Daniel
|
||||
|
||||
* Introduction to Babel
|
||||
|
||||
Tutorial from http://orgmode.org/worg/org-contrib/babel/intro.html
|
||||
|
||||
* Source Code Execution
|
||||
** Source Code Execution
|
||||
|
||||
#+begin_src hy
|
||||
(print "Hello, There!")
|
||||
|
@ -30,7 +31,7 @@ Tutorial from http://orgmode.org/worg/org-contrib/babel/intro.html
|
|||
|-------------+-----------+------------+------+------+---------+----------+--------+--------+------|
|
||||
| 5 | 5 | 4 | 3 | 3 | 3 | 2 | 2 | 2 | 2 |
|
||||
|
||||
** Capturing the Results of Code Evaluation
|
||||
*** Capturing the Results of Code Evaluation
|
||||
|
||||
#+begin_src python :results value
|
||||
import time
|
||||
|
@ -53,11 +54,11 @@ Tutorial from http://orgmode.org/worg/org-contrib/babel/intro.html
|
|||
: Hello, today's date is Sun Jun 26 16:04:36 2016
|
||||
: Two plus two is
|
||||
|
||||
** Session-based Evaluation
|
||||
*** Session-based Evaluation
|
||||
|
||||
Have a look into /Emacs Speaks Statistics/
|
||||
|
||||
** Arguments to Code Blocks
|
||||
*** Arguments to Code Blocks
|
||||
|
||||
#+name: square
|
||||
#+header: :var x = 0
|
||||
|
@ -91,12 +92,12 @@ Have a look into /Emacs Speaks Statistics/
|
|||
| 1 | 1 | 2 | 3 | 5 | 8 | 13 | 21 | 34 | 55 |
|
||||
| 1 | 3 | 8 | 21 | 55 | 144 | 377 | 987 | 2584 | 6765 |
|
||||
|
||||
** In-line Code Blocks
|
||||
*** In-line Code Blocks
|
||||
|
||||
In-line code can be call without header arguments (like so: src_sh{date}) or
|
||||
with header arguments (like so: src_python[:results value]{return 10 + 10}).
|
||||
|
||||
** Code Block Body Expansion
|
||||
*** Code Block Body Expansion
|
||||
|
||||
Preview: =C-c C-v v=, bound to =org-babel-expand-src-block=
|
||||
|
||||
|
@ -109,7 +110,7 @@ Preview: =C-c C-v v=, bound to =org-babel-expand-src-block=
|
|||
(setq my-special-password (first (second data)))
|
||||
#+end_src
|
||||
|
||||
** A Meta-programming Language for Org-mode
|
||||
*** A Meta-programming Language for Org-mode
|
||||
|
||||
#+name: directories
|
||||
#+begin_src sh :results replace
|
||||
|
@ -131,9 +132,9 @@ Preview: =C-c C-v v=, bound to =org-babel-expand-src-block=
|
|||
|
||||
Note: the syntax =#+name: directory-pie-chart(dirs=directories)= did not work.
|
||||
|
||||
** Using Code Blocks in Org Tables
|
||||
*** Using Code Blocks in Org Tables
|
||||
|
||||
*** Example 1: Data Summaries Using R
|
||||
**** Example 1: Data Summaries Using R
|
||||
|
||||
#+name: tbl-example-data
|
||||
#+begin_src R
|
||||
|
@ -151,17 +152,17 @@ Note: the syntax =#+name: directory-pie-chart(dirs=directories)= did not work.
|
|||
| 0.574235895462334 |
|
||||
#+TBLFM: @2$1='(org-sbe "R-mean" (x "tbl-example-data()"))
|
||||
|
||||
*** Example 2: Babel Test Suite
|
||||
**** Example 2: Babel Test Suite
|
||||
|
||||
/No notes/
|
||||
|
||||
* The Library of Babel
|
||||
** The Library of Babel
|
||||
|
||||
#+lob: square(x=6)
|
||||
|
||||
Does not do what I expected …
|
||||
|
||||
* Literate Programming
|
||||
** Literate Programming
|
||||
|
||||
#+name: hello-world-prefix
|
||||
#+begin_src sh :exports none
|
||||
|
@ -182,4 +183,74 @@ Does not do what I expected …
|
|||
|
||||
Tangling with =C-c C-v t=.
|
||||
|
||||
* Reproducible Research
|
||||
** Reproducible Research
|
||||
|
||||
* Random Notes
|
||||
** How to paste then copy :NOTE:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2018-08-11 Sat 21:47]
|
||||
:END:
|
||||
:LOGBOOK:
|
||||
CLOCK: [2018-08-11 Sat 21:47]--[2018-08-11 Sat 21:48] => 0:01
|
||||
:END:
|
||||
|
||||
Question: how to set a mark such that all subsequent copy operations move their
|
||||
text to that exact mark.
|
||||
|
||||
Answer: use ~cua-selection-mode~! See
|
||||
https://www.reddit.com/r/emacs/comments/8ekz0u/how_to_pastethencopy/.
|
||||
|
||||
/Update/: turns out it doesn’t work so well, disabled it again.
|
||||
** Tramp and Telnet over non-standard ports :NOTE:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2018-12-29 Sat 15:58]
|
||||
:END:
|
||||
|
||||
Syntax: ~/telnet:HOST#PORT:~, works also with other protocols.
|
||||
|
||||
** Magit Walkthrough :NOTE:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2018-08-11 Sat 21:05]
|
||||
:END:
|
||||
|
||||
https://emacsair.me/2017/09/01/magit-walk-through/
|
||||
** Fractals in Emacs :NOTE:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2018-08-04 Sat 13:01]
|
||||
:END:
|
||||
:LOGBOOK:
|
||||
CLOCK: [2018-08-04 Sat 13:01]--[2018-08-04 Sat 13:03] => 0:02
|
||||
:END:
|
||||
|
||||
From https://nullprogram.com/blog/2012/09/14/
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun sierpinski (s)
|
||||
(pop-to-buffer (get-buffer-create "*sierpinski*"))
|
||||
(fundamental-mode) (erase-buffer)
|
||||
(labels ((fill-p (x y)
|
||||
(cond ((or (zerop x) (zerop y)) "0")
|
||||
((and (= 1 (mod x 3)) (= 1 (mod y 3))) "1")
|
||||
(t (fill-p (/ x 3) (/ y 3))))))
|
||||
(insert (format "P1\n%d %d\n" s s))
|
||||
(dotimes (y s) (dotimes (x s) (insert (fill-p x y) " "))))
|
||||
(image-mode))
|
||||
|
||||
(defun mandelbrot ()
|
||||
(pop-to-buffer (get-buffer-create "*mandelbrot*"))
|
||||
(let ((w 400) (h 300) (d 32))
|
||||
(fundamental-mode) (erase-buffer)
|
||||
(set-buffer-multibyte nil)
|
||||
(insert (format "P6\n%d %d\n255\n" w h))
|
||||
(dotimes (y h)
|
||||
(dotimes (x w)
|
||||
(let* ((cx (* 1.5 (/ (- x (/ w 1.45)) w 0.45)))
|
||||
(cy (* 1.5 (/ (- y (/ h 2.0)) h 0.5)))
|
||||
(zr 0) (zi 0)
|
||||
(v (dotimes (i d d)
|
||||
(if (> (+ (* zr zr) (* zi zi)) 4) (return i)
|
||||
(psetq zr (+ (* zr zr) (- (* zi zi)) cx)
|
||||
zi (+ (* (* zr zi) 2) cy))))))
|
||||
(insert-char (floor (* 256 (/ v 1.0 d))) 3))))
|
||||
(image-mode)))
|
||||
#+end_src
|
Loading…
Reference in New Issue
Block a user