Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
1234 lines (1030 sloc) 52.1 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.

My org use-package declaration

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.
(defun my-just-one-space ()
  (interactive)
  (if (org-at-table-p)
      (org-table-blank-field)
    (just-one-space)))

(use-package org :bind (:map org-mode-map ("C-c SPC" . my-just-one-space))
  :ensure org-plus-contrib)
  

Setting up Org-plugins

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
* 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-----
  

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

(use-package org-crypt
  :config
  (org-crypt-use-before-save-magic)
  (setq org-tags-exclude-from-inheritance (quote ("crypt"))))

I personally don’t use org-crypt too much anymore. [fn:2] 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.

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.

(setq org-crypt-key "C8FA3D82C7B1326F")

org mime

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

(use-package org-mime :ensure t)
  

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!

;; 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"))))
  

the following can be used to nicely offset block quotes in email bodies

;; 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 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 :ensure 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)))

(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)
     (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)

New versions of org have removed org-babel get header. Some plugins still use it. So I’m defining it until they catch up.

(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)))

org invoice

(use-package 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

* 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:
  

org-inlinetask

Org inline task lets you define an inline task without treating it like a headline
(use-package org-inlinetask)
  

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

- [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
  

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

      - [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


      - [ ] call your momma
        Let her know she's a good Mom
  

org-habit

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.
(use-package org-habit)
  
(add-hook 'org-mode-hook '(lambda ()
                            (require 'org-protocol)))

org gnu-plot

(use-package gnuplot :ensure t)

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

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

SedeMax citesH-index
Chile257.7221.39
Leeds165.7719.68
Sao Paolo71.0011.50
Stockholm134.1914.33
Morelia257.5617.67

My Org-mode-hook

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)))
;; I want to get write-good-mode set up again, because it's awesome.
(use-package writegood-mode :ensure t :defer t)

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

                                ;; https://bitbucket.org/ukaszg/org-eldoc org eldoc looks cool
                                ;; but I can't get it to work
                                ;; (require 'org-eldoc)
                                ;;(org-eldoc-load)
                                ;; (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)
                                ;; make the lines in the buffer wrap around the edges of the screen.
                                ;; YES!!!!! These next two modes auto-indents org-buffers as you type!  NO NEED FOR
                                ;; to press C-c q  or fill-paragraph ever again!
                                (visual-line-mode)
                                (org-indent-mode)
                                (require 'writegood-mode)
                                ;; 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)
                                (org-bullets-mode 1)
                                ;;make ">=" look like >=, etc.
                                (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)))

My org-mode preferences

A big setq

Make calendar highlight upcoming items

(setq org-hide-leading-stars t)

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 "")

Make RET follow a link

(setq org-return-follows-link t)
(setq
 ;; hide the leading stars in my org files
 org-hide-leading-stars t
 ;;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 "⤵"
 org-ellipsis ""
 ;; make org show inline images by default
 ;; This can be overridden by #+STARTUP: noinlineimages
 org-startup-with-inline-images t
 ;; make RET follow a link
 org-return-follows-link t
 ;; 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
 ;; don't let me accidentally delete text without realizing it in org.  ie: point is buried in a subtree, but you only
 ;; see the heading and you accidentally kill a line without knowing it.
 ;; this might not be supported for evil-mode
 org-catch-invisible-edits 'show-and-error
 ;; whenever I change state from TODO to DONE org will log that timestamp. Let's put that in a drawer
 org-log-into-drawer t
 ;; make org-mode record the date when you finish a task
 org-log-done 'time
 ;;org-log-done 'nil
 ;; when you press S-down, org changes the timestamp under point
 org-edit-timestamp-down-means-later t
 ;; make the agenda start on today not wednesday
 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
 org-agenda-span 7
 ;; using the diary slows down the agenda view
 ;; but it also shows you upcoming calendar events
 org-agenda-include-diary t
 ;; this tells the agenda to take up the whole window and hide all other buffers
 org-agenda-window-setup 'current-window
 ;; 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
 ;; are there more backends that I can use?
 org-export-backends '(ascii beamer html texinfo latex)
 ;;most of these modules let you store links to various stuff in org
 org-bullets-bullet-list
 '("" "" "" "" "" "")
 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
 ;; where to put the :action: or :work: tag after a heading.  80 colums over
 org-tags-column 80
 ;; don't ask me if I want to run an babel code block.  I know what I'm doing
 org-confirm-babel-evaluate nil
 ;; activate org speed commands
 org-use-speed-commands t)

;;a visual hint to let you know what line you are in in org-mode agenda
(add-hook 'org-agenda-finalize-hook '(lambda () (hl-line-mode)))

what files org-mode opens

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

my org capure templates

This is SOOOO USEFUL!!!! Org capture lets you quickly jot down a thought that you have and place it in a file under a heading that you specify. I have captchas for shopping, for books to read, for things to do.
(setq org-capture-templates
      '(

        ("B" "Things I want to buy" entry (file+headline
                                           "~/programming/org/projects/managing-my-monies.org" "things I want to buy")
         "* %?\nEntered on %U\n  %i\n  %a")

        ("c" "Computers Anything")
        ("ca" "Awesome WM" entry (file+headline "~/programming/org/gtd.org" "awesome WM someday")
         "* TODO %?\nEntered on %U\n  %i\n  %a")


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

        ("ceb" "bugs" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "Emacs bugs")
         "* TODO %?\n  %i\n  %a")

        ("ceb" "evil-mode" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "evil-mode")
         "* TODO %?\n  %i\n  %a")

        ("cef" "flycheck" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "flycheck-mode")
         "* TODO %?\n  %i\n  %a")

        ("ceM" "Emacs Meetup" entry (file+headline "~/programming/org/projects/emacs-meetup-vincent-laf-emacslaf.org" "things to talk about")
         "* %?\nEntered on %U\n  %i\n  %a")

        ("ceo" "Org-mode" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "org-mode")
         "* TODO %?\n  %i\n  %a")
         ("ceR" "Emacs Reference")
        ("ceRR" "Emacs Reference" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "emacs reference")
         "* %?\nEntered on %U\n  %i\n  %a")
         ("ceRe" "emacs evil reference" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "evil reference")
         "* TODO %?\n  %i\n  %a")
         ("ceRg" "emacs gnus reference" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "gnus reference")
         "* TODO %?\n  %i\n  %a")
        ("ceRo" "emacs org reference" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "org reference")
         "* TODO %?\n  %i\n  %a")
        ("ceRm" "emacs magit reference" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "tags reference")
         "* TODO %?\n  %i\n  %a")
        ("ceRt" "emacs tags reference" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "tags reference")
         "* TODO %?\n  %i\n  %a")

         ("cet" "emacs Todo")
        ("cett" "emacs Todo" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "emacs someday")
         "* TODO %?\n  %i\n  %a")
        ("cete" "emacs evil someday" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "evil someday")
         "* TODO %?\n  %i\n  %a")
        ("cetf" "emacs flycheck someday" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "flycheck someday")
         "* TODO %?\n  %i\n  %a")
        ("cetg" "emacs gnus someday" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "gnus someday")
         "* TODO %?\n  %i\n  %a")
        ("ceth" "emacs helm someday" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "helm someday")
         "* TODO %?\n  %i\n  %a")
        ("ceto" "emacs org someday" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "org someday")
         "* TODO %?\n  %i\n  %a")
        ("cetT" "emacs tags someday" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "tags someday")
         "* TODO %?\n  %i\n  %a")
        ("cetw" "web-mode someday" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "web-mode someday")
         "* TODO %?\n  %i\n  %a")
         ;;End Emacs things


        ("cG" "Gimp Basics Reference" entry (file+headline "~/manuals/gimp.org" "Basic Concepts")
         "* %?\nEntered on %U\n  %i\n  %a")
        ("cH" "The GNU HURD")
        ("cHt" "Hurd" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org"
                                           "Hurd")
         "* TODO %?\n  %i\n  %a")
        ("ct" "General Computer TODO"
         entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "General TODO")
         "* TODO %?\n  %i\n  %a")
        ("cw" "Waypoint")
        ("cwi" "ibca Web App")
        ("cwib" "bugs that need fixin'" entry (file+headline "~/programming/org/projects/working-for-waypoint.org"
                                                             "bugs that need fixin'")
         "* TODO %?\n  %i\n  %a")
        ("cwic" "core features that must be done" entry (file+headline "~/programming/org/projects/working-for-waypoint.org"
                                                                       "core features that must be done")
         "* TODO %?\n  %i\n  %a")
        ("cwif" "features the app should have" entry (file+headline "~/programming/org/projects/working-for-waypoint.org"
                                                                    "features the app should have") "* TODO %?\n  %i\n  %a")
        ("cwir" "IBCA Reference" entry (file+headline "~/programming/org/projects/working-for-waypoint.org"
                                                      "IBCA Reference") "* %?\nEntered on %U\n  %i\n  %a")
        ("cwiw" "what I have done" entry (file+headline "~/programming/org/projects/working-for-waypoint.org"
                                                        "what I have done") "* DONE %?\n  %i\n  %a")
        ("ch" "high star todo"
         entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "make high star an android app")
         "* todo %?\n  %i\n  %a")
        ("cl" "linux TODO" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "linux someday")
         "* TODO %?\n  %i\n  %a")
        ("cL" "Linux Reference" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "linux reference")
         "* %?\nEntered on %U\n  %i\n  %a")
        ("co" "organ TODO" entry (file+headline "~/programming/org/projects/become-an-awesome-hacker.org" "make organ an android app")
         "* TODO %?\n  %i\n  %a")
        ("cf" "Free the world" entry (file+headline "~/programming/org/gtd.org" "free the world free content")
         "* %?\nEntered on %U\n  %i\n  %a")

        ("cW" "Web")

        ("cWA" "Accrisoft Reference" entry (file+headline "~/programming/org/web.org" "Accrisoft reference")
         "* %?\nEntered on %U\n  %i\n  %a")

        ("cWB" "Bootstrap Reference" entry (file+headline "~/programming/org/web.org" "Bootstrap reference")
         "* %?\nEntered on %U\n  %i\n  %a")

        ("cWS" "Shoppify Reference" entry (file+headline "~/programming/org/web.org" "Shoppify reference")
         "* %?\nEntered on %U\n  %i\n  %a")

        ("cWW" "Web reference" entry (file+headline "~/programming/org/web.org" "Web reference")
         "* %?\nEntered on %U\n  %i\n  %a")


        ("C" "Community")
        ("Cc" "community TODO" entry (file+headline "~/programming/org/gtd.org" "community someday")
         "* TODO %?\n  %i\n  %a")

        ("Cn" "nice things to say" entry (file+headline "~/programming/org/projects/get-close-to-God.org" "nice things to say")
         "* TODO %?\nEntered on %U\n  %i\n  %a")
        ("Cs" "Social Skills Notes" entry (file+headline "~/programming/org/being-social.org" "Social Skills Notes")
         "* %?\nEntered on %U\n  %i\n  %a")

        ("C" "Calendar TODO" entry (file+headline "~/programming/org/gtd.org" "calendar")
         "* TODO %?\n  %i\n  %a")

        ("e" "entertainment")
        ("eb" "Books to Read" entry (file+headline "~/programming/org/projects/whatever-I-want.org"
                                                   "Books to Read") "*  %i\n  %a")
        ("eM" "Good Movies Reference" entry (file+headline "~/programming/org/projects/whatever-I-want.org" "Good Movies") "*  %i\n  %a")
        ("em" "movies to watch" entry (file+headline "~/programming/org/projects/whatever-I-want.org" "movies to watch") "*  %i\n  %a")
        ("eU" "good music reference" entry (file+headline "~/programming/org/projects/whatever-I-want.org"
                                                          "good music reference") "*  %i\n  %a")
        ("eg" "games to play" entry (file+headline "~/programming/org/projects/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/programming/org/projects/get-close-to-God.org"
                                                        "get a close friend") "* TODO %?\n  %i\n  %a")
        ("gb" "Boundaries")
        ("gbn" "Boundary Notes" entry (file+headline "~/programming/org/gtd.org" "Boundary Notes")
         "* %?\nEntered on %U\n  %i\n  %a")
        ("gbl" "Lowering My Expectations of Myself" entry (file+headline "~/programming/org/gtd.org"
                                                                         "Lowering My Expectations of Myself")
         "* %?\nEntered on %U\n  %i\n  %a")
        ("gbs" "Boundaries To Enforce" entry (file+headline "~/programming/org/projects/get-close-to-God.org" "Setting Boundaries")
         "* TODO %?\n  %i\n  %a")



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

        ("q" "Quotations" entry (file+headline "~/programming/org/quotes.org" "Quotations")
         "* %?\nEntered on %U\n  %i\n  %a")
        ))
  

