| Setting | What it does |
|---|---|
-| **Editor** | Picks a URL scheme — VS Code, VS Code Insiders, Cursor, IntelliJ family, TextMate (`txmt://`), or plain `file://`. Set it to *off* to keep `Defined at` as plain text. |
+| **Editor** | Picks a URL scheme — VS Code, VS Code Insiders, Cursor, IntelliJ family, TextMate (`txmt://`), Emacs (`emacs://` or `org-protocol://`), or plain `file://`. Set it to *off* to keep `Defined at` as plain text. |
| **Source root override** | Absolute prefix prepended to relative paths when no per-package root is known. Usually leave blank — `classgraph-view` infers roots from `--input` (see below). |
Once an editor is chosen, every `Defined at` line in the panel becomes
a clickable link that opens the file at the right line in your editor.
-Schemes that take a column (`vscode`, `cursor`, `txmt`) get one;
-`idea` and `file` ignore it.
+Schemes that take a column (`vscode`, `cursor`, `txmt`, `emacs`) get
+one; `idea`, `emacs-org`, and `file` ignore it.
**Source roots are inferred automatically.** The plugin records source
paths as GHC saw them (usually relative to each package's source dir),
<option value="cursor">Cursor</option>
<option value="idea">IntelliJ / IDEA family</option>
<option value="txmt">TextMate (txmt://)</option>
+ <option value="emacs">Emacs (emacs://)</option>
+ <option value="emacs-org">Emacs (org-protocol)</option>
<option value="file">file:// (no line jump)</option>
</select>
</div>
return `idea://open?file=${encodeURIComponent(abs)}&line=${line}`;
case 'txmt':
return `txmt://open?url=file://${enc}&line=${line}&column=${col || 1}`;
+ case 'emacs':
+ // Same query-string shape as `idea`, intentionally — user-side
+ // handlers (xdg-mime / a small wrapper that calls emacsclient
+ // +LINE:COL FILE) are easy to write against this layout. See
+ // the README for an example.
+ return `emacs://open?file=${encodeURIComponent(abs)}` +
+ `&line=${line}&column=${col || 1}`;
+ case 'emacs-org':
+ // Emacs's own org-protocol://open-source URL handler. Requires
+ // (require 'org-protocol) plus (server-start) on the user's
+ // side — the canonical Emacs-internal way.
+ return `org-protocol://open-source?url=` +
+ encodeURIComponent('file://' + (enc.startsWith('/') ? enc : '/' + enc)) +
+ `&line=${line}`;
case 'file':
return `file://${enc.startsWith('/') ? '' : '/'}${enc}`;
default: