-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Allow to configure behaviour of C-g #80
Comments
I'm not sure how general this approach is, but I'd say this is already doable without any further modification with the interfaces that allow for a dedicated keymap (I'm not sure if such maps are exposed for all interfaces though). And this might be as general as it gets, because configuring the behavior of (defun flyspell-correct-ivy-stop ()
(interactive)
(ivy-exit-with-action
(lambda (_) (setq flyspell-correct-ivy--result (cons 'stop "")))))
(define-key flyspell-correct-ivy-map (kbd "C-g") #'flyspell-correct-ivy-stop) This uses the feature implemented at #58 (comment), allowing to bind the skip action in Edit: I've just learned today of (define-key flyspell-correct-ivy-map (kbd "C-g") (ivy-make-magic-action 'flyspell-correct-ivy "p")) |
Regarding:
I also have some thoughts, and a suggestion. Currently, (when (or (not (mark t))
(/= (mark t) (point)))
(push-mark (point) t)) While the other two don't. This actually only makes a significant difference when the action is Either way, I think this could be improved for all three cases, by pushing the mark to the original point, when leaving with a If this is done, when leaving with a This, of course, would affect the |
Cool. I am glad that you are using that things from #58 :)
PR is welcome :) Regardless the stop/C-g thing. |
More than "using", this has become a game changer for my workflow. As far as "killer features" go, this is currently only second to returning point after correction. ;-) I'm glad to try my hands on a PR. But I've got some further thoughts on mark setting, which I thought I'd share first. Besides what I've mentioned above, I has struck me that I suggest WDYT? If you think this is a good idea, there's still the question of what is the best point to insert the mark: if at Anyway, summing up, I'm suggesting two changes: i) push the mark to the original point position at the top of the mark-ring when leaving with a stop action; ii) be more selective in the mark setting behavior by pushing the mark only when there is change. I can prepare a PR for both or either, once there's agreement on where to go. |
For two reasons. The first one is historical. And the second one is me who didn't think about it. As you can see, mark pushing is not consistent and not thought through.
Totally agree. So actions like Regarding the place - I think
Oh, this is very good idea. I like it. So after stop you can quickly restore your original location. Very clever.
And I like this idea as well. Good job @gusbrs I will be happy to get a PR for both of these ideas. |
Great! I'll prepare it. |
Hi @d12frosted , PR done! I add some comments on it here. I ended wrapping the Second, as I'm aware you know, the position of the marks set in |
Nah, that was a bug... Pre-existing, to be fair. Details in a second commit made to the PR, which fixes it. |
Yes, good point. Thanks for doing this. |
Following discussion at #80. - Make `flyspell-correct-move' push the mark more conservatively, namely only when there is actual change in the overlays, that is, refraining to do so on `skip', `stop' or `break' actions. - Push the mark at the top of the mark-ring when leaving with action `stop', to be able to easily return to original point position in that case. - The initial mark pushed at `flyspell-correct-wrapper' was brought to `flyspell-correct-move' to ensure consistency of behavior between the `-wrapper` and `-next'/`-previous' commands. A clean-up check for this mark was included.
I would like to have C-g to always stop. Then we could even remove the STOP actions from the frontends. |
The more I think about it, the more I agree that it just should STOP, as you still can return to the previous place by popping the mark. @minad care to send a PR? 😸 |
Maybe I will send a PR (no promises!), but with my PR #94 I am already very happy with the functionality offered by your package :) |
Current behaviour: when hitting
C-g
duringflyspell-correct-wrapper
, the point is restored to the place where it was /before/ callingflyspell-correct-wrapper
.Desired behaviour: allow to configure
flyspell-correct-wrapper
in a way thatC-g
behaves likeSTOP
action by default. In this case we might want to have an action to restore the point. 🤷This concern was raised multiple times, the last occurrences that I remember are: #48 (by @Boruch-Baum) and #73 (by @WorldsEndless).
The text was updated successfully, but these errors were encountered: