ambevar-dotfiles/.emacs.d/lisp/init-org.el

70 lines
2.4 KiB
EmacsLisp
Raw Normal View History

;;; Org mode
2014-09-22 17:03:29 +02:00
;;; TODO: org-import should be able to parse "|" in CSV files.
(define-key org-mode-map (kbd "C-c C-a") 'org-agenda)
(setq
;; Disable line splitting on M-RET.
org-M-RET-may-split-line '((default))
org-insert-heading-respect-content t
org-enforce-todo-dependencies t
org-deadline-warning-days 7
org-agenda-default-appointment-duration 60
org-agenda-columns-add-appointments-to-effort-sum t
2017-07-28 18:20:14 +02:00
org-ellipsis " […]"
2017-10-08 20:21:11 +02:00
org-adapt-indentation nil
2017-10-17 19:20:40 +02:00
;; Add keywords.
org-todo-keywords '((sequence "TODO" "REVIEW" "DONE"))
2017-10-24 18:10:14 +02:00
;; org-todo-keyword-faces '(("REVIEW" :inherit org-done))
2017-10-17 19:20:40 +02:00
;; Priorities.
org-priority-start-cycle-with-default nil
2018-02-15 19:32:32 +01:00
org-default-priority 67
;; Org-mode aligns text.
2017-06-22 19:02:12 +02:00
indent-tabs-mode nil)
2014-09-22 17:03:29 +02:00
;;; Agendas.
2018-07-12 12:01:50 +02:00
(add-to-list 'org-agenda-files "~/personal/todo/todo.org.gpg")
2019-03-03 12:26:57 +01:00
(load "~/personal/todo/agenda-list.el" 'noerror)
2019-03-03 12:26:57 +01:00
(when (require 'patch-helm nil 'noerror)
(helm-defswitcher
"Org"
2019-03-03 12:26:57 +01:00
(lambda (b)
(when (buffer-file-name b)
(member (file-truename (buffer-file-name b)) (mapcar #'file-truename org-agenda-files))))
2019-03-08 09:48:13 +01:00
(lambda () (find-file (car org-agenda-files)))
nil
(helm-make-source "Org agenda files" 'helm-source-ffiles
;; Unclear why, but if we don't copy the list, the last element gets removed.
:candidates (lambda () (copy-list org-agenda-files)))))
2017-07-02 20:07:19 +02:00
;;; Set PDF association in Org-mode (original is 'default).
(setcdr (assoc "\\.pdf\\'" org-file-apps) 'emacs)
;;; Hooks.
2019-03-03 12:55:44 +01:00
(dolist (fun '(;; turn-off-auto-fill
2018-10-17 14:09:32 +02:00
ambrevar/turn-off-indent-tabs))
(add-hook 'org-mode-hook fun))
2017-07-26 12:11:58 +02:00
(when (require 'org-contacts nil t)
2018-07-12 12:01:50 +02:00
(let ((contacts "~/personal/contacts/contacts.org.gpg"))
(when (file-exists-p contacts)
;; When used to auto-complete e-mail addresses, the file is automatically
;; loaded. The buffer usually need not be restored by a desktop session.
(when (and desktop-save-mode
(string-match "\\\\|" desktop-files-not-to-save))
(setq desktop-files-not-to-save
(concat (substring desktop-files-not-to-save 0 -2) "\\|" (regexp-quote (expand-file-name contacts)) "\\)")))
(setq org-contacts-files (list contacts)))))
2017-07-26 12:11:58 +02:00
2017-12-13 18:17:17 +01:00
(when (require 'org-bullets nil t)
(add-hook 'org-mode-hook 'org-bullets-mode))
(add-to-list
'org-capture-templates
`("w" "Web link" entry (file+headline ,(car org-agenda-files) "Links")
"* %?%a\n:SCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+1d\"))\n"))
(provide 'init-org)