From b0ea22bc9aeb7ce5fda6a9316f1081ba20c344fa Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 16 Jun 2017 08:46:03 -0700 Subject: [emacs] Add org-mode configuration once again. Only load some packages if we are using a recent version of Emacs. --- emacs.d/init.el | 7 +++++-- emacs.d/lib/org.el | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 emacs.d/lib/org.el diff --git a/emacs.d/init.el b/emacs.d/init.el index 440a879..aa020ac 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -8,7 +8,10 @@ (load (emacs-lib "settings.el")) (load (emacs-lib "funcs.el")) (load (emacs-lib "bindings.el")) -(load (emacs-lib "packages.el")) -(load (emacs-lib "twitter.el") 'missing-ok) + +(when (>= emacs-major-version 24) + (load (emacs-lib "packages.el")) + (load (emacs-lib "org.el")) + (load (emacs-lib "twitter.el") 'missing-ok)) (add-hook 'emacs-startup-hook #'fc/load-time) diff --git a/emacs.d/lib/org.el b/emacs.d/lib/org.el new file mode 100644 index 0000000..2c75e7d --- /dev/null +++ b/emacs.d/lib/org.el @@ -0,0 +1,48 @@ +(use-package org + :ensure t + :mode ("\\.org\\'" . org-mode) + :init + (org-babel-do-load-languages + 'org-babel-load-languages + (append org-babel-load-languages '((sh . t) + (python . t)))) + :config + (setq-default org-startup-indent t + org-startup-truncated t + org-src-tabs-acts-natively t + org-src-preserve-indentation t + org-todo-keyword-faces '(("TODO" . org-warning) + ("DOING" . "yellow") + ("BLOCKED" . "red") + ("REVIEW" . "orange") + ("DONE" . "green") + ("ARCHIVED" . "blue")) + org-todo-keywords + '((sequence "NEXT(n)" "PLANNING(P)" "INPROGRESS(i)" "WAITING(w)" "|" "DONE(d)") + (sequence "MEETING(m)" "|" "CANCELLED(c)") + (sequence "IDLE(a)")) + org-link-abbrev-alist + '(("src" . "~/src/%s") + ("jira" . "https://jira.twitter.biz/browse/%s") + ("rb" . "https://reviewboard.twitter.biz/r/%s") + ("d" . "https://phabricator.twitter.biz/d%s") + ("go" . "http://go/%s")))) + +(use-package org-agenda + :bind (("\C-cA" . org-agenda)) + :config + (progn + (setq-default org-agenda-files (file-expand-wildcards "~/Documents/org/*.org") + org-default-notes-file "~/Documents/org/refile.org" + org-directory "~/Documents/org/"))) + +(use-package org-capture + :bind (("\C-cc" . org-capture)) + :config + (progn + (setq-default org-refile-targets '(("twitter.org" :maxlevel . 4) + ("personal.org" :maxlevel . 4)) + org-capture-templates '(("t" "task" entry + (file "~/Documents/org/refile.org") + "* TODO %? +%U"))))) -- cgit 1.4.1