Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ coverage: compile
--eval "(efrit-coverage-report)" \
--eval "(efrit-coverage-report-lcov)" \
--eval "(efrit-coverage-report-json)"
@echo "✅ Coverage report generated in ~/.emacs.d/.efrit/coverage/"
@echo "✅ Coverage report generated in user-emacs-directory/.efrit/coverage/"

coverage-simple: compile
@echo "Running simple function-level coverage..."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ The async API is now recommended for all use cases. Use `efrit-do-sync` only if
(setq efrit-max-tokens 8192)

;; Data directory
(setq efrit-data-directory "~/.emacs.d/.efrit/")
(setq efrit-data-directory (expand-file-name ".efrit" user-emacs-directory))

;; Enable debug logging
(setq efrit-log-level 'debug)
Expand Down Expand Up @@ -405,7 +405,7 @@ The default forbidden patterns block truly dangerous commands like `sudo`, `shut

## Data Directory

All data lives under `~/.emacs.d/.efrit/`:
By default, all data lives under `.efrit/` inside `user-emacs-directory`:

```
.efrit/
Expand Down
6 changes: 5 additions & 1 deletion lisp/core/efrit-config.el
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ Update this when releasing new versions.")
:group 'applications
:prefix "efrit-")

(defcustom efrit-data-directory "~/.emacs.d/.efrit"
(defun efrit-config-default-data-directory ()
"Return Efrit's default data directory."
(expand-file-name ".efrit" user-emacs-directory))

(defcustom efrit-data-directory (efrit-config-default-data-directory)
"Directory for storing efrit data files.
This includes context files, session data, communication queues, logs,
and cache. The directory will be created automatically if it doesn't exist."
Expand Down
4 changes: 3 additions & 1 deletion lisp/core/efrit-tool-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
(require 'json)
(require 'cl-lib)
(require 'url-parse)
(require 'efrit-config)

;;; Customization

Expand Down Expand Up @@ -504,7 +505,8 @@ The file path is determined by `efrit-tool-audit-file'."
:type 'boolean
:group 'efrit-tool-utils)

(defcustom efrit-tool-audit-file "~/.emacs.d/.efrit/logs/tool-audit.log"
(defcustom efrit-tool-audit-file
(expand-file-name "logs/tool-audit.log" efrit-data-directory)
"File path for tool audit log when `efrit-tool-audit-to-file' is non-nil."
:type 'file
:group 'efrit-tool-utils)
Expand Down
2 changes: 1 addition & 1 deletion lisp/interfaces/efrit-session-history.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
;; - Session replay (show progress buffer from past session)
;; - Cleanup of old sessions with configurable retention policy
;;
;; Sessions are stored in ~/.emacs.d/.efrit/sessions/ with metadata.
;; Sessions are stored in the Efrit data directory with metadata.

;;; Code:

Expand Down
2 changes: 1 addition & 1 deletion lisp/support/efrit-ui.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
(require 'efrit-ui-dashboard)
(require 'efrit-ui-todos)

(defvar efrit-data-directory (expand-file-name "~/.emacs.d/.efrit/")
(defvar efrit-data-directory (expand-file-name ".efrit" user-emacs-directory)
"Directory for efrit data storage.")

;;; Initialization
Expand Down
3 changes: 2 additions & 1 deletion lisp/tools/efrit-tool-checkpoint.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

;;; Customization

(defcustom efrit-checkpoint-dir "~/.emacs.d/.efrit/checkpoints/"
(defcustom efrit-checkpoint-dir
(expand-file-name "checkpoints" efrit-data-directory)
"Directory to store checkpoint metadata."
:type 'directory
:group 'efrit-tool-utils)
Expand Down
3 changes: 2 additions & 1 deletion lisp/tools/efrit-tool-confirm-action.el
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
:type 'integer
:group 'efrit-tool-utils)

(defcustom efrit-confirm-log-file "~/.emacs.d/.efrit/logs/confirmations.log"
(defcustom efrit-confirm-log-file
(expand-file-name "logs/confirmations.log" efrit-data-directory)
"File path for confirmation audit log."
:type 'file
:group 'efrit-tool-utils)
Expand Down
3 changes: 2 additions & 1 deletion lisp/tools/efrit-tool-undo-edit.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

;;; Undo Registry Management

(defcustom efrit-undo-edit-dir "~/.emacs.d/.efrit/undo/"
(defcustom efrit-undo-edit-dir
(expand-file-name "undo" efrit-data-directory)
"Directory to store per-file undo history."
:type 'directory
:group 'efrit-tool-utils)
Expand Down
4 changes: 2 additions & 2 deletions test/efrit-coverage.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Set to 0 to disable threshold checking."

(defcustom efrit-coverage-output-dir nil
"Directory for coverage reports.
If nil, uses ~/.emacs.d/.efrit/coverage/."
If nil, uses .efrit/coverage/ under `user-emacs-directory'."
:type '(choice (const nil) directory)
:group 'efrit-coverage)

Expand Down Expand Up @@ -99,7 +99,7 @@ Each entry is an alist with:
"Return the coverage output directory, creating it if needed."
(let ((dir (or efrit-coverage-output-dir
(expand-file-name "coverage"
(expand-file-name ".efrit" "~/.emacs.d")))))
(expand-file-name ".efrit" user-emacs-directory)))))
(unless (file-directory-p dir)
(make-directory dir t))
dir))
Expand Down
2 changes: 1 addition & 1 deletion test/efrit-test-runner.el
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
:group 'efrit-test-runner)

(defcustom efrit-test-results-dir nil
"Directory for test results. If nil, uses ~/.emacs.d/.efrit/test-results/."
"Directory for test results. If nil, uses .efrit/test-results/ under `user-emacs-directory'."
:type '(choice (const nil) directory)
:group 'efrit-test-runner)

Expand Down
6 changes: 6 additions & 0 deletions test/test-efrit-config.el
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@

;;; Path Expansion Tests

(ert-deftest test-config-default-data-directory-uses-user-emacs-directory ()
"Test that the default data directory follows `user-emacs-directory'."
(let ((user-emacs-directory "/tmp/efrit-custom-emacs.d/"))
(should (equal (efrit-config-default-data-directory)
"/tmp/efrit-custom-emacs.d/.efrit"))))

(ert-deftest test-config-data-directory-expansion ()
"Test that data directory handles tilde expansion."
(let ((efrit-data-directory "~/test-efrit"))
Expand Down
Loading