diff options
Diffstat (limited to 'lisp/acdw-org.el')
-rw-r--r-- | lisp/acdw-org.el | 69 |
1 files changed, 63 insertions, 6 deletions
diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 8a63d04..5255a50 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el | |||
@@ -222,6 +222,25 @@ If LIST is non-nil, return the result as a list instead of a string." | |||
222 | 222 | ||
223 | (use-package org | 223 | (use-package org |
224 | :defer t | 224 | :defer t |
225 | :custom-face | ||
226 | (org-level-1 ((t :inherit fixed-pitch | ||
227 | :weight bold | ||
228 | :height 1.2))) | ||
229 | (org-level-2 ((t :inherit fixed-pitch | ||
230 | :weight bold | ||
231 | :height 1.1))) | ||
232 | (org-level-3 ((t :inherit fixed-pitch | ||
233 | :weight bold | ||
234 | :height 1.0))) | ||
235 | (org-level-4 ((t :inherit org-level-3))) | ||
236 | (org-level-5 ((t :inherit org-level-4))) | ||
237 | (org-level-6 ((t :inherit org-level-5))) | ||
238 | (org-level-7 ((t :inherit org-level-6))) | ||
239 | (org-level-8 ((t :inherit org-level-7))) | ||
240 | (org-drawer ((t :inherit fixed-pitch))) | ||
241 | (org-property-value ((t :inherit fixed-pitch))) | ||
242 | (org-special-keyword ((t :inherit fixed-pitch))) | ||
243 | (org-indent ((t :inherit fixed-pitch))) | ||
225 | :config | 244 | :config |
226 | ;; Options | 245 | ;; Options |
227 | (setopt org-adapt-indentation nil | 246 | (setopt org-adapt-indentation nil |
@@ -273,7 +292,7 @@ If LIST is non-nil, return the result as a list instead of a string." | |||
273 | org-src-window-setup 'current-window | 292 | org-src-window-setup 'current-window |
274 | org-startup-truncated nil | 293 | org-startup-truncated nil |
275 | org-startup-with-inline-images t | 294 | org-startup-with-inline-images t |
276 | org-tags-column 0 | 295 | org-tags-column 0 ;(- 0 fill-column -3) |
277 | org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)" | 296 | org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)" |
278 | "|" "DONE(d!)" "ASSIGNED(a@/!)") | 297 | "|" "DONE(d!)" "ASSIGNED(a@/!)") |
279 | (sequence "|" "CANCELED(k@)") | 298 | (sequence "|" "CANCELED(k@)") |
@@ -292,9 +311,25 @@ If LIST is non-nil, return the result as a list instead of a string." | |||
292 | (add-hook 'org-mode-hook #'turn-off-auto-fill) | 311 | (add-hook 'org-mode-hook #'turn-off-auto-fill) |
293 | (add-hook 'org-mode-hook #'org-indent-mode) | 312 | (add-hook 'org-mode-hook #'org-indent-mode) |
294 | (add-hook 'org-mode-hook #'abbrev-mode) | 313 | (add-hook 'org-mode-hook #'abbrev-mode) |
295 | (add-hook 'org-mode-hook (defun before-save@org-mode () | 314 | (add-hook 'org-mode-hook |
296 | (org-align-tags 'all) | 315 | (defun before-save@org-mode () |
297 | (+org-hide-drawers-except-point)))) | 316 | (add-hook 'before-save-hook |
317 | (defun before-save@org-mode@before-save () | ||
318 | (org-align-tags 'all) | ||
319 | (+org-hide-drawers-except-point)) | ||
320 | nil :local))) | ||
321 | ;; Extra font-lock keywords | ||
322 | (font-lock-add-keywords | ||
323 | 'org-mode | ||
324 | `(;; List markers => org-indent | ||
325 | (,(concat | ||
326 | "^[ ]*\\(\\(?:[-+]\\|\\(?:[0-9]+\\|[A-Za-z]\\)[.)]\\)" | ||
327 | "\\(?:[ ]+\\|$\\)\\)" | ||
328 | "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\]" | ||
329 | "[ ]*\\)?" | ||
330 | "\\(?:\\(\\[[ X-]\\]\\)" | ||
331 | "\\(?:[ ]+\\|$\\)\\)?") | ||
332 | 0 'org-indent)))) | ||
298 | 333 | ||
299 | (use-package org-agenda | 334 | (use-package org-agenda |
300 | :bind (("C-c a" . org-agenda)) | 335 | :bind (("C-c a" . org-agenda)) |
@@ -316,7 +351,10 @@ If LIST is non-nil, return the result as a list instead of a string." | |||
316 | org-deadline-warning-days 0 | 351 | org-deadline-warning-days 0 |
317 | org-agenda-show-future-repeats 'next | 352 | org-agenda-show-future-repeats 'next |
318 | org-agenda-window-setup 'current-window | 353 | org-agenda-window-setup 'current-window |
319 | org-agenda-skip-file-regexp "sync-conflict") | 354 | org-agenda-skip-file-regexp "sync-conflict" |
355 | org-agenda-inhibit-startup t | ||
356 | org-agenda-sticky t | ||
357 | org-agenda-follow-indirect t) | ||
320 | ;; Hooks and advice | 358 | ;; Hooks and advice |
321 | (add-hook 'org-agenda-mode-hook #'truncate-lines-local-mode) | 359 | (add-hook 'org-agenda-mode-hook #'truncate-lines-local-mode) |
322 | (add-hook 'org-agenda-mode-hook #'hl-line-mode) | 360 | (add-hook 'org-agenda-mode-hook #'hl-line-mode) |
@@ -329,7 +367,13 @@ If LIST is non-nil, return the result as a list instead of a string." | |||
329 | (string-match-p org-agenda-skip-file-regexp | 367 | (string-match-p org-agenda-skip-file-regexp |
330 | file)) | 368 | file)) |
331 | files))) | 369 | files))) |
332 | files)) | 370 | files) |
371 | (define-advice org-agenda (:around (orig &rest r) inhibit-hooks) | ||
372 | (let ((org-mode-hook nil)) | ||
373 | (apply orig r))) | ||
374 | (define-advice org-agenda-switch-to (:after (&rest _) do-hooks) | ||
375 | (run-hooks 'org-mode-hook)) | ||
376 | (progress@around org-agenda-list "Building agenda")) | ||
333 | 377 | ||
334 | (use-package org-capture | 378 | (use-package org-capture |
335 | :bind (("C-c c" . org-capture))) | 379 | :bind (("C-c c" . org-capture))) |
@@ -373,5 +417,18 @@ effect for exporting link types)." | |||
373 | :load-path "~/src/emacs/org-word-count/" | 417 | :load-path "~/src/emacs/org-word-count/" |
374 | :hook org-mode-hook) | 418 | :hook org-mode-hook) |
375 | 419 | ||
420 | (use-package org-modern | ||
421 | :ensure t | ||
422 | :custom-face | ||
423 | (org-modern-label ((t :inherit fixed-pitch | ||
424 | :height 1.0))) | ||
425 | :config | ||
426 | (setopt org-modern-star nil | ||
427 | org-hide-leading-stars nil | ||
428 | org-modern-hide-stars nil | ||
429 | org-tags-column 0 | ||
430 | org-modern-keyword nil) | ||
431 | (global-org-modern-mode)) | ||
432 | |||
376 | (provide 'acdw-org) | 433 | (provide 'acdw-org) |
377 | ;;; acdw-org.el ends here | 434 | ;;; acdw-org.el ends here |