SkillAgentSearch skills...

Diverted

Identify temporary Emacs diversions and automatically return to original location

Install / Use

/learn @xenodium/Diverted
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

👉 [[https://github.com/sponsors/xenodium][Support this work via GitHub Sponsors]]

  • diverted.el

Identify temporary diversions and automatically return to original point location.

Let's say you want to select the current function and indent region, this leaves your point in an unintended location. You likely wanted your point in the location becore selecting the current function. Diverted helps identify those scenarios and brings point back to your intended location.

  • Before

#+HTML: <img src="https://raw.githubusercontent.com/xenodium/diverted/main/demo/before.gif"/>

Notice how point is left at the top of the screen after pressing TAB to indent region.

  • After

#+HTML: <img src="https://raw.githubusercontent.com/xenodium/diverted/main/demo/after.gif"/>

Notice how point is left where it was prior to selecting the functoin and pressing TAB to indent region.

  • Setup
  1. Load package

    #+begin_src emacs-lisp :lexical no (require 'diverted) #+end_src

  2. Identify diversions and provide a breadcrumb to get back.

    #+begin_src emacs-lisp :lexical no (add-to-list 'diverted-events (make-diverted-event :from 'er/expand-region :to 'indent-for-tab-command :breadcrumb (lambda () (diverted--pop-to-mark-command 2)))) #+end_src

  3. Enable `diverted-mode'

    #+begin_src emacs-lisp :lexical no (diverted-mode +1) #+end_src

Related Skills

View on GitHub
GitHub Stars16
CategoryDevelopment
Updated4mo ago
Forks0

Languages

Emacs Lisp

Security Score

72/100

Audited on Nov 15, 2025

No findings