select

Opens files in Emacs and selects relevant code regions via emacsclient.

Updated May 2, 2026
One-click install
npx skills add https://github.com/hdeshev/pi-config --skill select-hdeshev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: select
Source: https://github.com/hdeshev/pi-config/tree/main/agent/skills/emacs-select
Command: npx skills add https://github.com/hdeshev/pi-config --skill select-hdeshev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When discussing code with an AI assistant, you often want to jump straight to the relevant lines in your editor to act on them. This Skill opens the discussed files in Emacs and activates a region around the exact code under discussion, so you can immediately narrow, copy, refactor, or comment without manual navigation. ## Core Features & Use Cases - Multi-file region selection: Opens one or more files via emacsclient --eval and sets point and mark on the relevant line ranges in each. - Context-aware targeting: Derives the files and line ranges from the most recent conversation, such as a function just modified or a block containing an error. - Fallback behavior: Selects the entire relevant function or block when no precise region is apparent, and informs the user when nothing relevant exists. - Use Case: After the assistant rewrites a function in parser.el, invoke /select to open that file in Emacs with the rewritten function highlighted, ready for review or further edits. ## Quick Start Invoke /select after discussing a code change to open the relevant files in Emacs with the discussed region highlighted.

Frequently Asked Questions about select

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I select a code region in Emacs from the command line?▼

Use emacsclient --eval with an Elisp expression that visits the file and sets point and mark around the target lines. This skill loads agent-skill-select.el and calls agent-skill-select with file paths and 1-indexed start and end lines.

How do I open multiple files in Emacs with regions selected?▼

Pass a list of selections to agent-skill-select, each with a file path and start and end lines. The last file visited gets the visually active region; other files have point and mark set, reactivatable with C-x C-x.

Does emacsclient require a running Emacs server?▼

Yes, emacsclient connects to an existing Emacs server process, so Emacs must be running with the server started, typically via M-x server-start or (server-start) in your init file.

Why does emacsclient --eval fail to select a region?▼

Failures usually come from relative file paths, a missing Emacs server, or the agent-skill-select.el file not being loaded. Use absolute paths and confirm the helper file is loaded from the skill's directory.

What happens if no relevant code region exists in the conversation?▼

The skill informs the user instead of running emacsclient. When a region is ambiguous, it falls back to selecting the entire relevant function or block rather than guessing arbitrary lines.