summaryrefslogtreecommitdiff
path: root/lisp/ss-org.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ss-org.el')
-rw-r--r--lisp/ss-org.el57
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