highlight
Highlight regions in Emacs
Highlight relevant regions in one or more files in Emacs using emacsclient --eval. Files are opened in a temporary read-only minor mode with highlighted overlays. The user presses q to exit the mode and remove all highlights in that buffer.
Determine the relevant files and line ranges from the most recent interaction context.
How to highlight
First, determine the path to agent-skill-highlight.el. It lives alongside this skill file at skills/highlight/agent-skill-highlight.el in the emacs-skills plugin directory.
emacsclient --eval '
(progn
(load "/path/to/skills/highlight/agent-skill-highlight.el" nil t)
(agent-skill-highlight
:files (quote (("/path/to/file1.el"
:regions ((:start 90 :lines 18)
(:start 114 :lines 49)))
("/path/to/file2.el"
:regions ((:start 94 :lines 18)))))))'
:startis the 1-indexed line number.:linesis the number of lines to highlight from that start line.- Add as many files and regions as needed.
Rules
- Use absolute paths for files.
- Locate
agent-skill-highlight.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.
More from xenodium/emacs-skills
emacsclient
Always use emacsclient instead of emacs. This applies to all Emacs operations: user requests, byte compilation, check-parens, running ERT tests, and any other elisp evaluation.
55describe
This skill should be used when the user invokes "/describe" to look up Emacs documentation via emacsclient.
38dired
This skill should be used when the user invokes "/dired" to open files from the latest interaction in an Emacs dired buffer via emacsclient.
37open
This skill should be used when the user invokes "/open" to open files from the latest interaction in Emacs buffers via emacsclient.
36select
This skill should be used when the user invokes "/select" to open one or more files in Emacs and select a region relevant to the current discussion via emacsclient.
35file-links
When referencing files, format them as markdown links with line numbers using GitHub-style #L syntax.
33