[Doc] Updating emacs-notes.org
This commit is contained in:
parent
b20c62073c
commit
f95f965412
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#+options: toc:t
|
#+options: toc:t
|
||||||
|
|
||||||
* Emacs Calc Tutorials
|
* Emacs Calc Tutorials :NOTE:
|
||||||
|
|
||||||
By Andrew Hyatt, found here: https://github.com/ahyatt/emacs-calc-tutorials.
|
By Andrew Hyatt, found here: https://github.com/ahyatt/emacs-calc-tutorials.
|
||||||
License is GPLv3.
|
License is GPLv3.
|
||||||
|
@ -1079,7 +1079,7 @@ The relevant code:
|
||||||
'(("" "total:" ":=vsum(@2..@-1);T" "")))
|
'(("" "total:" ":=vsum(@2..@-1);T" "")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Emacs Lisp Byte-Code :NOTE:
|
** Emacs Lisp Byte-Code :IRREAL:NOTE:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CREATED: [2018-08-11 Sat 21:40]
|
:CREATED: [2018-08-11 Sat 21:40]
|
||||||
:END:
|
:END:
|
||||||
|
@ -1133,49 +1133,7 @@ post and see if you don't agree.
|
||||||
|
|
||||||
[[http://irreal.org/blog/?p=7540][Link]]
|
[[http://irreal.org/blog/?p=7540][Link]]
|
||||||
|
|
||||||
** Inserting a function definition :CHUA:NOTE:
|
** Org Mode Cookbook :IRREAL:NOTE:
|
||||||
:PROPERTIES:
|
|
||||||
:CREATED: [2018-08-04 Sat 17:40]
|
|
||||||
:END:
|
|
||||||
:LOGBOOK:
|
|
||||||
CLOCK: [2018-08-04 Sat 17:40]--[2018-08-04 Sat 17:42] => 0:02
|
|
||||||
:END:
|
|
||||||
|
|
||||||
While nudging jcs to add a definition of =jcs-insert-url= to the blog post about
|
|
||||||
[[http://irreal.org/blog/?p=6924][Making Things Easier]], I realized it might be handy to have a quick function for
|
|
||||||
inserting a function definition without thinking about where it's defined. This
|
|
||||||
tries to use the definition from the source, and it can fall back to using the
|
|
||||||
stored function definition if necessary. There's probably a better way to do
|
|
||||||
this, but this was small and fun to write. =)
|
|
||||||
|
|
||||||
Naturally, I used it to insert itself:
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(defun my/org-insert-defun (function)
|
|
||||||
"Inserts an Org source block with the definition for FUNCTION."
|
|
||||||
(interactive (find-function-read))
|
|
||||||
(let* ((buffer-point (condition-case nil
|
|
||||||
(find-definition-noselect function nil)
|
|
||||||
(error nil)))
|
|
||||||
(new-buf (car buffer-point))
|
|
||||||
(new-point (cdr buffer-point))
|
|
||||||
definition)
|
|
||||||
(if buffer-point
|
|
||||||
(with-current-buffer new-buf ;; Try to get original definition
|
|
||||||
(save-excursion
|
|
||||||
(goto-char new-point)
|
|
||||||
(setq definition (buffer-substring-no-properties
|
|
||||||
(point)
|
|
||||||
(save-excursion (end-of-defun) (point))))))
|
|
||||||
;; Fallback: Print function definition
|
|
||||||
(setq definition (concat (prin1-to-string
|
|
||||||
(symbol-function function))
|
|
||||||
"\n")))
|
|
||||||
(insert "#+begin_src emacs-lisp\n" definition "#+end_src\n")))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
[[http://sachachua.com/blog/2018/01/org-mode-inserting-a-function-definition/][Link]]
|
|
||||||
** Org Mode Cookbook :NOTE:
|
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CREATED: [2018-08-04 Sat 12:51]
|
:CREATED: [2018-08-04 Sat 12:51]
|
||||||
:END:
|
:END:
|
||||||
|
@ -1273,7 +1231,7 @@ From https://nullprogram.com/blog/2012/09/14/
|
||||||
(insert-char (floor (* 256 (/ v 1.0 d))) 3))))
|
(insert-char (floor (* 256 (/ v 1.0 d))) 3))))
|
||||||
(image-mode)))
|
(image-mode)))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Introduction to Babel
|
** Introduction to Babel :NOTE:
|
||||||
|
|
||||||
Tutorial from http://orgmode.org/worg/org-contrib/babel/intro.html
|
Tutorial from http://orgmode.org/worg/org-contrib/babel/intro.html
|
||||||
|
|
||||||
|
@ -1455,7 +1413,7 @@ Does not do what I expected …
|
||||||
|
|
||||||
Tangling with =C-c C-v t=.
|
Tangling with =C-c C-v t=.
|
||||||
|
|
||||||
** Presentations with ~org-reveal~
|
** Presentations with ~org-reveal~ :NOTE:
|
||||||
|
|
||||||
Website: https://github.com/yjwen/org-reveal
|
Website: https://github.com/yjwen/org-reveal
|
||||||
|
|
||||||
|
@ -1480,7 +1438,7 @@ Sample:
|
||||||
| 1 | 2 | 3 |
|
| 1 | 2 | 3 |
|
||||||
* Slide 3
|
* Slide 3
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Writing a PhD thesis with Org Mode
|
** Writing a PhD thesis with Org Mode :NOTE:
|
||||||
|
|
||||||
From: https://write.as/dani/writing-a-phd-thesis-with-org-mode
|
From: https://write.as/dani/writing-a-phd-thesis-with-org-mode
|
||||||
|
|
||||||
|
@ -1895,7 +1853,7 @@ _s_: thesis.setup _4_: Research 4 ^ ^
|
||||||
|
|
||||||
(global-set-key (kbd "H-t") 'spacemacs/thesis-menu-transient-state/body)
|
(global-set-key (kbd "H-t") 'spacemacs/thesis-menu-transient-state/body)
|
||||||
#+end_src
|
#+end_src
|
||||||
** Gnus and notmuch
|
** Gnus and notmuch :NOTE:
|
||||||
|
|
||||||
Currently working: notmuch for nnmaildir backend. However, I also have a local
|
Currently working: notmuch for nnmaildir backend. However, I also have a local
|
||||||
nnimap-backend, which uses Maildir format locally. It would be nice to have
|
nnimap-backend, which uses Maildir format locally. It would be nice to have
|
||||||
|
@ -1912,3 +1870,53 @@ Relevant functions:
|
||||||
[2016-08-13 Sat 17:50]
|
[2016-08-13 Sat 17:50]
|
||||||
|
|
||||||
http://www.omps.in/blog/2016/01/20/day-10-search-and-replace-using-regex/
|
http://www.omps.in/blog/2016/01/20/day-10-search-and-replace-using-regex/
|
||||||
|
** Bookmarks with Org-mode
|
||||||
|
:PROPERTIES:
|
||||||
|
:CREATED: [2018-07-08 Sun 09:29]
|
||||||
|
:END:
|
||||||
|
|
||||||
|
[[http://karl-voit.at/2014/08/10/bookmarks-with-orgmode/]]
|
||||||
|
|
||||||
|
** Inserting a function definition :CHUA:NOTE:
|
||||||
|
:PROPERTIES:
|
||||||
|
:CREATED: [2018-08-04 Sat 17:40]
|
||||||
|
:END:
|
||||||
|
:LOGBOOK:
|
||||||
|
CLOCK: [2018-08-04 Sat 17:40]--[2018-08-04 Sat 17:42] => 0:02
|
||||||
|
:END:
|
||||||
|
|
||||||
|
From [[http://sachachua.com/blog/2018/01/org-mode-inserting-a-function-definition/][Sacha Chua]].
|
||||||
|
|
||||||
|
While nudging jcs to add a definition of =jcs-insert-url= to the blog post about
|
||||||
|
[[http://irreal.org/blog/?p=6924][Making Things Easier]], I realized it might be handy to have a quick function for
|
||||||
|
inserting a function definition without thinking about where it's defined. This
|
||||||
|
tries to use the definition from the source, and it can fall back to using the
|
||||||
|
stored function definition if necessary. There's probably a better way to do
|
||||||
|
this, but this was small and fun to write. =)
|
||||||
|
|
||||||
|
Naturally, I used it to insert itself:
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun my/org-insert-defun (function)
|
||||||
|
"Inserts an Org source block with the definition for FUNCTION."
|
||||||
|
(interactive (find-function-read))
|
||||||
|
(let* ((buffer-point (condition-case nil
|
||||||
|
(find-definition-noselect function nil)
|
||||||
|
(error nil)))
|
||||||
|
(new-buf (car buffer-point))
|
||||||
|
(new-point (cdr buffer-point))
|
||||||
|
definition)
|
||||||
|
(if buffer-point
|
||||||
|
(with-current-buffer new-buf ;; Try to get original definition
|
||||||
|
(save-excursion
|
||||||
|
(goto-char new-point)
|
||||||
|
(setq definition (buffer-substring-no-properties
|
||||||
|
(point)
|
||||||
|
(save-excursion (end-of-defun) (point))))))
|
||||||
|
;; Fallback: Print function definition
|
||||||
|
(setq definition (concat (prin1-to-string
|
||||||
|
(symbol-function function))
|
||||||
|
"\n")))
|
||||||
|
(insert "#+begin_src emacs-lisp\n" definition "#+end_src\n")))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue