summaryrefslogtreecommitdiff
path: root/modules/calendar-sync.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-11 17:17:53 -0500
committerCraig Jennings <c@cjennings.net>2026-05-11 17:17:53 -0500
commite958410cbc14d2bfa0f97890aafe38031e082aa7 (patch)
treef3dba16fd2c0aeb5cc7b50a67b8a559ebbdc0d69 /modules/calendar-sync.el
parent0ddbcde1e9f17021377f4160b39cd0790afcbdcc (diff)
downloaddotemacs-e958410cbc14d2bfa0f97890aafe38031e082aa7.tar.gz
dotemacs-e958410cbc14d2bfa0f97890aafe38031e082aa7.zip
fix(calendar-sync): give the no-init .ics worker its module load-path
The async .ics-to-Org worker runs `emacs --batch --no-site-file --no-site-lisp' and loads `calendar-sync.el' by absolute path, but that doesn't make its sibling `(require 'cj-org-text-lib)' resolvable, so the conversion died with "Cannot open load file: cj-org-text-lib". `calendar-sync--worker-command' now inserts `-L <module-dir>' before `-l calendar-sync.el', which keeps the worker isolated from `init.el' while letting it load its local module deps. Updated the worker-command test and added a regression test that runs the real no-init worker shape.
Diffstat (limited to 'modules/calendar-sync.el')
-rw-r--r--modules/calendar-sync.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/calendar-sync.el b/modules/calendar-sync.el
index 74b2e5c6..62d1b5f1 100644
--- a/modules/calendar-sync.el
+++ b/modules/calendar-sync.el
@@ -1282,7 +1282,8 @@ processes, not direct interactive use."
(defun calendar-sync--worker-command (ics-file output-file)
"Build the batch Emacs command that converts ICS-FILE to OUTPUT-FILE."
- (let ((private-config-file
+ (let ((module-dir (file-name-directory calendar-sync--module-file))
+ (private-config-file
(make-temp-name (expand-file-name "calendar-sync-worker-config-"
temporary-file-directory)))
(state-file
@@ -1294,6 +1295,7 @@ processes, not direct interactive use."
"--no-site-lisp"
"--eval" (format "(setq load-prefer-newer t calendar-sync-auto-start nil calendar-sync-private-config-file %S calendar-sync--state-file %S)"
private-config-file state-file)
+ "-L" module-dir
"-l" calendar-sync--module-file
"--eval" (format "(calendar-sync--batch-convert-file %S %S %S %S '%S)"
ics-file