New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XP-mode freezes conflicting with auto-composition-mode #523
Comments
That doesn't sound good. Unfortunately I can't seem to reproduce this. In fact I frequently do the same steps, when writing various In my case
|
p.s. Another thing you could try is:
Note: C-g might work right away, but you might need to press it multiple times over a few seconds until it has an effect. |
Thanks for suggestions, I really had a lot of redundant modes there, e.g. I updated all packages before submitting the issue, I have the latest commit you mentioned. I found the problem, disabling I have this in my config: ;; On MacOS due to retina display font should be bigger.
(if (eq system-type 'darwin)
(set-face-attribute 'default nil :font "Fantasque Sans Mono" :height 120)
(set-face-attribute 'default nil :font "Fantasque Sans Mono" :height 110))
(let ((alist `((?& . ,(regexp-opt '("&&")))
(?* . ,(regexp-opt '("*/")))
(?| . ,(regexp-opt '("|||>" "||>" "||" "|>")))
(?: . ,(regexp-opt '("::")))
(?= . ,(regexp-opt '("===" "==>" "==" "=>>" "=>" "=<<" "=/=")))
(?! . ,(regexp-opt '("!==" "!=")))
(?> . ,(regexp-opt '(">=>" ">=" ">>=" ">>-" ">>" ">->" ">-")))
(?- . ,(regexp-opt '("->>" "->" "-->" "-<<" "-<")))
(?< . ,(regexp-opt '("<|||" "<||" "<|>" "<|" "<==" "<=>" "<=<" "<=" "<!--" "<>" "<->"
"<--" "<-<" "<-" "<<=" "<<-" "<<" "<~>" "<~" "<~~")))
(?/ . ,(regexp-opt '("/**/" "/*" "//")))
(?~ . ,(regexp-opt '("~>" "~~>" "~~"))))))
(dolist (char-regexp alist)
(set-char-table-range composition-function-table (car char-regexp)
`([,(cdr char-regexp) 0 font-shape-gstring])))) As a workaround to use ligatures in emacs. Ligatures are not supported out of the box, this seemed as one of the cleanest workarounds I could find. Exactly this line is causing the problem: (?* . ,(regexp-opt '("*/"))) presumably because of the (let ((alist `((?* . ,(regexp-opt '("*/"))))))
(dolist (char-regexp alist)
(set-char-table-range composition-function-table (car char-regexp)
`([,(cdr char-regexp) 0 font-shape-gstring])))) |
Thanks for the detective work! I looked at Before I go down that rabbit hole, I have a guess. Could you try one more experiment, please? What if you change the value of |
That's a great guess! It stops freezing after I change it to
|
And I want to mention that it is not a problem for me right now. I like more |
Thanks for trying that experiment and I'm glad you have a configuration that works well for you. I'll leave this open for now (maybe re-title it). I'm curious to understand the conflict between Thanks again for your help! |
A small update on the issue: |
Thanks for the follow up. That comment linked to some mu4e code doing The Display Property is a pretty powerful low-level Emacs display engine feature. It seems this is a problem with that feature being able to handle ligature character composition. It seems unlikely I could fix this in Racket Mode. I'm not even sure how to attempt to work around, or avoid it. I think I'd need to detect such a char sequence (but not sure how, reliably) and display something else (but not sure what, and how to know what). Having said that, I hate saying "well that's not my problem" and I'm curious to learn more. So I'll try to explore more as/when I have time. Meanwhile, do you think I should:
|
There are 5 ways to enable ligatures in Emacs, no particular one seems completely bugless. I think it would be hard to maintain detection of whether "ligature mode" is enabled for all of them. I would just add a warning to "Troubleshooting" or similar section as you mentioned. |
Here's the most-minimal recipe I've been able to find so far: (progn
(set-char-table-range composition-function-table
?*
`([,(regexp-opt '("*/")) 0 font-shape-gstring]))
(let ((ov (make-overlay (point) (1+ (point)))))
(overlay-put ov 'after-string "for*/list"))) This reliably freezes e.g. Emacs 25.2.2. [Although I test a variety of Emacs versions in CI, for day-to-day normal work I'm boring and just use the Emacs 25.2.2 default in Ubuntu 18.0.4.] From what I've read this will freeze even Emacs 27.2 -- but it might work fine in the current Emacs snapshot 28.0.50, which will become Emacs 28.1. Meanwhile I agree the best I think I can do is warn about this in the configuration documentation. (In theory I could scan |
I built Emacs from source (commit ee3a4e3d1be656cd0df71ed197dc5f102556f0e0 from a few hours ago), ran it with So some good news is that it looks like this will be fixed for Emacs 28.1. |
Docs updated for the info file supplied with the package, as well as the HTML version: https://www.racket-mode.com/#Ligatures I guess I'll leave this issue open, for now, and in fact "pin" it here in GitHub issues in the hope that helps other people find it. |
I realized I should close this issue. I did document the situation, and, the only possible fix is really for folks to use Emacs 28. But I'll still leave it "pinned" for visibility. |
Reproduce:
RktX
symbol appear|
is cursor from:to:
It completely freezes on my machine.
The text was updated successfully, but these errors were encountered: