Skip to content

xenodium/diverted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

👉 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

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

After

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

Setup

  1. Load package
    (require 'diverted)
        
  1. Identify diversions and provide a breadcrumb to get back.
    (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))))
        
  2. Enable `diverted-mode’
    (diverted-mode +1)
        

About

Identify temporary Emacs diversions and automatically return to original location

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published