I can make add words to the TODO and DONE keywords

; Targets start with the file name - allows creating level 1 tasks
  (setq org-refile-use-outline-path (quote file))
  
file
  

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

Set my todo keywords

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


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

Org Clock Settings

This puts up in my top of my buffer the current running org clock.
;; 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)

(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
;;  :ensure t)
;;(after-load 'org-agenda
;;  (define-key org-agenda-mode-map (kbd "P") 'org-pomodoro))
  

customizing stuck projects

There is apparently a way to specify in your org agenda files where you have a stuck project, but I haven’t figured out how to do it.

C-c a # will list all of your stuck projects. According to David Allen’s Getting Things Done productivity system, a stuck project [fn:1] 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.

Anyway, org-stuck-projects helps you to identify where your projects are. It is a list with 4 entries:

  • A tags/todo/propery that identifies this heading as a project
  • A list of todo keywords that show that this project is NOT stuck. If any of these todo keywords show up under the projects’ tree, then that project is not stuck
  • A list of tags identifying non-stuck projects
  • A regexp matching non-stuck projects
(setq org-stuck-projects '("PROJECT" ("TODO NEXT") ("action") "\\<IGNORE\\>" ))
  

trying to get mmm-mode to work

(use-package mmm-mode :ensure t)

(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"
      )
     )
   ))

provide this file

(provide 'init-org)
  

Footnotes

[fn:2] I do use org-crypt in my erc-file to save some sensitive information.

[fn:1] A project is an action that has multiple sequential steps.

img
button
img
button
img
button