summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/dirvish-config.el16
-rw-r--r--modules/flyspell-and-abbrev.el2
-rw-r--r--modules/games-config.el2
-rw-r--r--modules/keyboard-macros.el2
-rw-r--r--modules/org-config.el2
-rw-r--r--modules/org-noter-config.el2
-rw-r--r--modules/reconcile-open-repos.el2
-rw-r--r--modules/system-defaults.el26
-rw-r--r--modules/ui-theme.el4
-rw-r--r--modules/user-constants.el32
10 files changed, 52 insertions, 38 deletions
diff --git a/modules/dirvish-config.el b/modules/dirvish-config.el
index 47a821ea..ed4f57d5 100644
--- a/modules/dirvish-config.el
+++ b/modules/dirvish-config.el
@@ -43,7 +43,6 @@ Used to filter files for M3U playlists.")
(defun cj/dired-create-playlist-from-marked ()
"Create an .m3u playlist file from marked files in Dired (or Dirvish).
-
Filters for audio files, prompts for the playlist name, and saves the resulting
.m3u in the directory specified by =music-dir=. Interactive use only."
(interactive)
@@ -138,7 +137,6 @@ Filters for audio files, prompts for the playlist name, and saves the resulting
(defun cj/dirvish-open-file-manager-here ()
"Open system's default file manager in the current dired/dirvish directory.
-
Always opens the file manager in the directory currently being displayed,
regardless of what file or subdirectory the point is on."
(interactive)
@@ -167,7 +165,7 @@ regardless of what file or subdirectory the point is on."
;;; ---------------------------------- Dirvish ----------------------------------
(use-package dirvish
- :defer 1
+ :defer 0.5
:init
(dirvish-override-dired-mode)
:custom
@@ -180,7 +178,7 @@ regardless of what file or subdirectory the point is on."
("ra" ,video-recordings-dir "video recordings")
("rv" ,audio-recordings-dir "audio recordings")
("dl" ,dl-dir "downloads")
- ("dr" ,(concat sync-dir "/drill/") "drill files")
+ ("dr" ,(concat org-dir "/drill/") "drill files")
("dt" ,(concat dl-dir "/torrents/complete/") "torrents")
("dx" "~/documents/" "documents")
("lx" "~/lectures/" "lectures")
@@ -197,9 +195,10 @@ regardless of what file or subdirectory the point is on."
("rcj" "/sshx:cjennings@cjennings.net:~" "remote cjennings.net")
("rsb" "/sshx:cjennings@wolf.usbx.me:/home/cjennings/" "remote seedbox")
("sx" ,sync-dir "sync directory")
- ("so" "~/sync/org" "org directory")
- ("sv" "~/sync/videos/" "sync/videos directory")
- ("tg" ,(concat sync-dir "/text.games") "text games")
+ ("so" ,(concat sync-dir "/org/") "sync/org directory")
+ ("sr" ,(concat sync-dir "/recordings/") "sync/recordings directory")
+ ("sv" ,(concat sync-dir "/videos/") "sync/videos directory")
+ ("tg" ,(concat sync-dir "/text.games/") "text games")
("vr" ,video-recordings-dir "video recordings directory")
("vx" ,videos-dir "videos")))
:config
@@ -306,7 +305,7 @@ regardless of what file or subdirectory the point is on."
(use-package dired-sidebar
:after (dired projectile)
- :bind (("<f11>" . dired-sidebar-toggle-sidebar))
+ :defer t
:commands (dired-sidebar-toggle-sidebar)
:init
(add-hook 'dired-sidebar-mode-hook
@@ -329,7 +328,6 @@ regardless of what file or subdirectory the point is on."
"Copy path of file at point in Dired/Dirvish.
Copies relative path from project root if in a project, otherwise from home
directory (with ~ prefix) if applicable, otherwise the absolute path.
-
With prefix arg or when AS-ORG-LINK is non-nil, format as \='org-mode\=' link."
(interactive "P")
(unless (derived-mode-p 'dired-mode)
diff --git a/modules/flyspell-and-abbrev.el b/modules/flyspell-and-abbrev.el
index 8c9550d5..978f8208 100644
--- a/modules/flyspell-and-abbrev.el
+++ b/modules/flyspell-and-abbrev.el
@@ -81,7 +81,7 @@
("-d" "en_US") nil utf-8)))
;; personal directory goes with sync'd files
(setq ispell-personal-dictionary
- (concat sync-dir "aspell-personal-dictionary"))
+ (concat org-dir "aspell-personal-dictionary"))
;; skip code blocks in org mode
(add-to-list 'ispell-skip-region-alist '("^#+BEGIN_SRC" . "^#+END_SRC")))
diff --git a/modules/games-config.el b/modules/games-config.el
index 7e2bebd6..79f57498 100644
--- a/modules/games-config.el
+++ b/modules/games-config.el
@@ -14,7 +14,7 @@
(use-package malyon
:defer 1
:config
- (setq malyon-stories-directory (concat sync-dir "text.games/")))
+ (setq malyon-stories-directory (concat org-dir "text.games/")))
;; ------------------------------------ 2048 -----------------------------------
;; combine numbered tiles to create the elusive number 2048.
diff --git a/modules/keyboard-macros.el b/modules/keyboard-macros.el
index 789ecc90..63b46927 100644
--- a/modules/keyboard-macros.el
+++ b/modules/keyboard-macros.el
@@ -33,7 +33,7 @@
;;
;;; Code:
-(require 'user-constants) ;; definitions of sync-dir and macros-file
+(require 'user-constants) ;; definitions of org-dir and macros-file
(defvar cj/macros-loaded nil
"Whether saved keyboard macros have been loaded from file.")
diff --git a/modules/org-config.el b/modules/org-config.el
index aa91f7e1..9765fbc8 100644
--- a/modules/org-config.el
+++ b/modules/org-config.el
@@ -11,7 +11,7 @@
;; note: some constants used here are defined in init.el
(defvar org-archive-location
- (concat sync-dir "/archives/archive.org::datetree/")
+ (concat org-dir "/archives/archive.org::datetree/")
"Location of the archive file.
The archive file is where org entries that are archived via
org-archive-subtree-default are placed.")
diff --git a/modules/org-noter-config.el b/modules/org-noter-config.el
index a3968aa6..a5e1f7fc 100644
--- a/modules/org-noter-config.el
+++ b/modules/org-noter-config.el
@@ -31,7 +31,7 @@
(setq org-noter-notes-window-location 'horizontal-split)
(setq org-noter-notes-window-behavior '(start scroll)) ; note: must be a list!
(setq org-noter-doc-split-fraction '(0.5 . 0.5))
- (setq org-noter-notes-search-path (list (concat sync-dir "/org-noter/")))
+ (setq org-noter-notes-search-path (list (concat org-dir "/org-noter/")))
(setq org-noter-default-notes-file-names '("reading-notes.org"))
(setq org-noter-separate-notes-from-heading t)
(setq org-noter-kill-frame-at-session-end t) ; kill frame when closing session
diff --git a/modules/reconcile-open-repos.el b/modules/reconcile-open-repos.el
index 8a2eda5e..ea22dda8 100644
--- a/modules/reconcile-open-repos.el
+++ b/modules/reconcile-open-repos.el
@@ -61,7 +61,7 @@
(cj/reconcile-git-directory child-dir)))))
;; check these directories individually
- (cj/reconcile-git-directory sync-dir)
+ (cj/reconcile-git-directory org-dir)
(cj/reconcile-git-directory user-emacs-directory)
;; communicate when finished.
diff --git a/modules/system-defaults.el b/modules/system-defaults.el
index c0879d51..2cd46566 100644
--- a/modules/system-defaults.el
+++ b/modules/system-defaults.el
@@ -12,7 +12,18 @@
;;; Code:
-(require 'host-environment)
+
+(require 'autorevert)
+(require 'server)
+(require 'bookmark)
+
+;; Loaded earlier in init.el
+(eval-when-compile (require 'host-environment))
+(eval-when-compile (require 'user-constants))
+
+;; Function in system-utils.el; autoload to avoid requiring it here.
+(autoload 'env-bsd-p "host-environment" nil t)
+
;; -------------------------- Native Comp Preferences --------------------------
;; after async compiler starts, set preferences and warning level
@@ -30,10 +41,11 @@
"File where native-comp warnings will be appended.")
(defun cj/log-comp-warning (type message &rest args)
- "Log native-comp warnings of TYPE with MESSAGE & ARGS to 'comp-warnings-log'.
-Suppress them from appearing in the *Warnings* buffer. If TYPE contains 'comp',
-log the warning with a timestamp to the file specified by 'comp-warnings-log'.
-Return non-nil to indicate the warning was handled."
+ "Log native-comp warnings of TYPE with MESSAGE & ARGS.
+Log to buffer \='comp-warnings-log\='. Suppress warnings from appearing in the
+*Warnings* buffer. If TYPE contains \='comp\+', log the warning with a
+timestamp to the file specified by \+'comp-warnings-log\='. Return non-nil to
+indicate the warning was handled."
(when (memq 'comp (if (listp type) type (list type)))
(with-temp-buffer
(insert (format-time-string "[%Y-%m-%d %H:%M:%S] "))
@@ -65,7 +77,7 @@ Return non-nil to indicate the warning was handled."
(defun cj/disabled ()
"Do absolutely nothing and do it quickly.
-Used to disable functionality with defalias 'somefunc 'cj/disabled)."
+Used to disable functionality with defalias \='somefunc \='cj/disabled)."
(interactive))
;; VIEW EMACS NEWS
@@ -190,7 +202,7 @@ Used to disable functionality with defalias 'somefunc 'cj/disabled)."
;; keep bookmarks in sync location, and save the file whenever a mark is added
;; place bookmark file sync'd org files
-(setq bookmark-default-file (concat sync-dir "emacs_bookmarks"))
+(setq bookmark-default-file (concat org-dir "emacs_bookmarks"))
;; save bookmarks each (1) time it's modified.
(setq bookmark-save-flag 1)
diff --git a/modules/ui-theme.el b/modules/ui-theme.el
index d754b554..d6eaf404 100644
--- a/modules/ui-theme.el
+++ b/modules/ui-theme.el
@@ -17,7 +17,7 @@
;;; Code:
-(require 'user-constants) ;; For sync-dir
+(require 'user-constants) ;; For org-dir
;; ----------------------------------- Themes ----------------------------------
;; theme choices and settings
@@ -49,7 +49,7 @@ Unloads any other applied themes before applying the chosen theme."
;; ----------------------------- Theme Persistence -----------------------------
;; persistence utility functions used by switch themes.
-(defvar theme-file (concat sync-dir "emacs-theme.persist")
+(defvar theme-file (concat org-dir "emacs-theme.persist")
"The location of the file to persist the theme name.
If you want your theme change to persist across instances, put this in a
diff --git a/modules/user-constants.el b/modules/user-constants.el
index fd48ffe3..f36a2bb5 100644
--- a/modules/user-constants.el
+++ b/modules/user-constants.el
@@ -15,7 +15,7 @@
;; This happens automatically when the module loads.
;;
;; The paths are designed with a hierarchical structure, allowing child paths
-;; to reference their parents (e.g., roam-dir is inside sync-dir) for better
+;; to reference their parents (e.g., roam-dir is inside org-dir) for better
;; maintainability.
;;
;;; Code:
@@ -62,19 +62,22 @@
(defconst mail-dir (expand-file-name ".mail/" user-home-dir)
"Root directory where the mail folders are located.")
-(defconst sync-dir (expand-file-name "sync/org/" user-home-dir)
+(defconst sync-dir (expand-file-name "sync/" user-home-dir)
"This directory is synchronized across machines.")
-(defconst roam-dir (expand-file-name "roam/" sync-dir)
+(defconst org-dir (expand-file-name "org/" sync-dir)
+ "This directory is synchronized across machines.")
+
+(defconst roam-dir (expand-file-name "roam/" org-dir)
"The location of org-roam files.")
(defconst journals-dir (expand-file-name "journal/" roam-dir)
"The location of org-roam dailies or journals files.")
-(defconst drill-dir (expand-file-name "drill/" sync-dir)
+(defconst drill-dir (expand-file-name "drill/" org-dir)
"The location of org-drill org files.")
-(defconst snippets-dir (expand-file-name "snippets/" sync-dir)
+(defconst snippets-dir (expand-file-name "snippets/" org-dir)
"The location of ya-snippet snippets.")
(defvar sounds-dir (expand-file-name "assets/sounds/" user-emacs-directory)
@@ -94,16 +97,16 @@
(defvar authinfo-file (expand-file-name ".authinfo.gpg" user-home-dir)
"The location of the encrypted .authinfo or .netrc file.")
-(defvar schedule-file (expand-file-name "schedule.org" sync-dir)
+(defvar schedule-file (expand-file-name "schedule.org" org-dir)
"The location of the org file containing scheduled events.")
-(defvar gcal-file (expand-file-name "gcal.org" sync-dir)
+(defvar gcal-file (expand-file-name "gcal.org" org-dir)
"The location of the org file containing Google Calendar information.")
-(defvar reference-file (expand-file-name "reference.org" sync-dir)
+(defvar reference-file (expand-file-name "reference.org" org-dir)
"The location of the org file containing reference information.")
-(defvar article-archive (expand-file-name "article-archive.org" sync-dir)
+(defvar article-archive (expand-file-name "article-archive.org" org-dir)
"The location of the org file that stores saved articles to keep.")
(defvar inbox-file (expand-file-name "inbox.org" roam-dir)
@@ -112,16 +115,16 @@
(defvar reading-notes-file (expand-file-name "reading_notes.org" roam-dir)
"The default notes file for org-noter.")
-(defvar macros-file (concat sync-dir "macros.el")
+(defvar macros-file (concat org-dir "macros.el")
"The location of the macros file for recorded saved macros via M-f3.")
-(defvar contacts-file (expand-file-name "contacts.org" sync-dir)
+(defvar contacts-file (expand-file-name "contacts.org" org-dir)
"The location of the org file containing contact information.")
(defvar notification-sound (expand-file-name "BitWave.opus" sounds-dir)
"The location of the audio file to use as the default notification.")
-(defvar webclipped-file (expand-file-name "webclipped.org" sync-dir)
+(defvar webclipped-file (expand-file-name "webclipped.org" org-dir)
"The location of the org file that keeps webclips to read.
For more information, see org webclipper section of org-capture-config.el")
@@ -158,13 +161,14 @@ This ensures that all directories and files required by the Emacs configuration
exist, creating them if necessary. This makes the configuration more robust
and portable across different machines."
(interactive)
- (mapc 'cj/verify-or-create-dir (list drill-dir
+ (mapc 'cj/verify-or-create-dir (list sync-dir
+ drill-dir
journals-dir
roam-dir
snippets-dir
video-recordings-dir
audio-recordings-dir
- sync-dir))
+ org-dir))
(mapc 'cj/verify-or-create-file (list schedule-file
inbox-file
article-archive