Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

act on selection #620

Open
noncopyable opened this issue Aug 6, 2024 · 3 comments
Open

act on selection #620

noncopyable opened this issue Aug 6, 2024 · 3 comments

Comments

@noncopyable
Copy link

noncopyable commented Aug 6, 2024

first, thanks for this awesome mode.

i am probably missing some functionality, probably exists in #-thing-#
wouldn't it be great if meow had a binding that calls, "meow--act-on-selection" (like avy act)
that switches to default modeless emacs (insert), keeping selected region. then we are free to call any ###-region command. after that command executed, automagically switches back to normal mode.

maybe, also adding a act-on-selection-modemap where we could do things like:
act-modemap-leader s => surround
act-modemap-leader i => string-inflection
...

@DogLooksGood
Copy link
Collaborator

Hey, the surrounding stuff can actually be built into a package, or built with a paren handling package. I think it's better to use an existing one instead of adding features in Meow.

@noncopyable
Copy link
Author

hello, that is precisely what i want. instead of replicating every other package (evil-### way), we could create a temporary environment/state (in which meow-selected-regions remain) where any package (or ##-region command) can do its thing, and we then switch back to the original meow state that the call was issued.

@DogLooksGood
Copy link
Collaborator

DogLooksGood commented Oct 19, 2024

Well, for a keymap on selection, there's a package available: selected.el. It gives you a keymap when region is active. Of course it works, but very few concepts built for region only. Most features in Emacs works in a Do-What-You-Mean way, so they work with/without a region. (e.g. builtin upcase-dwim, package smartparens). In order to use them whenever possible, we don't bind them to a selection specific keymap.

If you really need a keymap for selection, you probably want to take a look at meow-define-state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants