About select
An Emacs skill that uses `emacsclient --eval` to open files and select code or text relevant to the current discussion. It helps users act on contextual passages directly in Emacs.
Key features
- 01Select line ranges across files
- 02Activate the relevant region
- 03Use absolute file paths
- 04Reactivate other file selections
Use cases
- 01Highlight a function discussed in a conversation
- 02Select code containing an error
- 03Mark generated or modified code
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ xenodium/ emacs-skills --skill selectAfter installing, type/selectin Claude Code to confirm it loaded.
Bundled filesagent-skill-select.el
Details
From the project READMESelect region in Emacs
Open one or more files in Emacs and select (activate the region around) the code or text most relevant to the current discussion using emacsclient --eval. This allows the user to immediately act on the selection: narrow, copy, refactor, comment, etc.
Determine the relevant files and line ranges from the most recent interaction context.
How to select
First, locate agent-skill-select.el which lives alongside this skill file at skills/select/agent-skill-select.el in the emacs-skills plugin directory.
emacsclient --eval '
(progn
(load "/path/to/skills/select/agent-skill-select.el" nil t)
(agent-skill-select
:selections (quote (("/path/to/file1.el"
:start 10
:end 25)
("/path/to/file2.el"
:start 5
:end 12)))))'
:startis the 1-indexed start line.:endis the 1-indexed end line.- The last file visited will have the visually active region. Other files have mark and point set (use
C-x C-xto reactivate when switching to them).
Rules
- Use absolute paths for files.
- Choose the region most relevant to the current discussion (e.g., a function just modified, a block with an error, code just generated).
- If no specific region is apparent, select the entire relevant function or block.
- Locate
agent-skill-select.elrelative to this skill file's directory. - If no relevant files or regions exist in the recent interaction, inform the user.
- Run the
emacsclient --evalcommand via the Bash tool.