init-org.org 65 KB

Org-mode is Emacs' organizational mode, and it is amazing! Here is an online example configuration that is a little more thorough than this configuration.

Setting up Org-plugins

org mime

:PROPERTIES: :ID: b1838e30-a287-48cd-8267-3b36a25a8115 :END:

http://orgmode.org/worg/org-contrib/org-mime.html

I want to figure out how to install this, because I could then write html emails trivially with gnus

#+BEGIN_SRC emacs-lisp (use-package org-mime :defer t) #+END_SRC

imported code from http://orgmode.org/worg/org-contrib/org-mime.html

for those who use color themes with Dark backgrounds it is useful to set a dark background for all exported code blocks and example regions. This can be accomplished with the following: And you should totally do this! it looks SOO COOOL! #+BEGIN_SRC emacs-lisp ;; I'm having problems with this ;;(add-hook 'org-mime-html-hook ;;(lambda () ;;(org-mime-change-element-style ;;"pre" (format "color: %s; background-color: %s; padding: 0.5em;" ;;"#E6E1DC" "#232323")))) #+END_SRC

the following can be used to nicely offset block quotes in email bodies #+BEGIN_SRC emacs-lisp ;; I'm having problems with this ;;(add-hook 'org-mime-html-hook ;;(lambda () ;;(org-mime-change-element-style ;;"blockquote" "border-left: 2px solid gray; padding-left: 4px;"))) #+END_SRC

end imported code

org babel

Org babel lets you run code snippets inside org-mode! It's a great literate programming environment!

To edit a source code block, with point on the src block, type "C-c '". For example move point to the next "#" on the =#+BEGIN_SRC= block, then type "C-c '".


  ,#+BEGIN_SRC sh
  ls
  ,#+END_SRC

  ;; ob-http is needed to run http calls inside org-mode
  (use-package ob-http  :defer t)
  (setq geiser-default-implementation 'guile)

  ;; TODO FIXME this defun needs to be deleted
  ;; the org-mode has removed org-babel-get-header
  ;; ob-sh needs to update to use the new version.
  ;; (defun org-babel-get-header (params key &optional others)
  ;;   (delq nil
  ;;         (mapcar
  ;;          (lambda (p) (when (funcall (if others #'not #'identity) (eq (car p) key)) p))
  ;;          params)))

  (with-eval-after-load 'org
    (org-babel-do-load-languages
     'org-babel-load-languages
     '(
       (awk . t)
       (calc . t)
       (C . t)
       (emacs-lisp . t)
       (haskell . t)
       ;;(http . t)
       (gnuplot . t)
       ;;(latex . t)
       (ledger . t)
       (js . t)
       (perl . t)
       (python . t)
       (gnuplot . t)
       ;;org-babel does not currently support php.  That is really sad.
       ;;(php . t)
       ;;(R . t)
       (shell . t)
       (scheme . t)
       ;;(sh . t)
       (sql . t)
       ;;(sqlite . t)
       )))

  (setq org-latex-create-formula-image-program 'imagemagick)

  ;; DO NOT set up ditaa.  It breaks (helm-find-files) C-x C-f
  ;;(ditaa . t)
  ;;(setq org-ditaa-jar-path "/usr/share/java/ditaa/ditaa-0_9.jar")
  ;; display inline images in org-mode
  ;;(add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)

Don't ask me for permission to run an org-babel block. I know what I am doing.


  (setq org-confirm-babel-evaluate nil)

Let's disable flycheck in org babel code blocks.

https://emacs.stackexchange.com/questions/16766/how-to-turn-off-emacs-lisp-checkdoc-of-flycheck-when-edit-source-block-in-org

It in super annoying to open up a code block in org-mode, and flycheck give you pointless errors about emacs-lisp. Essentially it'll say something like "You should start your code with ;;;Commentary:". But this is a simple code snippet. I don't need that!


  (defun my/disable-flycheck-in-org-src-block ()
    (setq-local flycheck-disabled-checkers '(emacs-lisp-checkdoc)))

  (add-hook 'org-src-mode-hook 'my/disable-flycheck-in-org-src-block)

org-id

New versions of org have removed org-babel get header. Some plugins still use it. So I'm defining it until they catch up. Org-id is a way to create unique IDs to org-mode files. Each heading can have a unique ID. Org can then create a link to that heading. The link will still work, even if you move entry IDs between files.


  (require 'org-id)
    (add-hook 'org-mode-hook '(lambda ()
                                (setq org-id-link-to-org-use-id t)))

org-bullets

Turn on org bullets mode for Emacs. It turns all the * into utf-8 bullets.

This works because I've got emacs-org-bullets installed in my profile.


(add-hook 'org-mode-hook 'org-bullets-mode)

  (setq  org-bullets-bullet-list '("◉" "◎" "♠" "○" "►" "◇"))

org gnu-plot


(use-package gnuplot :defer t)

I can use org-mode to plot tables via gnu plot!

Just type C-"g below. Or org-plot/gnuplot

Sede Max cites H-index
Chile 257.72 21.39
Leeds 165.77 19.68
Sao Paolo 71.00 11.50
Stockholm 134.19 14.33
Morelia 257.56 17.67

org-crypt

Encrypting text under a heading in org info:org#org-crypt Any text below a headline that has a `:crypt:' tag will be automatically be encrypted when the file is saved. If you want to use a different tag just customize the `org-crypt-tag-matcher' setting. So the following org heading would be encrypted

#+BEGIN_SRC org ,* encrypted :crypt: -----BEGIN PGP MESSAGE----- Version: GnuPG v2

hQEMA8CBlfhZifrPAQgArs3jyd5tVD5v1XCeort5/iftb+xBhNZ2wM4qPtwSValY hO/dENekYvYl3SyiX9lhBVZM8C+a5aMhrvorHlzqJc5AX/YL2HK3T9liODFZp7Wi Z3ZDTSQUXdNRP7bcvBR5OdetPG5knLDLCyAbfGwWbmpT10m/oufsFZtOnbv+109q 2ffMmA2e2b+GycFH8H3IvRUz4kUW712ONk9wEI4fHH/09RWp7ouNlSvhs5ZWn1hm p57IjIulducRe+ZBkeA3TPfIGtEzczoKQUbTD9uVgWQ5ZW0SRQgFpXBv4oamudf0 N6XqZ1XI6jJycKG49GhHe+zkwD31cmRNfOx1bFWePNJKAZEtVJ/5uU+mUY3i786I Lnldc/ZU9oLqULVoZ6q2cufXI+7A1ghOVqeKTgT6UPFny6eww7hg/EKI3bsmhbCs 8Sa1s2Yws8ral/s= =/leP -----END PGP MESSAGE----- #+END_SRC

To use org-crypt it is suggested that you have the following in your `.emacs':

#+BEGIN_SRC emacs-lisp (use-package org-crypt :config (org-crypt-use-before-save-magic) (setq org-tags-exclude-from-inheritance (quote ("crypt")))) #+END_SRC

I personally don't use org-crypt too much anymore. 1 It automatically encrypts the text you are working on when you save the file. I find it is easier just to encrypt the entire file via M-x epa-encrypt-file.

#+RESULTS: | crypt |

GPG key to use for encryption Either the Key ID or set to nil to use symmetric encryption. This is my key for my email address. #+BEGIN_SRC emacs-lisp (setq org-crypt-key "77445DFD3169C49D99CE81C0CC33963C759F6C8A") #+END_SRC

Auto-saving does not cooperate with org-crypt.el: so you need to turn it off if you plan to use org-crypt.el quite often. Otherwise, you'll get an (annoying) message each time you start Org. To turn it off only locally, you can insert this:

COMMENT disabling autosave on org buffers that have a "crypt" tag.

# -*- buffer-auto-save-file-name: nil; -*- #+BEGIN_SRC emacs-lisp (defun my/turn-off-auto-save-on-org-buffers-with-crypt-tags () "This function will get called when org-mode opens a file. If the file has any crypt tags, then that buffer will disable autosave." (let ((my/org-ast (org-element-parse-buffer)) (when t ;;ast has a :crypt: tag (setq buffer-auto-save-file-name nil) )) )) (add-hook 'org-mode-hook 'my/turn-off-auto-save-on-org-buffers-with-crypt-tags)

(setq my/org-ast (org-element-parse-buffer)) ;;(setq auto-save-default nil) #+END_SRC

The my/org-ast parses the whole buffer. All elements or objects are represented as a list with this pattern: (TYPE PROPERTIES CONTENTS).

TYPE is a symbol describing the element or object. See ‘org-element-all-elements’ and ‘org-element-all-objects’ for an exhaustive list of such symbols. One can retrieve it with ‘org-element-type’ function.

PROPERTIES is the list of attributes attached to the element or object, as a plist. Although most of them are specific to the element or object type, all types share ‘:begin’, ‘:end’, ‘:post-blank’ and ‘:parent’ properties, which respectively refer to buffer position where the element or object starts, ends, the number of white spaces or blank lines after it, and the element or object containing it. Properties values can be obtained by using ‘org-element-property’ function.

CONTENTS is a list of elements, objects or raw strings contained in the current element or object, when applicable. One can access them with ‘org-element-contents’ function.

The Org buffer has ‘org-data’ as type and nil as properties. ‘org-element-map’ function can be used to find specific elements or objects within the parse tree.

This function assumes that current major mode is ‘org-mode’.

COMMENT org plugins that I don't use

COMMENT org invoice

#+BEGIN_SRC emacs-lisp :tangle no (use-package org-invoice) #+END_SRC

#+RESULTS:

org-invoice

This lests you manage invoices with org-mode. It is pretty cool! You can create invoices with the following format. And just call org-invoice-report on the begin invoice. Be careful NOT to put an inactive time stamp anywhere in the tree unless you want that parent to show up in the invoice. ie: If you create a notes heading, don't have an inactive time stamp like <2015-09-02 Sat> because when you generate that invoice, Notes will show up in the invoice even though it has no time associated with it

#+BEGIN_SRC org ,* Working for Some Company

,#+BEGIN: invoice

| Task / Date | Time | Price | |-------------------------------+------+--------| | Wednesday, September 02, 2015 | 9:57 | 149.25 | | HTML Design | 9:57 | 149.25 | |-------------------------------+------+--------| | Total: | 9:16 | 149.00 | ,#+END: #+END_SRC

COMMENT org-notify lets you know when you have upcoming appointments

I would like to get this set up so that it shows pop-ups using a lua script. That way I can set it up to use awesome's pop up library. At the moment it only notifies you when you have approaching deadlines and only certain ones. It's a little odd. #+BEGIN_SRC emacs-lisp :tangle no (use-package org-notify :config (org-notify-add 'appt '(:time "-1s" :period "20s" :duration 10 :actions (-message -ding)) '(:time "15m" :period "2m" :duration 100 :actions -notify) '(:time "2h" :period "5m" :actions -message) '(:time "3d" :actions -email))) (add-hook 'after-init-hook 'org-notify-start)

#+END_SRC

COMMENT org-inlinetask

#+RESULTS: | default | ((:time 1h :actions -notify/window :period 2m :duration 60)) | appt | ((:time -1s :period 20s :duration 10 :actions (-message -ding)) (:time 15m :period 2m :duration 100 :actions -notify) (:time 2h :period 5m :actions -message) (:time 3d :actions -email)) | Org inline task lets you define an inline task without treating it like a headline #+BEGIN_SRC emacs-lisp :tangle no (use-package org-inlinetask) #+END_SRC

#+RESULTS:

org-inlinetask

Suppose you have something like this where point is at point:

    #+BEGIN_SRC org
  • [X] Call the farmer about buying his cows

POINT

I let him know that his cows were all rather nice and left a voicemail. If he does not get back to me, Then I'll have to call him again

  • [ ] call your momma
  • Let her know she's a good Mom #+END_SRC

Pressing C-c C-x t will insert an inline task like the one below

    #+BEGIN_SRC org
  • [X] Call the farmer about buying his cows
  • ,*************** Call Mark S. Davis today again about making his site better. If he does not respond move on. SCHEDULED: <2015-11-30 Mon> ,*************** END I let him know that his cows were all rather nice and left a voicemail. If he does not get back to me, Then I'll have to call him again

COMMENT org-habit

  • [ ] call your momma
  • Let her know she's a good Mom #+END_SRC Org habit is a nice way to let you know how well you are doing on your habits. It shows you a nice little color graph in your agenda view. It is kind of cool. #+BEGIN_SRC emacs-lisp :tangle no (use-package org-habit) #+END_SRC

#+RESULTS:

COMMENT org-protocal

org-habit

Org protocal allows you to capture things from firefox or other applications! Cool!


  (add-hook 'org-mode-hook '(lambda ()
                              (require 'org-protocol)))

COMMENT org-php

org-protocol

This would be very cool if org-mode had this. I need to have a php REPL available if I am going to get an ob-php.


(use-package psysh )

My org-mode preferences

A big setq

Make calendar highlight upcoming items


  (setq org-hide-leading-stars t)

setting the startup visibility option

:PROPERTIES: :ID: 4c700c0a-ff39-414c-b48e-b9afcee3c245 :END:

Why is this not working? When I open org- files it starts up with everything opened! #+BEGIN_SRC emacs-lisp (setq org-startup-folded "fold") #+END_SRC

Seeing the ... that org mode does to how you that the heading continues in the text beneith it is kind of boring

http://endlessparentheses.com/changing-the-org-mode-ellipsis.html?source=rss Other interesting characters are ↴, ⬎, ⤷, and ⋱.


(setq org-ellipsis " ↴")


  (setq org-return-follows-link t)

Make org show inline images by default.

This makes a link to a file show the image, so instead of seeing:


  ,#+CAPTION here is an image
  ,#+NAME:   fig:an image
  [[./path/to/file.png]]

You would see the image.

This can be overridden by #+STARTUP: noinlineimages


  (setq org-startup-with-inline-images t)

Don't let me accidentally delete text without realizing it in org.

For example, point may be buried in a subtree, but you only see the heading. Without knowing it, you might accidentally kill a line that you did not intend to kill. This might not be supported for evil-mode.


  (setq org-catch-invisible-edits 'show-and-error)

Whenever I change state from TODO to DONE org will log that timestamp, and let's put that in a drawer.


  (setq  org-log-into-drawer t)

Make org-mode record the date when you finish a task.


  (setq org-log-done 'time)

When you press S-down, org changes the timestamp under point


  (setq org-edit-timestamp-down-means-later t)

Setting up Org-mode's default back-ends to use.

Please note that to use the odt backend, you must have the zip program installed.


  (setq org-export-backends '(ascii html latex odt md rss texinfo))

Where to put the tags: ie: action or work

#+BEGIN_SRC emacs-lisp (setq org-tags-column 60) #+END_SRC

COMMENT Activate org speed commands. When cursor is on heading, pressing a single key can activate certain commands in Emacs mode. This can be useful on a mobile device. I'm on a computer, so I don't need this.

#+BEGIN_SRC emacs-lisp :tangle no ;; (setq org-use-speed-commands t) #+END_SRC

random things?

#+BEGIN_SRC emacs-lisp (setq ;; only show times on items in the agenda, if we have an item at a specified time ;; if we set it to true, then we see all the times every 2 hours. Takes up too much space. ;; org-agenda-use-time-grid nil ;;org-log-done 'nil ;; this tells org-mode to only quit selecting tags for things when you tell it that you are done with it org-fast-tag-selection-single-key nil org-html-validation-link nil org-export-kill-product-buffer-when-displayed t org-modules '(org-bbdb org-gnus org-info org-invoice man org-toc org-habit org-mime org-crypt org-bullets org-id) ;; load in the org-modules ;;org-load-modules-maybe t )

#+END_SRC

COMMENT org refile


(setq org-outline-path-complete-in-steps nil)

This may be helpful, but I don't believe that I need it. (require 'helm-config) already does this I think.


(setq org-completion-use-ido nil)

what files org-mode opens

Emacs will open files that end in "org" and "txt" in org-mode.


(add-to-list 'auto-mode-alist '("\\.\\(org\\|txt\\)$" . org-mode))
;;(setq org-default-notes-file (concat org-directory "/notes.org"))

org yasnippet

Org-mode does not play well with yasnippet. So this function that I got here info:org#Conflicts should help with making yasnippet play well with org-mode. It seems to 1st make TAB try to do any org expanding, then it'll try to expand a yasnippet.


(defun yas/org-very-safe-expand ()
    (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))

Make org-mode a little prettier. Turn strings like "<=" into "≤".

:PROPERTIES: :ID: 6ba65d8b-873b-494f-bdeb-2b0e10416c9e :END:

I should add this character for predicate logic: ∀

#+BEGIN_SRC emacs-lisp (defun my/turn-strings-into-utf8-chars () "Turn strings like '<=' into '≤'." (push '(">=" . ?≥) prettify-symbols-alist) (push '("<=" . ?≤) prettify-symbols-alist) (push '("\\geq" . ?≥) prettify-symbols-alist) (push '("\\leq" . ?≤) prettify-symbols-alist) (push '("\\neg" . ?¬) prettify-symbols-alist) (push '("\\rightarrow" . ?→) prettify-symbols-alist) (push '("\\leftarrow" . ?←) prettify-symbols-alist) (push '("\\infty" . ?∞) prettify-symbols-alist) (push '("-->" . ?→) prettify-symbols-alist) (push '("<--" . ?←) prettify-symbols-alist) (push '("\\lambda" . ?λ) prettify-symbols-alist) (push '("\\exists" . ?∃) prettify-symbols-alist) (push '("\\nexists" . ?∄) prettify-symbols-alist) (push '("\\forall" . ?∀) prettify-symbols-alist) (push '("\\or" . ?∨) prettify-symbols-alist) (push '("\\and" . ?∧) prettify-symbols-alist) (push '(":)" . ?☺) prettify-symbols-alist) (push '("):" . ?☹) prettify-symbols-alist) (push '(":D" . ?☺) prettify-symbols-alist) (push '("\\checkmark" . ?✓) prettify-symbols-alist) (push '("\\check" . ?✓) prettify-symbols-alist) (push '("1/4" . ?¼) prettify-symbols-alist) (push '("1/2" . ?½) prettify-symbols-alist) (push '("3/4" . ?¾) prettify-symbols-alist) (push '("1/7" . ?⅐) prettify-symbols-alist) ;; ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞ (push '("ae" . ?æ) prettify-symbols-alist) (push '("^_^" . ?☻) prettify-symbols-alist))

(add-hook 'org-mode-hook 'my/turn-strings-into-utf8-chars) #+END_SRC

#+BEGIN_SRC emacs-lisp :tangle no ;; I want to get write-good-mode set up again, because it's awesome. (use-package writegood-mode :defer t)

fix space inside an org mode

;; (add-hook 'org-mode-hook '(lambda () ;; ;; (make-variable-buffer-local 'yas/trigger-key) ;; ;;(setq yas/trigger-key [tab]) ;; ;;(add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand) ;; ;; (define-key yas/keymap [tab] 'yas/next-field) ;; ;; apparently this does the same thing as the above combined modes ;; ;; this seems to work better than visual line mode. Why have I not heard of this before? ;; ;;(toggle-word-wrap) ;; ;;make ">" look like >, etc. ;; ) #+END_SRC :PROPERTIES: :ID: 07013075-25a4-4e9f-8ecb-91aef52e2235 :END:

Make C-c SPC inside an org table mean clear that table section. If you are outside of an org table, make it mean just one space.

#+BEGIN_SRC emacs-lisp (defun my/just-one-space () (interactive) (if (org-at-table-p) (org-table-blank-field) (just-one-space)))

auto-fill-mode

(with-eval-after-load 'org (define-key org-mode-map (kbd "C-c SPC") 'my/just-one-space) (define-key org-mode-map (kbd "C-c /") 'helm-swoop)) #+END_SRC :PROPERTIES: :ID: f39a2dda-b7a8-454a-b5f2-7a5dc5d15710 :END:

Make Emacs autofill my paragraphs as I type in org buffers.

#+BEGIN_SRC emacs-lisp (add-hook 'org-mode-hook 'auto-fill-mode) #+END_SRC

tags

:PROPERTIES: :ID: f217c699-23c2-4a58-bb59-73b639c8447a :END: Org mode has excellent support to store tags on each headline. Each tag is inherited be the headlines beneath it. This can make searching for information easier.

Here is an example tag:

#+BEGIN_SRC org ,* Simple Reference :reference: ,** There are 16 ounces in one pound. #+END_SRC

The tag is "reference". Everything under the "Simple reference" heading, tagged as a reference. I can search for references via the agenda buffer now "C-c a m". Pretty cool no? Here are my global tags:

Perhaps I should consider using info:org#Tag hierarchy group tags! I could make career and job tags related.

not_important important urgent not_urgent

#+BEGIN_SRC emacs-lisp (setq org-tag-alist '( ("community" . ?c) (:startgrouptag) ("career" . ?r) (:grouptags) ("job" . ?j) (:endgrouptag) ("crypt" . ?t) (:startgroup . nil) ("@important" . ?i) ("@not_important" . ?m) (:endgroup . nil) ("noexport" . ?n) ("reference" . ?e) ("reward" . ?d) (:startgroup . nil) ("@someday" . ?o) ("@urgent" . ?u) ("@not_urgent" . ?-) (:endgroup . nil) )) ;;("action" . ?a)

;;("waiting" . ?w) I am using TODO keyword WAITING for this now. #+END_SRC

#+BEGIN_SRC emacs-lisp (setq org-tag-faces '( ("action" . (:weight bold :foreground "#CC9393")) ;; ("community" . ) ;; ("career" . ) ;; ("crypt" . ) ;; ("gnu" . ) ;; ("job" . ) ;; ("noexport" . ) ("project" . '(:foreground "#4da6ff" :weight bold) )) ;;blue ;; ("someday" . ) ;; ("reference" . ) ;; ("reward" . ) ;; ("waiting" . ) ) #+END_SRC

my org capure templates

:PROPERTIES: :ID: e7e19c92-c2a6-437c-8aad-df01fe3c8437 :END:

This is SOOOO USEFUL!!!! Org capture lets you quickly jot down a thought that you have and place it in a file under a file and heading that you specify. I have captchas for shopping, for books to read, for things to do, etc. PLEASE USE THIS!

#+BEGIN_SRC emacs-lisp (let ((base-dir "~/prog/org/projects/") (todo-string "* TODO %?\nEntered on %U\n %i\n %a") (someday-string "* %?\nEntered on %U\n %i\n %a") (reference-string "* %?\nEntered on %U\n %i\n %a"))

(setq org-capture-templates `(

("B" "Things I want to buy" entry (file+headline ,(concat base-dir "managing-my-monies.org") "things I want to buy") ,reference-string)

("c" "Computers Anything")

;; Emacs things ("ce" "Emacs")

("ceb" "bugs" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "Emacs bugs someday") ,someday-string)

("ceb" "evil-mode someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "evil someday") ,todo-string)

("cef" "flycheck someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "flycheck-mode") ,todo-string)

("ceo" "Org-mode someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "org mode someday") ,someday-string)

("ceR" "Emacs Reference") ("ceRR" "Emacs Reference" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "emacs reference") ,reference-string) ("ceRe" "emacs evil reference" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "evil reference") ,todo-string) ("ceRg" "emacs gnus reference" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "gnus reference") ,reference-string) ("ceRo" "emacs org reference" entry (file+headline , (concat base-dir "become-an-awesome-hacker.org") "org reference") ,reference-string) ("ceRm" "emacs magit reference" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "tags reference") ,reference-string) ("ceRt" "emacs tags reference" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "tags reference") ,reference-string)

("cet" "emacs Todo") ("cett" "emacs Todo" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "emacs someday") ,someday-string) ("cete" "emacs evil someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "evil someday") ,someday-string) ("cetf" "emacs flycheck someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "flycheck someday") ,someday-string) ("cetg" "emacs gnus someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "gnus someday") ,someday-string) ("ceth" "emacs helm someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "helm someday") ,someday-string) ("ceto" "emacs org someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "org someday") ,someday-string) ("cetT" "emacs tags someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "tags someday") ,todo-string) ("cetw" "web-mode someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "web-mode someday") ,todo-string) ;;End Emacs things

("cG" "Gimp Basics Reference" entry (file+headline "~/prog/cheatsheets/gimp.org" "Basic Concepts") ,reference-string)

("cg" "Guix someday" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "Guix someday") ,someday-string)

("cH" "The GNU HURD") ("cHt" "Hurd" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "Hurd") ,someday-string) ("ct" "General Computer TODO" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "General TODO") ,someday-string) ("ch" "high star todo" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "make high star an android app") "* todo %?\n %i\n %a") ("cl" "linux TODO" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "linux someday") ,someday-string) ("cL" "Linux Reference" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "linux reference") ,reference-string) ("co" "organ TODO" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "make organ an android app") ,someday-string) ("cf" "Free the world" entry (file+headline "~/prog/org/gtd.org" "free the world free content") ,reference-string)

