# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Repository Overview This is a Doom Emacs configuration repository. It uses the Doom Emacs framework with evil-mode (vim keybindings) and contains custom Emacs Lisp packages organized in subdirectories. ## Key Commands After modifying `init.el`, `packages.el`, or adding new packages: ```bash doom sync ``` To reload configuration without restarting Emacs: ``` M-x doom/reload ``` Run Emacs Lisp tests with ERT: ```elisp (ert "test-pattern-*") ; Run tests matching pattern (ert t) ; Run all tests ``` ## Architecture ### Configuration Files (Doom Standard) - `init.el` - Doom module declarations (what features to enable) - `config.el` - Main user configuration - `packages.el` - Package declarations for `doom sync` - `custom.el` - Emacs customize system (auto-generated) ### Custom Packages (loaded via `add-load-path!` in config.el) **coe-xx/** - Cross-stitch pattern editor (from Craft of Emacs guide) - `coe-xx.el` - Major mode for `.coe-xx` pattern files with visual display - `coe-demo.el` - Demo functions for the guide **qwan/** - QWAN blog utilities - `qwan-blog.el` - Blog publishing helpers (draft to `_posts/`, link manipulation) - `qwan-refactor.el` - Elisp refactoring utilities with ERT tests **mostalive/** - Personal org-roam extensions - `my-org-roam.el` - `org-roam-node-insert-immediate` (insert link without opening buffer), agenda file collection - `journelly-convert-entry-to-org-roam.el` - Convert Journelly app entries to org-roam notes - `convert-chats-to-org.el` - Chat log formatting utilities ## Testing Tests are written using ERT (Emacs Lisp Regression Testing). Test functions use `ert-deftest` and follow naming convention `test-*` or match the function name being tested. Example from qwan-refactor.el: ```elisp (ert-deftest refactor-rename-should-replace-space-with-dash () (should (equal (as-function-name "qwan/echo chamber") "qwan/echo-chamber"))) ``` ## Language Support Configuration - **Elixir**: Uses `elixir-ts-mode` with eglot LSP (server at `~/.elixir-ls/release/language_server.sh`) - **Haskell**: LSP enabled via `+lsp` flag - **TypeScript/JavaScript**: LSP enabled, tree-sitter grammars auto-installed - **Org-mode**: Heavy customization with org-roam, pomodoro, gnuplot, presentations ## LLM Integration Uses `gptel` package with: - Default backend: local llama.cpp server at `localhost:8000` - Alternative: Ollama at `localhost:11434` - Presets defined: `explain`, `elixir`