diff options
| author | Szymon Szukalski <szymon@szymonszukalski.com> | 2026-04-09 10:53:27 +1000 |
|---|---|---|
| committer | Szymon Szukalski <szymon@szymonszukalski.com> | 2026-04-09 10:53:27 +1000 |
| commit | bc75732b9d37b77945a977ee9f7892cf6efc79c3 (patch) | |
| tree | 4d9273ccc12c29eccc44fdc12372bea047414353 /lisp/ss-org.el | |
| parent | 12a5b1464bb919ba23f2aa6c22d44de81e382151 (diff) | |
Refactor Emacs config into modules
Diffstat (limited to 'lisp/ss-org.el')
| -rw-r--r-- | lisp/ss-org.el | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/lisp/ss-org.el b/lisp/ss-org.el new file mode 100644 index 0000000..30956e9 --- /dev/null +++ b/lisp/ss-org.el @@ -0,0 +1,57 @@ +;;; ss-org.el --- Base Org configuration -*- lexical-binding: t; -*- + +;;; Commentary: + +;; Shared Org setup and note-opening helpers. + +;;; Code: + +(require 'ss-core) + +(defun ss-open-journal () + "Open `ss-journal-file', moving to today's entry when it exists." + (interactive) + (find-file (ss-require-existing-file ss-journal-file)) + (widen) + (unless (fboundp 'ss-journal-goto-date) + (goto-char (point-max))) + (when (fboundp 'ss-journal-goto-date) + (unless (ss-journal-goto-date) + (goto-char (point-max))))) + +(defun ss-open-moc () + "Open the central MOC note." + (interactive) + (find-file (ss-require-existing-file ss-moc-file))) + +(defun ss-org-setup () + "Initialize base Org configuration." + (use-package org + :ensure nil + :config + (setq org-directory ss-org-directory + org-hide-emphasis-markers t + org-agenda-search-headline-for-time t) + (add-hook 'org-mode-hook + (lambda () + (setq-local org-hide-emphasis-markers t) + (font-lock-flush) + (font-lock-ensure)))) + + (use-package git-auto-commit-mode + :ensure t + :pin melpa + :commands (git-auto-commit-mode) + :init + (setq gac-shell-and + (if (string-match-p "fish\\'" shell-file-name) + " ; and " + " && "))) + + (add-hook 'emacs-startup-hook + (lambda () + (find-file (ss-require-existing-file ss-moc-file))))) + +(provide 'ss-org) + +;;; ss-org.el ends here |