("cW" "Web")

("cWB" "Bootstrap Reference" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "Bootstrap reference") ,reference-string)

("cWW" "Web reference" entry (file+headline ,(concat base-dir "become-an-awesome-hacker.org") "Web reference") ,reference-string)

;; make a HTML reference or CSS reference

("C" "Community") ("Cc" "community TODO" entry (file+headline ,(concat base-dir "being-social.org") "community someday") ,someday-string)

("Cn" "nice things to say" entry (file+headline "~/prog/org/projects/get-close-to-God.org" "nice things to say") ,someday-string) ("Cs" "Social Skills Notes" entry (file+headline ,(concat base-dir "being-social.org") "Social Skills Notes") ,reference-string)

("C" "Calendar TODO" entry (file+headline "~/prog/org/gtd.org" "Calendar") ,someday-string)

("e" "entertainment") ("eb" "Books to Read" entry (file+headline ,(concat base-dir "whatever-I-want.org") "Books to Read") "* %i\n %a") ("eM" "Good Movies Reference" entry (file+headline ,(concat base-dir "whatever-I-want.org") "Good Movies") "* %i\n %a") ("em" "movies to watch" entry (file+headline ,(concat base-dir "whatever-I-want.org") "movies to watch") "* %i\n %a") ("eU" "good music reference" entry (file+headline ,(concat base-dir "whatever-I-want.org") "good music reference") "* %i\n %a") ("eg" "games to play" entry (file+headline ,(concat base-dir "whatever-I-want.org") "games to play") "* %i\n %a")

