You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use it in combination with this function which I bind to C-;.
(defunap/iedit-or-flyspell ()
"Call `iedit-mode' or correct misspelling with flyspell, depending..."
(interactive)
(if (or iedit-mode
(and (derived-mode-p'prog-mode)
(not (or (nth4 (syntax-ppss))
(nth3 (syntax-ppss))))))
;; prog-mode is active and point is in a comment, string, or;; already in iedit-mode
(iedit-mode)
;; Not prog-mode or not in comment or string
(if (not (equal flyspell-previous-command this-command))
;; FIXME: This mostly works, but if there are two words on the;; same line that are misspelled, it doesn't work quite right;; when correcting the earlier word after correcting the later;; one;; First correction; autocorrect
(call-interactively'flyspell-auto-correct-previous-word)
;; First correction was not wanted; use popup to choose
(progn
(save-excursion
(undo)) ; This doesn't move point, which I think may be the problem.
(flyspell-region (line-beginning-position) (line-end-position))
(call-interactively'flyspell-correct-previous-word-generic)))))
Here's how this works: if I press the key in a comment or a string, it calls flyspell-auto-correct-previous-word at first, automatically correcting the previous marked misspelling to the initial suggestion. If I press the key again, it undoes the correction and calls flyspell-correct-previous-word-generic, which is set to flyspell-correct-popup, which shows the popup list of suggested corrections, and I can then press TAB and S-TAB to choose one and RET to select it. And if I press C-; in code, it activates iedit-mode instead.
I don't know that you'd want to add all of that to the readme, but I thought that the TAB/S-TAB binding would be generally appreciated by most people, as it's a lot easier than C-n/p for choosing. :)
Thanks for your work on this package! Spell correction is so nice on Emacs now!
The text was updated successfully, but these errors were encountered:
Hi,
I just set up this binding and have found it really useful:
I use it in combination with this function which I bind to
C-;
.Here's how this works: if I press the key in a comment or a string, it calls
flyspell-auto-correct-previous-word
at first, automatically correcting the previous marked misspelling to the initial suggestion. If I press the key again, it undoes the correction and callsflyspell-correct-previous-word-generic
, which is set toflyspell-correct-popup
, which shows the popup list of suggested corrections, and I can then pressTAB
andS-TAB
to choose one andRET
to select it. And if I pressC-;
in code, it activatesiedit-mode
instead.I don't know that you'd want to add all of that to the readme, but I thought that the
TAB/S-TAB
binding would be generally appreciated by most people, as it's a lot easier thanC-n/p
for choosing. :)Thanks for your work on this package! Spell correction is so nice on Emacs now!
The text was updated successfully, but these errors were encountered: