Open DoctorSubtilis opened 5 years ago
Thank you. I will try: but in Kubuntu 18.04 how should I do? Add a PPA?
I fixed the broken link in my last comment and added a link to installation instructions. Sorry about that. We don't have a working PPA these days.
Installed the 0.95.6: but unfortunately the problem is not solved. Nothing has changed. I believe that you should add this as new feature (enhancement).
Thank you
Just tried it here in a terminal window and I can confirm that this does not work as expected. Thomas will have to take a look at it, but it looks more like a bug than an enhancement to me.
I'm on 0.95.7 and I've got the same issue, i.e.
(abbrev
is not expanded.
Mayn thanks!
Hmm. I think this is related to what is considered part of a word. By default, Trigger when typed as part of a word
is disabled in the Abbreviation settings. So if (
is considered to be part of a word, then the abbreviation won’t trigger. I tried checking that option and AutoKey started expanding the Phrase even after typing (abbrev
. So clearly (
is seen as part of a word, which is arguably odd. AutoKey uses a Python regular expression to do this character classification.
Let’s dig in the code a bit:
https://github.com/autokey/autokey/blob/86e7a85d723753143f78e0684290a362bf6789c6/lib/autokey/model.py#L110-L121
The last line quoted references this static default value:
https://github.com/autokey/autokey/blob/86e7a85d723753143f78e0684290a362bf6789c6/lib/autokey/model.py#L35
The Python documentation https://docs.python.org/3/library/re.html says this about []
and \w
:
[] Used to indicate a set of characters.
and
\w For Unicode (str) patterns:
Matches Unicode word characters;
this includes most characters that can be part of a word in any language,
as well as numbers and the underscore.
If the ASCII flag is used, only [a-zA-Z0-9_] is matched.
During experimentation I tried to set a different set of characters as 'word characters', by overwriting the Trigger on:
field. I think [^\W()]
should work. But while trying that out, the GTK GUI broke. See #315. If that is resolved, it may be possible to just use [^\W()] or similar, which will exclude ()
from the set of characters seen as part of words.
Good news. In KDE Neon, Plasma 5.17, now if I set an abbr to expand by "all non-word" I can expand (abbr -> (abbreviation.
Eventually it works!
@DoctorSubtilis You are using KDE Neon with Plasma 5.17? Great! Can you please try the Qt5 GUI once? It crashes on my systems somewhere in automatically generated code that initializes a GUI class and I have no idea whether this is caused by my system or is a general issue with new KDE/Qt versions. If you try, please report failure or success back in #313
I see only autokey-gtk in synaptic... But why you ask me? Can't you do it yourself, in virtualbox i.g.?
Last times I tried it was unbearably slow (systemd even timed out starting jobs during boot, etc…). Well I found the cause for #313, so don’t mind.
These last times abbrevation after '(' or any other punctuation sign, doesn't work any more: or rather, it works one time: if you re-save that item (that abbreviation), it works, but only for one time.
Very strange...
Classification:
Feature
Reproducibility:
Always
Version
AutoKey version: Gtk 0.95.1 (also occurs in 0.95.6 with GTK and Qt front ends)
Installed via: (PPA, pip3, …): Kubuntu package
Linux Distribution: Kubuntu 18.04
Summary
Abbreviations don't expand after the «'», or the «(».
It would be very useful (in particular in some languages)
Steps to Reproduce (if applicable)
Expected Results
Actual Results