("g" "getting close to God") ("gg" "get a close friend" entry (file+headline "/home/joshua/prog/org/projects/get-close-to-God.org" "get a close friend") ,someday-string) ("gb" "Boundaries") ("gbn" "Boundary Notes" entry (file+headline "~/prog/org/gtd.org" "Boundary Notes") ,reference-string) ("gbl" "Lowering My Expectations of Myself" entry (file+headline "~/prog/org/gtd.org" "Lowering My Expectations of Myself") ,reference-string) ("gbs" "Boundaries To Enforce" entry (file+headline "~/prog/org/projects/get-close-to-God.org" "Setting Boundaries") ,someday-string)

("M" "Math") ("Mf" "fun math problems" entry (file+headline "/home/joshua/prog/org/projects/math.org" "fun math problems") ,someday-string) ("p" "payless TODO" entry (file+headline "~/prog/org/gtd.org" "shopping todo") ,someday-string) ("r" "Reference" entry (file+headline "~/prog/org/gtd.org" "general reference") ,reference-string) ("t" "TODO" entry (file+headline "~/prog/org/gtd.org" "general todo") ,todo-string) ("w" "Weblink" entry (file (expand-file-name "~/prog/org/gtd.org" "org capture")) "* %c\n :PROPERTIES:\n :CREATED: %U\n :END:\n - Quote:\n %i" :unnarrowed)

