Boruch-Baum / emacs-crossword

Play/Download crossword puzzles in Emacs
GNU General Public License v3.0
67 stars 4 forks source link

No-frame / simple UI mode #7

Closed ieure closed 3 years ago

ieure commented 3 years ago

First, thank you for writing this. I'm a big fan of both Emacs and crosswords, and have been missing something like this for a long time. I expect I'll be sending some PRs your way as I run into stuff.

I'm having a few issues with it so far, which are all centered around the way it uses frames and windows. I'm an EXWM user, so each Emacs frame corresponds to a different workspace, so starting crossword.el ends up creating a new workspace dedicated to it. My strong preference is that for any given Emacs command, it shows up in a window in the same frame as the one I invoked it.

I would also strongly prefer not to lose 2/3rds of my screen real estate to the clue lists. I can close them, but as soon as I enter a letter, they reappear.

So, in a nutshell, I'd like it if the entire game was playable in a single window, and the list of clues could be turned off.

Boruch-Baum commented 3 years ago

Hi Ian,

What you're asking for has been on my TODO list for a while; see all the TODO's by searching the .el file for string ";;; TODO'S:". If you're considering contributing code to the project, any of those would be welcome starts. The defcustom for the option you're interested in is probably already there in your copy: search for the commented line "crossword-display-clue-buffers" (line ~2675).

From a user experience standpoint, consider that many?/most? are accustomed to being able to browse the entire list of clues at any point of play, so some form of presentation of all the data needs to be a default option. Over the years pre-publication, I experimented with single-window implementations that included complete clue lists, but those versions always ended up too complicated and never produced reliably consistent, pretty, well-formatted output. Some were good enough for personal use, in the way only a parent can love a child, but not for publication. The only technical snag is that the current code gets the clue snippets at the bottom of the grid buffer from the other two buffers, including their auto-fill, faces, and properties. I'm have mixed feelings in response to your report of the clue buffer windows auto- re-spawning. The behavior doesn't respect the user's action, but it does maintain a sane default option, and mitigates cases of unintentional window deletes. Thus the defcustom.

Since you mention that you're an EXWM user, I'll also point out that one of the TODO's involves handling GUI events. I'm very much not a GUI user, so I wrote the program with emacs-nox in mind. Now that it's published for a general audience, the code does need to handle contingencies I don't usually consider when I write for personal use. See for instance the regression at lines ~900 to ~933 where code has been temporarily commented out because of a difference in frame behavior between GUI emacs versions 26 and 28. In Emacs 28, on window resize, that code changes the selected window from the mini-buffer window to the grid window, which is onerously unacceptable for someone trying to 'quit' - they need to notice what happened, and then manually navigate back to the mini-buffer. In emacs 26, the commented code works great, and auto-magically re-formats all paragraphs as windows are re-sized.

Another contribution that your perspective can bring is how to define complicated face-specs for different environments and default color backgrounds. I've seen the code for that somewhere, and need to find it and apply it for this project.

Even if you don't end up submitting PR's, feedback and code review are welcome.

Regards.

-- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0