Fork me on GitHub
#emacs
<
2021-02-28
>
clyfe09:02:47

Is it possible to make an elisp function bound to left or right arrow key that: • if no active region, moves the point arg places in arrow direction (standard stuff) • works with shift translation (selects text when shift pressed, standard stuff) • if region is active, deselects text and places the cursor at the start or end of region (depending on arrow direction) The tricky part afaict is shift translation deselects before function runs, and I can't tell if text was selected on last point.

clyfe13:02:05

Managed it with advices on handle-shift-selection & call-interactively & such

grazfather15:02:22

Could you please share the mapping for curiosity’s sake?