("q" "Quotations" entry (file+headline "~/prog/org/quotes.org" "Quotations") ,reference-string) ))) #+END_SRC

Fixing jumping to an org capture location

:PROPERTIES: :ID: d8b171fb-ffae-4032-a2c4-0a1f1b9287c3 :END:

Essentially when I jump to an org-capture location via C-u C-c c, I sometimes do not see the heading properly. The document will be loaded with STARTUP overview. org-reveal is a command that I can manuall call with C-c C-r to fix this. But this command should be called automatically after I just to an org-capture location.

#+BEGIN_SRC emacs-lisp (defun my/org-capture (arg) "This contains my tweak of org-capture. If I can org-capture via C-u C-c c, then I want to call org-reveal after org-capture-goto-target." (interactive "P") (if (not arg) (org-capture) (progn (org-capture-goto-target) (org-reveal))))

(defun my/redefine-org-capture () (define-key org-mode-map (kbd "C-c c") 'my/org-capture))

(add-hook 'org-mode-hook 'my/redefine-org-capture) #+END_SRC

Agenda Configuration

I should take a look at using this at some point! This might be cool! info:org#Special agenda views

Org mode has a fabulous method of storing your TODO items and then organizing them into pretty views for you. This view is called the agenda view. You can query the agenda view to look for all your TODO items, to look for "stuck projects", etc.

I would like to generate my org-agenda-files

You can easily create custom icons to show up in your agenda next to your specific tasks. My icons are all about 30 by 30 px. #+BEGIN_SRC emacs-lisp (setq org-agenda-category-icon-alist '( ("hacker" "/home/joshua/pictures/org-icons/gnu-linux-icon.png" nil nil nil nil) ("MAKING CASH" "/home/joshua/pictures/org-icons/money.png" nil nil nil nil) ("SEEKING GOD" "/home/joshua/pictures/org-icons/god.png" nil nil nil nil) ("BILLS" "/home/joshua/pictures/org-icons/bills.png" nil nil nil nil) ("emacs" "/home/joshua/pictures/org-icons/emacs.png" nil nil nil nil) ("WORK" "/home/joshua/pictures/org-icons/work.png" nil nil nil nil) )) #+END_SRC

Org-agenda-files are a list of files where you store your TODOs. These are your things that need to be done, scheduled items, deadlines, recurring items, etc. Then pressing "C-c a a" lets you build your agenda from all of your agenda files. It is very useful. But it would be a pain to have to manually enter all of your agenda files. So I've got some code here that I found online that lets me generate my agenda files.

Since, I've got all of my agenda files auto generated (somewhat), I might as well use those files for org refile.


  (defun my-org-list-files (dirs ext)
    "Function to create list of org files in multiple subdirectories.
  This can be called to generate a list of files for
  org-agenda-files or org-refile-targets.

  DIRS is a list of directories.

  EXT is a list of the extensions of files to be included."
    (let ((dirs (if (listp dirs)
                    dirs
                  (list dirs)))
          (ext (if (listp ext)
                   ext
                 (list ext)))
          files)
      (mapc
       (lambda (x)
         (mapc
          (lambda (y)
            (setq files
                  (append files
                          (file-expand-wildcards
                           (concat (file-name-as-directory x) "*" y)))))
          ext))
       dirs)
      (mapc
       (lambda (x)
         (when (or (string-match "/.#" x)
                   (string-match "#$" x))
           (setq files (delete x files))))
       files)
      files))

  (defvar my-org-agenda-directories '("~/prog/org/"
                                      "~/prog/org/projects/"
                                      "~/prog/org/projects/norm/norm-businesses/"
                                      "~/prog/org/projects/norm/norm-businesses/myift/"
                                      "~/prog/org/projects/norm/norm-businesses/innerjoyfitness/"
                                      )
    "List of directories containing org files.")
  (defvar my-org-agenda-extensions '(".org")
    "List of extensions of agenda files")

  (defun my-org-set-agenda-files ()
    (interactive)
    (setq org-agenda-files (my-org-list-files
                            my-org-agenda-directories
                            my-org-agenda-extensions)
          ))

  (my-org-set-agenda-files)

Disabling C-c [ and C-c ] commands.

Since I am generating my agenda files, there is no need to use the commands "C-c [" or "C-c ]". Also using those commands will cause org refile to only work for a few files. That is not desireable.


  (defun my/disable-org-add-files-to-agenda-commands ()
    (define-key org-mode-map (kbd "C-c [") nil)
    (define-key org-mode-map (kbd "C-c ]") nil))

  (add-hook 'org-mode-hook 'my/disable-org-add-files-to-agenda-commands)

customizing stuck projects

C-c a # will list all of your stuck projects. According to David Allen's Getting Things Done productivity system, a stuck project 2 is one where the next action is not defined. That is, your project does not have any next actions. No one knows what the next step to do is for the project.

I identify projects if they have a TODO keyword of "PROJECT". If the sub-tree does not have a TODO item, then it is a stuck project.


(setq org-stuck-projects '("+TODO=\"PROJECT\"" ("TODO") ("@SHOP") "\\<IGNORE\\>" ))

Here is an example of a stuck project. There is no TODO item in it at all.


  ,* PROJECT Gain 50 lbs by the summer
  :PROPERTIES:
  :CATEGORY: Gain 50 lbs by the summer
  :END:
  ,** I should get started on this soon.
  ,** Maybe tomorrow

It is also helpful to associate the project title as the project category. This lets me see the category in the agenda view. You can set a headline's category with the command org-set-property.

My agenda setqs

Make the agenda start on today not Wednesday.


  (setq org-agenda-start-on-weekday nil)

Don't make the agenda only show saturday and Sunday if today is saturday. Make it show 7 days.


  (setq org-agenda-span 'week)

Using the diary slows down the agenda view, but it also shows you upcoming calendar events.

Right now using the diary is hiding all of my agena stuff, so I'm disabling the diary view.


;;  (setq org-agenda-include-diary t)

This tells the agenda to take up the whole window and hide all other buffers. #+BEGIN_SRC emacs-lisp (setq org-agenda-window-setup 'current-window) #+END_SRC

A visual hint to let you know what line you are in in org-mode agenda. #+BEGIN_SRC emacs-lisp (add-hook 'org-agenda-finalize-hook '(lambda () (hl-line-mode))) #+END_SRC

Agenda icons via Category

You can easily create custom icons to show up in your agenda next to your specific tasks. My icons are all about 30 by 30 px.


  (setq org-agenda-category-icon-alist
        '(
          ("hacker"      "/home/joshua/prog/org/images/linux.png" nil nil nil nil)
          ("MAKING CASH\\|sell\\|[Bb]usiness"   "/home/joshua/prog/org/images/money.png" nil nil nil nil)
          ("SEEKING GOD" "/home/joshua/prog/org/images/jesus.png" nil nil nil nil)
          ("BILLS"    "/home/joshua/prog/org/images/bills.png" nil nil nil nil)
          ("emacs"       "/home/joshua/prog/org/images/emacs.png" nil nil nil nil)
          ("guix"       "/home/joshua/prog/org/images/guix.png" nil nil nil nil)
          ("WORK\\|job"       "/home/joshua/prog/org/images/work.png" nil nil nil nil)
          ))

My custom agenda commands

Any commands that I make here are accessable with C-c a

#+BEGIN_SRC emacs-lisp (setq org-agenda-custom-commands '( ;; a global search for agenda entries planned this week/day ("x" agenda)

;; a global search for agenda entries planned this week/day, but ;;only those with hour specifications ("y" agenda*)

("w" "Search for WAITING tasks" todo "WAITING")

("d" "Search for DELEGATED tasks" todo "DELEGATED")

("p" . "Project Searches") ("pp" "Search for PROJECTS or TODO tasks" tags-todo "TODO=\"PROJECT\"|TODO=\"TODO\"-@not_urgent-@not_important-SCHEDULED=\"=<+5d>\"") ("p5" "Search for tasks that'll take less than 5 minutes" tags-todo "TODO=\"TODO\"+EFFORT<\"0:06\"") ("pb" "Search for urgent and important TODO tasks" tags-todo "TODO=\"TODO\"+urgent+important") ("pu" "Search for urgent TODO tasks" tags-todo "TODO=\"TODO\"+urgent") ("pi" "Search for important TODO tasks" tags-todo "TODO=\"TODO\"+important") ("pn" "Search for not_important TODO tasks" tags-todo "TODO=\"TODO\"+not_important") ("po" "Search for not_urgent TODO tasks" tags-todo "TODO=\"TODO\"+not_urgent") ("ps" "Search for headlines with tag someday" tags "someday") ("p*" "Search for headlines with tags someday, important, and urgent" tags "someday+important")

COMMENT grading myself file.

("c" todo "CHARGED") )) #+END_SRC I have a file that keeps tracks of the things that I want to do often. This opens that. #+BEGIN_SRC emacs-lisp (defun my/org-grading-myself-agenda () "This function loads up my grading myself toolset." (interactive) (let (org-agenda-files) (setq org-agenda-files '("/home/joshua/programming/org/projects/grading-myself.org")) (org-agenda-list)))

