greghendershott / racket-mode

Emacs major and minor modes for Racket: edit, REPL, check-syntax, debug, profile, packages, and more.
https://www.racket-mode.com/
GNU General Public License v3.0
682 stars 93 forks source link

Customization of unicode input method #719

Closed bkc39 closed 2 months ago

bkc39 commented 2 months ago

Make the keybindings customizable via user-defined functions. Bindings inherit from racket-unicode

this should be tested as some of the code and docs were written by LLM, but it seems to work well enough for me

(racket-custom-unicode-add-tweaks!
 (remove-suffix " ")
 (prefix-with "\\"))
(racket-custom-unicode-input-method-enable) ;; now \alpha maps to unicode alpha

Partially addresses #718

greghendershott commented 2 months ago

Unfortunately for license provenance reasons I'm unable to merge code sourced by an LLM.

I understand some (maybe even most?) you wrote by hand. That's why I wanted to mention this as soon as I noticed -- before you put much more work into it. :disappointed:

I really appreciate you taking the time to work on this. I feel badly. I'm definitely not suggesting you did anything wrong; just that it wouldn't work for this project.


In any case, I really did have in mind what I'd mentioned: Borrowing the agda2-input code almost verbatim. Because I've grown to appreciate its approach. Also the provenance would be clear.

[In fact: I wonder if we could recommend people install the agda package; it doesn't seem to depend on other packages, so it's pretty light. And we'd literally use its code, that way. And we could supply an initial configuration of it, equivalent to our status quo. Something like that.]

greghendershott commented 2 months ago

p.s. Since I seem to have particular ideas about this, maybe it would be better if I worked on this, at least to do an overall "first draft" commit? And then I'd welcome your review/contributions against that baseline, if you wanted?

It doesn't seem fair to have you try to chase down some idea if I'm not being clear about it. And if you want to contribute using some approaches, but not anothers, of course that's valid, its up to you not me!

bkc39 commented 2 months ago

I really appreciate you taking the time to work on this. I feel badly. I'm definitely not suggesting you did anything wrong; just that it wouldn't work for this project.

No worries. I would say maybe add this to your contributing page. I do nearly all programming with some LLM assistance these days and I'm sure I'm not the only one. If this is going to be your policy I would make that more clear to potential contributors. The thought that there might be some license issues never occurred to me.

bkc39 commented 2 months ago

p.s. Since I seem to have particular ideas about this, maybe it would be better if I worked on this, at least to do an overall "first draft" commit? And then I'd welcome your review/contributions against that baseline, if you wanted?

It doesn't seem fair to have you try to chase down some idea if I'm not being clear about it. And if you want to contribute using some approaches, but not anothers, of course that's valid, its up to you not me!

Yea this seems good. I'll keep an eye out.

greghendershott commented 2 months ago

No worries. I would say maybe add this to your contributing page. I do nearly all programming with some LLM assistance these days and I'm sure I'm not the only one. If this is going to be your policy I would make that more clear to potential contributors. The thought that there might be some license issues never occurred to me.

Good point! I'll add a note about that.

It hadn't occurred to me, yet, to need that, because people using LLM feels so recent to me. Hey I'm getting to be an old fart.

With this project being GPL licensed, IIUC it can accept more than other projects (e.g. MIT or BSD into GPL is fine, just not the reverse) -- but not everything. So need to know the provenance.


Plus that way I can give credit, as a comment in the source code. Or, as in this case, I can try to contact the agda2 folks and ask (even if strictly I don't need to ask) how they'd prefer me to reuse it, and try to work with their preference.

But again, maybe these are old fart attitudes. :)

Anyway: Thank you again for making the effort to contribute and thank you for your understanding!