スキル一覧に戻る
moogah

emacs-literate-programming

by moogah

0🍴 0📅 2026年1月25日
GitHubで見るManusで実行

SKILL.md


name: emacs-literate-programming description: Use when modifying Emacs config files - ensures you edit .org source files not generated .el files, and properly tangle changes

Emacs Literate Programming Workflow

Overview

Literate Configuration: Jeff's Emacs config uses org-mode files as source. Editing .el files directly is forbidden - they're auto-generated and changes will be overwritten.

Core principle: .org files are source of truth → tangle to .el files → Emacs loads .el files

When to Use

Use this skill when:

  • About to edit any file in emacs/ directory
  • User mentions Emacs configuration changes
  • You see both .org and .el files in emacs/ directories
  • Auto-tangle fails or syntax errors appear

DO NOT edit .el files directly - they get overwritten when tangled

Quick Reference

TaskMethodCommand/Trigger
Normal editingAuto-tangleSave .org file (requires #+auto_tangle: y)
Manual tangleEmacs commandC-c C-v t
CLI tanglingScript./bin/tangle-org.sh path/to/file.org
Batch tangleScript + findfind emacs/ -name "*.org" -exec ./bin/tangle-org.sh {} \;

Tangling Methods

Auto-Tangle (Primary Method)

  • Trigger: Save the .org file
  • Requirement: #+auto_tangle: y header in file
  • Result: Automatically generates .el file

Manual Tangle in Emacs

  • When: Auto-tangle fails or disabled
  • Command: C-c C-v t (org-babel-tangle)

CLI Tangling (bin/tangle-org.sh)

# Single file
./bin/tangle-org.sh emacs/major-modes/org.org

# All org files
find emacs/ -name "*.org" -exec ./bin/tangle-org.sh {} \;

Features: Auto-finds Emacs, validates files, batch mode, clear errors

Required File Headers

#+title: Module Name
#+property: header-args:emacs-lisp :tangle module-name.el
#+auto_tangle: y

After Tangling

  1. Restart Emacs or use jf/reload-module to load changes
  2. Test changes ensure they work
  3. Commit both files - keep .org and .el in sync

Common Mistakes

MistakeWhy BadFix
Editing .el files directlyChanges overwritten on next tangleEdit .org file instead
Committing only .org.el out of sync, breaks configCommit both .org and .el
Forgetting to tangleChanges in .org not appliedSave (auto-tangle) or run C-c C-v t
Missing #+auto_tangle: yManual tangling requiredAdd header to .org file
Property line not activatedTangling fails silentlyPress C-c C-c on #+PROPERTY line
Syntax errors in org blocksTangle fails silentlyUse Claude Code hook for validation

Troubleshooting

When auto-tangling or manual tangling fails, see troubleshooting-tangling.md for:

  • Systematic debugging process
  • Common issues and solutions (especially property activation with C-c C-c)
  • Understanding multiple tangle directives and precedence
  • Path resolution (relative vs absolute)
  • Header arguments syntax reference

Quick fix for most issues: Press C-c C-c on the #+PROPERTY: header-args line to activate it.

Syntax Protection

Claude Code hook (validate_elisp_syntax.py) validates elisp before writing .el files to prevent invalid code.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です