(org-defkey org-agenda-mode-map "g" 'org-agenda-filter-by-category) ;;(org-defkey global-map (kbd "C-c a g") 'org-agenda-filter-by-category) #+END_SRC

#+BEGIN_SRC emacs-lisp (defun my/org-grading-myself-agenda-and-regular-agenda () "This function loads up my grading myself toolset." (interactive) (add-to-list 'org-agenda-files '"/home/joshua/programming/org/projects/grading-myself.org") (org-agenda-list) ;;how do you remove an element from a list? I have no idea. ) #+END_SRC

creating custom agenda views

info:org#Special agenda views

org refile

Org refile is awesome! It lets you refile headlines from one org file to another. It makes it really easy to reorganize! You definitely want to set it up to use helm-mode as well!

Make org-refile generate all possible paths when choosing where to refile to, rather than only the top level.


  (setq org-refile-targets '((nil :maxlevel . 2)
                             (org-agenda-files :tag . "capture")
                             (org-agenda-files :maxlevel . 5)))
  (setq org-outline-path-complete-in-steps nil)         ; Refile in a single go
  (setq org-refile-use-outline-path t)                  ; Show full paths for refiling

Targets start with the file name. This allows creating level 1 tasks via refile.


  (setq org-refile-use-outline-path (quote file))

Please note that org refile will only work so long as I am generating my agenda files. If I start to use the commands "C-c [" or "C-c ]" to determine my agenda files, then org-refile will fail to work. You may read more about those commands in the info manual. info:org#Agenda files

:SomeRefileCodeThatDoesNotWork: (setq org-refile-targets (cons '("~/prog/org/gtd.org" "~/prog/org/important-dates.org" "~/prog/org/managing-my-monies.org" "~/prog/org/quotes.org" "~/prog/org/relaxing.org" "~/prog/org/someday.org" "~/prog/org/vegan.org" "~/prog/org/web.org" "~/prog/org/projects/Remaining-Issues.org" "~/prog/org/projects/become-an-awesome-hacker.org" "~/prog/org/projects/being-social.org" "~/prog/org/projects/dating-sydney.org" "~/prog/org/projects/generate-income.org" "~/prog/org/projects/getting-a-gal.org" "~/prog/org/projects/girlfriend.org" "~/prog/org/projects/grading-myself.org" "~/prog/org/projects/headturningmarketing.org" "~/prog/org/projects/high-star.org" "~/prog/org/projects/how-to-write-unmaintainable-code.org" "~/prog/org/projects/letters-I-want-to-send.org" "~/prog/org/projects/linode-debian-server.org" "~/prog/org/projects/managing-my-monies.org" "~/prog/org/projects/math.org" "~/prog/org/projects/november.org" "~/prog/org/projects/ob-php.org" "~/prog/org/projects/part-time-job.org" "~/prog/org/projects/proprietary-information.org" "~/prog/org/projects/quit-porn.org" "~/prog/org/projects/recipes.org" "~/prog/org/projects/test.org" "~/prog/org/projects/vim-golf.org" "~/prog/org/projects/volunteering.org" "~/prog/org/projects/what-I-learned-talking-to-a-therapist.org" "~/prog/org/projects/whatever-I-want.org" "~/prog/org/projects/who-killed-roger-rabit.org" "~/prog/org/projects/working-for-waypoint.org") '()))

