(setenv "GPG_AGENT_INFO" nil) (setq epg-gpg-program "/usr/local/bin/gpg2") (require 'epa-file) (require 'password-cache) (setq password-cache-expiry (* 15 60)) (setq epa-file-cache-passphrase-for-symmetric-encryption t)

First of all, I load GPG for encryption/decryption of gpg files. I set a generous expiration because this is my work desktop and I always keep it locked.

(require 'org-install) (package-initialize) (global-set-key "\C-cl" 'org-store-link) (global-set-key "\C-cc" 'org-capture) (global-set-key "\C-ca" 'org-agenda) (global-set-key "\C-cr" 'org-gcal-sync)

I load org-mode and set the shortcuts to store links (it’s easier this way for me ?), capture (for agenda, work TODO, etc) and pull up the agenda.

(setq org-directory "~/Documents/org/") (setq org-default-notes-file "~/Documents/org/scrapbook.gpg") (setq org-agenda-files (list "~/Documents/org/todo.gpg" "~/Documents/org/work_cal.org" "~/Documents/org/personal_cal.org"))

Here I’m setting the directory structure. org-directory sets the default org-mode directory for file storage. Notes are created with org-default-notes-file , and org-agenda-files lists all the files loaded by default in the Agenda.

(add-hook 'org-mode-hook #'(lambda () (visual-line-mode) (org-indent-mode))) (add-hook 'org-mode-hook #'toggle-word-wrap) (defun my/org-mode-hook () "My `org-mode' hook" (set-face-attribute 'org-document-info-keyword nil :foreground "yellow") (set-face-attribute 'org-document-info nil :foreground "cornflower blue") (set-face-attribute 'org-document-title nil :foreground "cornflower blue")) (add-hook 'org-mode-hook 'my/org-mode-hook)

Some color tweaks and line-wrapping. org-mode doesn’t wrap lines by default, but that has an easy fix.

(setq org-todo-keywords '((sequence "TODO(t)" "PENDING(p!)" "WAIT(w@)" "VERIFY(v)" "|" "DONE(d!)" "CANCELED(c@)") (sequence "REPORT(r@)" "BUG(b@)" "KNOWNCAUSE(k@)" "|" "FIXED(f!)"))) (global-set-key (kbd "C-c s") (lambda () (interactive) (find-file "~/Documents/org/scrapbook.gpg"))) (global-set-key (kbd "C-c w") (lambda () (interactive) (find-file "~/Documents/org/todo.gpg"))) (setq org-log-done 'time) (setq org-list-allow-alphabetical t)

Define files for notes and for the to-do list. Here we also define the to-do sequences and indicate whether I want them timestamped (!) or timestamped and with a comment (@).

(setq org-capture-templates '(("n" "Personal Note" entry (file "~/Documents/org/scrapbook.gpg") "* PERSONAL NOTE %?

%U

" :empty-lines 1) ("w" "Work Note" entry (file "~/Documents/org/scrapbook.gpg") "* WORK NOTE %?

%U

" :empty-lines 1) ("j" "Journal" entry (file+datetree "~/Documents/org/journal.gpg") "**** %U%?

%a" :tree-type week)) )

Define the capture modes. I only have personal and work notes and journal capture.

(eval-after-load "org" '(require 'ox-md nil t))

Markdown export. We use markdown at work a lot. It makes my life easier if I have direct conversion to markdown.

(setq org-agenda-span 4)

org-agenda will only load the next 4 days. I don’t need any more than that.

(require 'org2blog-autoloads) (require 'netrc) (require 'auth-source) (let (credentials) (add-to-list 'auth-sources "~/.authinfo") (setq credentials (auth-source-user-and-password "arenzana.org")) (setq org2blog/wp-blog-alist `(("arenzanaorg" :url "https://arenzana.org/xmlrpc.php" :username ,(car credentials) :password ,(cadr credentials) :default-title "Hello World" :default-categories ("emacs") :tags-as-categories nil)))) (setq org2blog/wp-use-sourcecode-shortcode nil) ;; removed light="true" (setq org2blog/wp-sourcecode-default-params nil) ;; target language needs to be in here (setq org2blog/wp-sourcecode-langs '("actionscript3" "bash" "coldfusion" "cpp" "csharp" "css" "delphi" "erlang" "fsharp" "diff" "groovy" "javascript" "java" "javafx" "matlab" "objc" "perl" "php" "text" "powershell" "python" "ruby" "scala" "sql" "vb" "xml" "go" "sh" "emacs-lisp" "lisp" "lua")) ;; this will use emacs syntax higlighting in your #+BEGIN_SRC ;; <language> <your-code> #+END_SRC code blocks. (setq org-src-fontify-natively t)

For org-2blog We begin by loading it and .netrc . In my case, I’m using .authinfo that I keep encrypted as well. It stores my blog credentials. Since I only have one blog, I just add it as arenzanaorg to the wordpress blog list, set some defaults, and then set some source code defaults. I got most of this configuration from here. Great resource!

(require 'org-gcal) (load-library "~/.gcal.el.gpg") (setq org-gcal-file-alist '(("iarenzana@gmail.com" . "~/Documents/org/personal_cal.org") ("iarenzana@indigital.net" . "~/Documents/org/work_cal.org")))

org-gcal is the package I use to pull Google Calendar data into Emacs and, ultimately, org-agenda . Earlier in the set up I created a shortcut for org-gcal-sync to update the calendars on demand. After that, I just press r in org-agenda to refresh the buffer and the new events show up . In order to not publish API keys to any repository, I keep this information in a .gcal.el.gpg file stored in my home directory. This is what the structure of that file looks like:

;; -*- epa-file-encrypt-to: ("user@example.com") -*- (setq org-gcal-client-id "clientid" org-gcal-client-secret "secretkey")