Just in case anyone still checks this group...
I recently upgraded to emacs 30.1. For many years I had been using a function which automatically corrected transposition errors, but it no
longer works in 30.1. The author of that function kindly pointed me to the fact that such functionality has been part of flyspell for a long time, and that I should add
(add-hook 'flyspell-incorrect-hook 'flyspell-maybe-correct-transposition) to my init.el.
So I put that in my init.el and started typing away, only to discover that
it doesn't do exactly what I want. To reproduce the problem,
(1) Replace your entire init.el with this one line:
(add-hook 'flyspell-incorrect-hook 'flyspell-maybe-correct-transposition)
(2) Create a file ABC like this
----------------- cut here --------------------
ABC
----------------- cut here --------------------
(3) Fire up a fresh emacs as follows:
emacs ABC
(4) Turn on flyspell
M-x flyspell-mode
(5) Navigate to the end of the 'abc' line
(6) Type Ctrl-T
I get "CAB", whereas I expect "ACB".
Now, I know that "cab" is an English word, and that "acb" is not, and
I presume flyspell is looking at "ACB" immediately after I do the Ctrl-T
and "fixes" the resulting spelling error.
(Finance wonks may recognize ACB as the abbreviation for "adjusted cost base", so it is something I might actually want to type. Yes, I could add ACB to my dictionary, but that doesn't solve the problem in general.)
With my old setup in emacs 28.2, the transposition correction function was only triggered when I typed a space (or maybe some other word-ending character), so I could transpose two letters and then move away from the "word" using something other than a space (e.g., arrow keys), and the text would stay how I wanted it.
I don't immediately see any way to get the previous behaviour I liked.
Can anyone suggest a way to do this?
(And if you are wondering... I rarely want to have "ACB", but I was typing
a message with some other three-letter acronym which kept getting changed
by flyspell, and getting the actual TLA that I wanted was a nuisance.)
Thanks.--
Jim
Jim <zsd@jdvb.ca> wrote:
Just in case anyone still checks this group...
:-)
I recently upgraded to emacs 30.1. For many years I had been using a
function which automatically corrected transposition errors, but it no
longer works in 30.1. The author of that function kindly pointed me to the >> fact that such functionality has been part of flyspell for a long time, and >> that I should add
(add-hook 'flyspell-incorrect-hook 'flyspell-maybe-correct-transposition)
to my init.el.
So I put that in my init.el and started typing away, only to discover that >> it doesn't do exactly what I want. To reproduce the problem,
(1) Replace your entire init.el with this one line:
(add-hook 'flyspell-incorrect-hook 'flyspell-maybe-correct-transposition)
(2) Create a file ABC like this
----------------- cut here --------------------
ABC
----------------- cut here --------------------
(3) Fire up a fresh emacs as follows:
emacs ABC
(4) Turn on flyspell
M-x flyspell-mode
(5) Navigate to the end of the 'abc' line
(6) Type Ctrl-T
I get "CAB", whereas I expect "ACB".
Now, I know that "cab" is an English word, and that "acb" is not, and
I presume flyspell is looking at "ACB" immediately after I do the Ctrl-T
and "fixes" the resulting spelling error.
(Finance wonks may recognize ACB as the abbreviation for "adjusted cost
base", so it is something I might actually want to type. Yes, I could add >> ACB to my dictionary, but that doesn't solve the problem in general.)
With my old setup in emacs 28.2, the transposition correction function was >> only triggered when I typed a space (or maybe some other word-ending
character), so I could transpose two letters and then move away from the
"word" using something other than a space (e.g., arrow keys), and the text >> would stay how I wanted it.
I don't immediately see any way to get the previous behaviour I liked.
Can anyone suggest a way to do this?
What you have typed in this post is very close to a perfect bug report.
As an ex Emacs developer, I would suggest you submit a bug report for
this. It feels like somebody decided to make flyspell "nicer" without thinking things through thoroughly.
To submit a bug, either (preferred) M-x report-emacs-bug followed by
doing the obvious (if you use Emacs for email), or just send an email to bug-gnu-emacs@gnu.org. Either should get you an immediate
acknowledgement, followed by a proper reply as soon as somebody actually looks at it. This time is usually less than the previous sentence makes
it sound.
(And if you are wondering... I rarely want to have "ACB", but I was typing >> a message with some other three-letter acronym which kept getting changed
by flyspell, and getting the actual TLA that I wanted was a nuisance.)
A bug indeed!
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 01:43:21 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
10 files (20,373K bytes) |
| Messages: | 264,188 |