A long, long time ago I started using a function (John Wiegley's
auto-correct function) which, up until Emacs 28, worked by defining a function to maybe correct a word, and then
(add-hook 'pre-abbrev-expand-hook 'fix-transposed-characters)
I now find out that pre-abbrev-expand-hook was obsoleted quite some time
ago, but it worked until I upgraded to emacs 28.2, and so I never noticed this obsoletion until now.
I still want to use this function, but it isn't clear to me how to use it.
I tried
(add-hook 'abbrev-expand-functions 'fix-transposed-characters)
but I was then rewarded with
Jim Diamond <JimDiamond@ns.sympatico.ca> writes:
A long, long time ago I started using a function (John Wiegley's
auto-correct function) which, up until Emacs 28, worked by defining a
function to maybe correct a word, and then
(add-hook 'pre-abbrev-expand-hook 'fix-transposed-characters)
I now find out that pre-abbrev-expand-hook was obsoleted quite some time
ago, but it worked until I upgraded to emacs 28.2, and so I never noticed
this obsoletion until now.
I still want to use this function, but it isn't clear to me how to use it. >> I tried
(add-hook 'abbrev-expand-functions 'fix-transposed-characters)
but I was then rewarded with
Hi,
It seems that your 'fix-transposed-characters' function does not require
any arguments and it might not be the case for functions in 'abbrev-expand-functions'.
Anyway, there is other obsolescence going on ('abbrev-expand-functions'
for example). So I think the new way of doing what you are trying to
achieve is the following:
(advice-add abbrev-expand-function :before (lambda () (message "foo")))
The before lambda has no arguments so maybe you could replace it by 'fix-transposed-charactersrCa but I don't understand what 'fix-transposed-characters' is doing, if the context will be what's
needed, etc. So try at your own risk.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 00:45:11 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
10 files (20,373K bytes) |
| Messages: | 264,053 |