Replies: 2 comments
-
|
Thank you for this request. You can use the following snippet to directly check the last word and play a sound: (add-hook 'post-self-insert-hook #'jinx-check-last)
(defun jinx-check-last ()
(when (and
;; Check if Jinx is enabled
(bound-and-true-p jinx-mode)
;; Check after SPC or RET
(or (eq last-command-event ?\s)
(eq last-command-event ?\n)))
;; Check last word
(when (ignore-errors
(jinx--force-overlays (save-excursion (backward-word) (point))
(1- (point)) :check t))
;; Play sound with (ding)
(ding)))) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Works great, thank you! I was attempting to do something similar but didn't realize Jinx had a way to explicitly force calculating misspellings. Didn't know about ignore-errors, too (love how you use it as a true/false thing, it'd be false when an error happens, which is when there's no misspelling-I'm an elisp newbie, so haven't seen that done before). Thanks again. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm a visually-impaired user who uses emacs with a screen reader. I really like the reported speed of Jinx, and the interface is pleasingly minimalistic, but the highlighting/overlays are not useful for me. Instead, I would like there to be a sound that plays right after I type a misspelled word-when I press space or enter, for instance.
I was experimenting with setting this up myself. the problem I ran into is that I type decently fast (12-13 characters a second-ish on average) and Jinx seems to refresh on a timer of 0.2 seconds. this means that, if I have a window of about 5-6 characters and check for any new overlays that Jinx has added in those preceding characters, that would work most of the times-but in cases where I write lots of small words quickly ("the fox was hard at work") the checking is going to be two-three words behind. Also, a sound delayed by 0.2 seconds (in the worst case) does feel like a perceptual delay.
I think Jinx prefers to batch-detect misspelled words in a specific region, and add overlays all at once, rather than continuously detecting as I type, so I don't quite know if this feature would be a reasonable request. Are there other avenues I can explore? can I try to bind to libenchant directly myself, for this very specific use case?
thank you!
Beta Was this translation helpful? Give feedback.
All reactions