shx-for-emacs icon indicating copy to clipboard operation
shx-for-emacs copied to clipboard

Incompatibility with dap-ui-repl-mode

Open jumper047 opened this issue 1 year ago • 11 comments

I encountered an issue with shx-mode and dap-mode REPL - on "enter" press it inters "^M" instead of sending string to interpreter. This issue also was opened in dap-mode repo - https://github.com/emacs-lsp/dap-mode/issues/518

jumper047 avatar Nov 22 '22 08:11 jumper047

This seems to be similar to #25, where another mode wants to have control of how input is sent.

(More than you want to know: the current heuristic (which unfortunately doesn't address this issue) is that shx-mode will not auto-activate unless RET is bound to comint-send-input (i.e. default behavior) but I think I should also have it check the value of comint-input-sender to ensure shx is a good neighbor.)

The reason why toggling shx off doesn't fix this is because shx tries to set comint-input-sender back to its default value, i.e. (setq-local comint-input-sender (default-value 'comint-input-sender)). But this "default" is not the same as the value set by dap-ui-repl-mode.

riscy avatar Dec 22 '22 20:12 riscy

BTW maybe it's worth to add a variable like shx-ignored-modes?

jumper047 avatar Dec 22 '22 20:12 jumper047

You're probably right. I've been putting that off because I'm hesitant to maintain a laundry list of incompatible modes (mostly REPLs) but maybe I should give in.

riscy avatar Dec 22 '22 20:12 riscy

I suppose your heuristics is good, I thought about variable as workaround for cases like that - to ease temporarily fixing issue until proper fix will be released

jumper047 avatar Dec 22 '22 20:12 jumper047

Another thing - I think there is another non-expected behavior here, because the issue still exists even if shx mode was disabled. Should advice be deactivated on disabling mode?

jumper047 avatar Dec 22 '22 20:12 jumper047

Are you testing on the develop branch? (Which I appreciate, btw.)

riscy avatar Dec 22 '22 20:12 riscy

Do you mean emacs dev branch or something else? If you are talking about emacs then it's yes and no - it was dev at the moment I compiled it (last spring I suppose), and I don't upgraded it since then.

jumper047 avatar Dec 22 '22 22:12 jumper047

The develop branch of shx -- but I just merged the change to shx into the mainline branch, so hopefully the non-expected behavior is resolved?

riscy avatar Dec 23 '22 01:12 riscy

oops, sorry, it's rather uncommon in emacs packages world:) still not checked the fix though, sorry - real life(, but I will check it on weekend

jumper047 avatar Dec 23 '22 14:12 jumper047

No problem, I appreciate you even being available to confirm. :) If you don't get a chance, that's alright too of course.

riscy avatar Dec 23 '22 19:12 riscy

some time passed Checked the fix and can confirm that it works. Thank you!

jumper047 avatar Feb 21 '23 18:02 jumper047