wxMaxima-developers / wxmaxima

A gui for the computer algebra system Maxima built with wxWidgets
https://wxMaxima-developers.github.io/wxmaxima/
Other
476 stars 98 forks source link

Unbreakable spaces in wrong places make code sharing difficult #1296

Closed knuesel closed 4 years ago

knuesel commented 4 years ago

When writing code in wxMaxima, pressing Shift+space makes an unbreakable space. This happens often by mistake, for example when writing a: 1; if the finger stays a bit too long on the Shift key for :.

wxMaxima replaces these characters with normal spaces so the code works when executed (this was made to fix https://github.com/wxMaxima-developers/wxmaxima/issues/1031). However this doesn't help when code is shared with other applications.

Here's my use case: I use wxMaxima to prepare code for Moodle STACK questions (https://github.com/maths/moodle-qtype_stack). When the code is working in wxMaxima, I copy it to the STACK question editor (either from the GUI, or directly from the .wxm file). I then get strange behavior in STACK because of the unbreakable spaces.

I think the solution is to remove the Shift-space shortcut. It's much too easy to press it by mistake. If a shortcut for unbreakable spaces is necessary, it should be one that is difficult to press by mistake.

KubaO commented 4 years ago

This is a valid usability concern. I consider it a usability bug.

The short-term workaround is to add a configuration option that disables this shortcut. The long term solution is to provide fully configurable shortcuts.

KubaO commented 4 years ago

If there is anything you can think of that would improve the usability and usefulness of wxMaxima to your project, please file additional issues. I believe that it’s such a worthwhile effort that I’d like wxMaxima to make your life as easy as possible.

To that end, I envision that wxMaxima could have a plug-in that provides API integration with your platform, so that the manual copy-paste process could be skipped. Perhaps more cell types (configurable by the user) could be added to make it easier to keep more parts of the assessment natively in wxMaxima.

I’m not offering any time to work on this yet, since other issues and architectural improvements are needed first, that will take a few months for me at least. But it’ll be good to hear what ideas you may have, to keep them in the back of my mind as other changes are made.

2 juni 2020 kl. 10:22 fm skrev Jeremie Knuesel notifications@github.com:

 When writing code in wxMaxima, pressing Shift+space makes an unbreakable space. This happens often by mistake, for example when writing a: 1; if the finger stays a bit too long on the Shift key for :.

wxMaxima replaces these characters with normal spaces so the code works when executed (this was made to fix #1031). However this doesn't help when code is shared with other applications.

Here's my use case: I use wxMaxima to prepare code for Moodle STACK questions (https://github.com/maths/moodle-qtype_stack). When the code is working in wxMaxima, I copy it to the STACK question editor (either from the GUI, or directly from the .wxm file). I then get strange behavior in STACK because of the unbreakable spaces.

I think the solution is to remove the Shift-space shortcut. It's much too easy to press it by mistake. If a shortcut for unbreakable spaces is necessary, it should be one that is difficult to press by mistake.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

gunterkoenigsmann commented 4 years ago

The unbreakable space problem was fixed very long ago. I believe, though, that there was no maxima release after that so the windows installer doesn't contain the fix, still.

knuesel commented 4 years ago

@gunterkoenigsmann is this: https://github.com/wxMaxima-developers/wxmaxima/commit/8e9746d2b49f1b994b5050e0db029bac5c4e21ba the fix you have in mind? I don't think it helps in my case, since the code with unbreakable spaces is executed outside of wxMaxima.

@KubaO note that I'm just a user of STACK, not a developer, but I'm sure @sangwinc will appreciate your interest!

Configurable shortcuts would be very nice! But don't you think the default shortcut should be changed here? What about Alt+Shift+space?

KubaO commented 4 years ago

https://xkcd.com/1172/ is all I'm gonna say. That shortcut has been there for a while. Changing it outright may not be all that great of an idea.

On Tue, Jun 2, 2020 at 4:04 PM Jeremie Knuesel notifications@github.com wrote:

@gunterkoenigsmann https://github.com/gunterkoenigsmann is this: 8e9746d https://github.com/wxMaxima-developers/wxmaxima/commit/8e9746d2b49f1b994b5050e0db029bac5c4e21ba the fix you have in mind? I don't think it helps in my case, since the code with unbreakable spaces is executed outside of wxMaxima.

@KubaO https://github.com/KubaO note that I'm just a user of STACK, not a developer, but I'm sure @sangwinc https://github.com/sangwinc will appreciate your interest!

Configurable shortcuts would be very nice! But don't you think the default shortcut should be changed here? What about Alt+Shift+space?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wxMaxima-developers/wxmaxima/issues/1296#issuecomment-637776416, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJRHW5LKGJ7V4X5VALTVLTRUVLNRANCNFSM4NQYZR7A .

knuesel commented 4 years ago

Haha I actually thought about this comic when writing my previous comment!

Changing the shortcut will certainly annoy some users. But keeping it will annoy other users, so the question is which is worse? Considering how this can introduce bugs that are particularly subtle and confusing, I bet it would cause less grief to change the shortcut... But of course it's up to you!

KubaO commented 4 years ago

I think this could default to a new shortcut when a configuration is generated from scratch. For existing configurations, a flag would be added to retain old shortcut, and the flag would be also available as a setting in the config dialog.

gunterkoenigsmann commented 4 years ago

If the problem is code that is copied from wxMaxima to somewhere else perhaps the easiest fix would be automatically replacing non-breakable spaces by ordinary spaces when copying except when copying in wxm format (the wxm format is only used when wxMaxima copies text to wxMaxima).

knuesel commented 4 years ago

@gunterkoenigsmann thanks for the fix. This won't work when code is copied directly from the .wxm file but it solves the problem in the case of copy-and-paste from the GUI.