rougier / nano-emacs

GNU Emacs / N Λ N O - Emacs made simple
GNU General Public License v3.0
2.52k stars 195 forks source link

Suggestions partially cut off when using ispell #38

Closed dixius99 closed 2 years ago

dixius99 commented 3 years ago

Not exactly sure I would call this an "issue", but I've been using parts from nano-emacs, and when I use ispell, the bottom row of suggestions is cut off around half way. It doesn't matter how many rows of suggestions are provided. It's always the last row that is partially cut off. I can still read all of the suggestions, so not a big deal, but I was wondering if there is a setting I could change to have all of the suggestions display.

I don't use all of the modules, so maybe this wouldn't happen if I used some of the others? These are the ones I'm using:

Here is a screen of what I see:

Screen Shot 2020-12-24 at 3 02 33 PM
rougier commented 3 years ago

Can you try to set window-resize-pixelwise to t in you config? I think the reason for the cut line is the vertical spaces I added in the header line (see modeline code).

dixius99 commented 3 years ago

Hmm... (setq window-resize-pixelwise t) didn't seen to change anything for me. Interestingly, it also only appears to be the first typo. All subsequent typos seem to have enough space to show the last row of suggestions. I'm guessing it has something to do with something else in my init.el file that is interfering with the display, but can't think of what that might be. At any rate, I'm sure it is something I can live with.

Edit: actually, I just tested, and it looks like this happens for me even when I just run emacs -q -l nano.el, so maybe it does have something to do with NANO Emacs??

Screen Shot 2020-12-25 at 3 14 22 PM
rougier commented 3 years ago

I just tested and I got the same (first and second typo). If you remove the spaces from modeline the problem dissappears but the modeline is smaller. I could use a box instead of spaces but then I cannot have the white outline around the header line.

dixius99 commented 3 years ago

So I'm not sure what to do with this issue. I feel that it's not a problem for the vast majority of the time, and also that it's something you might try to address at some time down the road, if inspiration strikes. Should I close the issue?

rougier commented 3 years ago

You can leave it open as a reminder this is to be fixed. And thank for the report.

lduktus commented 3 years ago

I am little bit late to this. As I am pretty new to emacs I don't think that I am really able to contribute something, however I had some thoughts I wanted to share (not sure it is the right way to do it or if I should open a new issue for this one). Maybe it would be interesting to add a functionality to nano-emacs to disable the Modeline for certain windows? Another aspect would be to add some functionaity to control where certain types of windows spawn? I know there is popwin, which does something similar. After reading a little bit into the topic, it does seem kind of "hacky". Imo this would make the whole experience a little bit more streamlined. However not sure if it is to much work or "out of scope". I just wanted to share the idea.

Thanks for the great work, it was and is also very helpfull for learning some elisp and emacs in general.

rougier commented 3 years ago

Thanks for the suggestion. Best would be to open a new issue with these suggestions such that we can start a discussion.

lduktus commented 3 years ago

You can try to customize ispell-choices-win-default-height. At least to me it seems to work.

aaronjensen commented 2 years ago

For me, this https://github.com/aaronjensen/nano-modeline/commit/e806dea976a81639b14d13f83f9194619fbf7d71 plus setting ispell-choices-win-default-height to 3 fixed it. It's not perfect though, I intended to hide the header line entirely but that didn't work. I'm going to try something else.

I'm doing this now (this uses my defadvice macro, but you get the idea):

  (aj-defadvice aj/get-buffer-create-ispell (buffer-or-name &rest args)
    :after #'get-buffer-create
    "Disable header line for ispell buffers."
    (when (eq buffer-or-name ispell-choices-buffer)
      (with-current-buffer ispell-choices-buffer
        (setq-local header-line-format nil))))
rougier commented 2 years ago

@aaronjensen I think this might be the best we can do. Could you make a pull request at https://github.com/rougier/nano-modeline? (after having signed the copyright form at https://www.gnu.org/software/emacs/manual/html_node/emacs/Copyright-Assignment.html)

aaronjensen commented 2 years ago

@rougier I've got my copyright assignment already, but I don't know when I'll be able to open a PR for this. I use a fork of nano-modeline now-a-days. Feel free to use the above code or any derivative. Thank you.

rougier commented 2 years ago

I can wait for your PR or I'll integrate your code, as you prefer. Just tell me.

aaronjensen commented 2 years ago

Please feel free to integrate my code. Thank you!

rougier commented 2 years ago

Done!