(setq org-refile-targets (cons (cons "~/prog/org/gtd.org" '()) '()))

(listp (cons (cons "~/prog/org/gtd.org" '()) '())) (setq org-refile-targets (cons org-agenda-files '()))

(setq org-refile-targets (cons (my-org-list-files my-org-agenda-directories my-org-agenda-extensions) '()))

(setq org-refile-targets "~/prog/org/gtd.org")

(setq org-refile-targets (list (cons (list "~/prog/org/gtd.org" "~/prog/org/projects/being-social.org") '())))

(setq org-refile-targets (list (cons '(my-org-list-files my-org-agenda-directories my-org-agenda-extensions) '())))

:END:

My TODO keywords

I can make add words to the TODO and DONE keywords. I want to make specific TODO states. Anything after the "|" is marked completed and appears green. Anything before it, shows that the item is still actionable and it is red.

I should also point out, that most people will probably want TODO to be the first keyword. Suppose that you have a recurring task like the following:


  ,* TODO Brush my teeth
    SCHEDULED: <2015-11-15 Sun +1d>
    :LOGBOOK:
    - State "TODO"       from              [2015-11-15 Sun 09:24]
    :END:

Whenever you complete this task, and do a C-c C-t (org-todo), org will put a short message inside a drawer under the item. Then, since this item is not properly DONE (since it still repeats), org-mode will try to find the proper TODO state to put in. By default, org-mode uses the first keyword specified by org-todo-keywords. So most users will probably want to make TODO the first keyword.

Also the TODO(t!), means that "t" will be used as the quick key for this TODO entry in the todo pop up dialog. The "!" means to only record the time of the state change. You can also use a "@" instead of "!" to specify that you would like to enter a note when you change the item's state. So "DONE(d@)" means that you want to use d as the shortcut key, and you'd org-mode to prompt you for a not when you do so.

You can also have syntax like "PROJECT(p@/!)", which means to record a note when you change an items TODO keyword to project, and you'd like to only record a timestamp if that item's keyword ever changes to any other todo keyword.

Apparently I can define a NEXTACTION keyword too. http://thread.gmane.org/gmane.emacs.orgmode/523 I've decided that TODO works just fine for this.

Please note, that I also have a keyword "DELEGATED" and "WAITING". These are tasks that I've decided others need to complete or I need to wait on others to complete. This will be useful, so that I can pass on work to other people, but then check in later on their progress. In order to use the DELEGATED or WAITING properly, schedule when you should check up on the person's work, and put the person's name in the headline. The drawer below shows some examples.

:DelegatedExample:


  ,* DELEGATED to Norbert call Flora to sell a real-estate loan
  SCHEDULED: <2020-03-23 Mon>
  ,* WAITING to Cliff to call Sarah, so I can call Sarah to give her the job
  SCHEDULED: <2020-03-23 Mon>

:END:

Set my todo keywords.


  (setq org-todo-keywords
        '((sequence "TODO(t!)" "PROJECT(r)" "STARTED(s!)"
                    "WAITING(w!)" "DELEGATED(e!)" "CHARGED(c!)"
                    "|" "PAID(p!)" "DONE(d!)")))


  (setq org-todo-keyword-faces
        '(("PROJECT" . "#4da6ff")
          ("STARTED" . "#ffff99")
          ("WAITING" . "#ffcc00")
          ("CHARGED" .  "#e085e0")))


When I enter in a DELEGATED or WAITING state, schedule a check up.

When you entered in a DELEGATED or WAITING state, the task should have a SCHEDULED line on it.

info:elisp#Regexp Search

https://emacs.stackexchange.com/questions/9433/how-to-make-org-prompt-for-a-timestamp-when-changing-state-of-a-todo/9451#9451


  (with-eval-after-load 'org
    (defun my/org-todo-add-scheduled-check ()
      "This function checks that after you call org-todo, if you
      chose WAITING or DELEGATED it prompts for to schedule when you
      will follow up."
      (interactive "P")
      (when (or (string= org-state "DELEGATED")
                (string= org-state "WAITING"))
        (progn
          (org-schedule nil (org-read-date))
          ;; set the property to follow_up...in the agenda buffer, it'll
          ;; remind me why this is scheduled.  It is scheduled for me to
          ;; follow up.
          (org-set-property "CATEGORY" "follow_up"))))

    (add-hook 'org-after-todo-state-change-hook 'my/org-todo-add-scheduled-check))

Org Clock Settings

This puts up in my top of my buffer the current running org clock.

#+BEGIN_SRC emacs-lisp

;; Save the running clock and all clock history when exiting Emacs, load it on startup (setq org-clock-persistence-insinuate t) (setq org-clock-persist t) (setq org-clock-in-resume t)

;; Change task state to STARTED when clocking in (setq org-clock-in-switch-to-state "STARTED") ;; Save clock data and notes in the LOGBOOK drawer (setq org-clock-into-drawer t) ;; Removes clocked tasks with 0:00 duration (setq org-clock-out-remove-zero-time-clocks t)

;; Show clock sums as hours and minutes, not "n days" etc. (setq org-time-clocksum-format '(:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t))

;; Show the clocked-in task - if any - in the header line (defun sanityinc/show-org-clock-in-header-line () (setq-default header-line-format '((" " org-mode-line-string " "))))

(defun sanityinc/hide-org-clock-from-header-line () (setq-default header-line-format nil))

(add-hook 'org-clock-in-hook #'sanityinc/show-org-clock-in-header-line) (add-hook 'org-clock-out-hook #'sanityinc/hide-org-clock-from-header-line) (add-hook 'org-clock-cancel-hook #'sanityinc/hide-org-clock-from-header-line)

(with-eval-after-load 'org-clock (define-key org-clock-mode-line-map [header-line mouse-2] #'org-clock-goto) (define-key org-clock-mode-line-map [header-line mouse-1] #'org-clock-menu))

;;you can start clocking in on an event in the agenda buffer by pressing P ;;(use-package org-pomodoro ;; ) ;;(after-load 'org-agenda ;; (define-key org-agenda-mode-map (kbd "P") 'org-pomodoro)) #+END_SRC

#+RESULTS:

org-pomodoro

Setting default effort values

I can specify the amount of effort a task may take me to do with the property EFFORT. I can then sort through things and attempt to find the easy and more difficult ones. The org-set-property commands will let you easily set the effort estimate. Then inside the agenda view or inside an org file, you can see the effort estimates via org column view C-c C-x C-c.


  (setq org-global-properties (list
                               '("Effort_ALL" . "0:05 0:15 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00 9:00 10:00")))

default column view format

Column view is an interesting view of Org-mode that lets you see your effort estimates of various tasks. This may help you determine which tasks you would like to attempt, based on the amount of effort (time) you think it would take you to complete the task. The following sets up the default column view format. The format below shows you the TODO keyword, your effort estimate and the total time you have spent on each item. This will help you better predict how long it may take you to complete a task.


  (setq org-columns-default-format
        "%TODO %40ITEM %17Effort(Estimated Effort){:} %17CLOCKSUM(Expended Effort) %TAGS %PRIORITY")

creating a website via org publishing

This is soo interesting! It is possible to create a website via org mode! You can format your various pages in Org-mode, and then org-mode will do the conversion to HTML. There are still some things that make it look a bit odd, but give it a test run here!


(setq org-html-doctype "html5")

  (setq org-publish-project-alist
        '(("org-files"
           :base-directory "~/prog/elisp/org-website/"
           :publishing-directory "~/prog/elisp/org-website/publish-dir/"
           :publishing-function org-html-publish-to-html
           :with-toc nil
           :section-numbers nil
           :html-head "<link rel=\"stylesheet\" href=\"./css/style.css\" type=\"text/css\"/>"
           :recursive t ;; check all directories for org-files to publish
           ;; this is necessary because all my "posts" will be in the posts directory
           ;; completion-function function to call to perhaps change the published files permissions...
           )
          ("css"
           :base-directory "~/prog/elisp/org-website/css/"
           :base-extension "css"
           :publishing-directory "~/prog/elisp/org-website/publish-dir/css/"
           :publishing-function org-publish-attachment)
          ("images"
           :base-directory "~/prog/elisp/org-website/img/"
           :base-extension "jpg\\|gif\\|png\\|jpeg"
           :publishing-directory "~/prog/elisp/org-website/publish-dir/img/"
           :publishing-function org-publish-attachment)
          ("portfolio-site" :components ("org-files"  "images" "css"))))

COMMENT misc

a hydra that I found online that lets you easily remember some of the org commands

this is not working? we want to remember the org keyboard navigation commands eh? https://github.com/abo-abo/hydra/wiki/Emacs #+BEGIN_SRC emacs-lisp :tangle no

(defhydra hydra-outline (:color pink :hint nil) " ^Hide^ ^Show^ ^Move ^^^^^^------------------------------------------------------ _hs_: sublevels _sa_: all _u_: up _hb_: body _se_: entry _n_: next visible _ho_: other _sc_: children _p_: previous visible _he_: entry _sb_: branches _f_: forward same level _hl_: leaves _st_: subtree _b_: backward same level _ht_: subtree

" ;; Hide ("hs" hide-sublevels) ; Hide everything but the top-level headings ("hb" hide-body) ; Hide everything but headings (all body lines) ("ho" hide-other) ; Hide other branches ("he" hide-entry) ; Hide this entry's body ("hl" hide-leaves) ; Hide body lines in this entry and sub-entries ("ht" hide-subtree) ; Hide everything in this entry and sub-entries ;; Show ("sa" show-all) ; Show (expand) everything ("se" show-entry) ; Show this heading's body ("sc" show-children) ; Show this heading's immediate child sub-headings ("sb" show-branches) ; Show all sub-headings under this heading ("st" show-subtree) ; Show (expand) everything in this heading & below ;; Move ("u" outline-up-heading) ; Up ("n" outline-next-visible-heading) ; Next ("p" outline-previous-visible-heading) ; Previous ("f" outline-forward-same-level) ; Forward - same level ("b" outline-backward-same-level) ; Backward - same level

("z" nil "leave"))

(define-key org-mode-map (kbd "C-c #") 'hydra-outline/body) ; by example (global-set-key (kbd "C-c #") 'hydra-outline/body) #+END_SRC

A definition I found online org-begin-template

I should really check this out at some point http://pragmaticemacs.com/emacs/wrap-text-in-an-org-mode-block/ In my most recent post on org-mode, I talked about using blocks to mark text as being latex, or source code and so on. I mentioned using the shortcuts like

This has been in my config file for ages and I can’t remember where it came from – I know I didn’t write it! A bit of googleing suggests this could be the origin, but if anyone knows different, let me know.

I bind the function to C-< because it reminds me of the < shortcuts to create the blocks, and I don’t use the org-cycle-agenda-files that is usually bound to that key combo.

#+BEGIN_SRC emacs-lisp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; function to wrap blocks of text in org templates ;; ;; e.g. latex or src etc ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun org-begin-template () "Make a template at point." (interactive) (if (org-at-table-p) (call-interactively 'org-table-rotate-recalc-marks) (let* ((choices '(("s" . "SRC") ("e" . "EXAMPLE") ("q" . "QUOTE") ("v" . "VERSE") ("c" . "CENTER") ("l" . "LaTeX") ("h" . "HTML") ("a" . "ASCII"))) (key (key-description (vector (read-key (concat (propertize "Template type: " 'face 'minibuffer-prompt) (mapconcat (lambda (choice) (concat (propertize (car choice) 'face 'font-lock-type-face) ": " (cdr choice))) choices ", "))))))) (let ((result (assoc key choices))) (when result (let ((choice (cdr result))) (cond ((region-active-p) (let ((start (region-beginning)) (end (region-end))) (goto-char end) (insert "#+END_" choice "\n") (goto-char start) (insert "#+BEGIN_" choice "\n"))) (t (insert "#+BEGIN_" choice "\n") (save-excursion (insert "#+END_" choice))))))))))

;;bind to key ;;(define-key org-mode-map (kbd "C-<") 'org-begin-template)


COMMENT trying to get mmm-mode to work


  (use-package mmm-mode )

  (with-eval-after-load 'org
    (require 'mmm-mode)
    (setq mmm-global-mode 'maybe)
    (mmm-add-mode-ext-class 'org-mode "\\.org\\'" 'org-elisp)

    ;; mmm-add-group is more useful for org-mode...probably
    (mmm-add-classes
     '(
       (org-elisp
        :submode 'emacs-lisp-mode
        :face mmm-declaration-submode-face
        :front "#+BEGIN_SRC emacs-lisp"
        :back  "#+END_SRC"
        )
       )
     ))

to load this file do M-x org-babel-load-file and it'll pop up helm and you'll have to say that you want

provide this file

Footnotes

to load this file. All the scripts in this file will be exported and saved into init-org.el. Then that file will be loaded. #+BEGIN_SRC emacs-lisp (provide 'init-org) #+END_SRC

img
button
img
button
img
button

  1. I do use org-crypt in my erc-file to save some sensitive information.
  2. A project is an action that has multiple sequential steps.