From f95f965412b0c507ca25f8f9b8534ad37b0bccb0 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 9 Feb 2019 18:45:04 +0100 Subject: [PATCH] [Doc] Updating emacs-notes.org --- doc/emacs-notes.org | 106 ++++++++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 49 deletions(-) diff --git a/doc/emacs-notes.org b/doc/emacs-notes.org index 39fd427..f129a69 100644 --- a/doc/emacs-notes.org +++ b/doc/emacs-notes.org @@ -3,7 +3,7 @@ #+options: toc:t -* Emacs Calc Tutorials +* Emacs Calc Tutorials :NOTE: By Andrew Hyatt, found here: https://github.com/ahyatt/emacs-calc-tutorials. License is GPLv3. @@ -1079,7 +1079,7 @@ The relevant code: '(("" "total:" ":=vsum(@2..@-1);T" ""))) #+end_src -** Emacs Lisp Byte-Code :NOTE: +** Emacs Lisp Byte-Code :IRREAL:NOTE: :PROPERTIES: :CREATED: [2018-08-11 Sat 21:40] :END: @@ -1133,49 +1133,7 @@ post and see if you don't agree. [[http://irreal.org/blog/?p=7540][Link]] -** 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: - -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: +** Org Mode Cookbook :IRREAL:NOTE: :PROPERTIES: :CREATED: [2018-08-04 Sat 12:51] :END: @@ -1273,7 +1231,7 @@ From https://nullprogram.com/blog/2012/09/14/ (insert-char (floor (* 256 (/ v 1.0 d))) 3)))) (image-mode))) #+end_src -** Introduction to Babel +** Introduction to Babel :NOTE: 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=. -** Presentations with ~org-reveal~ +** Presentations with ~org-reveal~ :NOTE: Website: https://github.com/yjwen/org-reveal @@ -1480,7 +1438,7 @@ Sample: | 1 | 2 | 3 | * Slide 3 #+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 @@ -1895,7 +1853,7 @@ _s_: thesis.setup _4_: Research 4 ^ ^ (global-set-key (kbd "H-t") 'spacemacs/thesis-menu-transient-state/body) #+end_src -** Gnus and notmuch +** Gnus and notmuch :NOTE: 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 @@ -1912,3 +1870,53 @@ Relevant functions: [2016-08-13 Sat 17:50] 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 +