all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Stephen Berman <stephen.berman@gmx.net>, 3413@emacsbugs.donarmstrong.com
Subject: bug#3413: 23.0.94; ispell choices buffer display problem
Date: Fri, 29 May 2009 16:43:25 +0200	[thread overview]
Message-ID: <4A1FF48D.5020909@gmx.at> (raw)
In-Reply-To: <87octcj1i4.fsf@escher.local.home>

 > 1. emacs -Q
 > 2. Type `thre threee'
 > 3. Type `C-x 2' twice.  Now the frame has three windows stacked
 >    vertically, in the lowest window (window-height) returns 18, in each
 >    of the two upper windows (window-height) returns 9.
 > 4. Make either of the two upper windows the selected window, and in that
 >    window make the text typed in step 2 an "active region" (select with
 >    the mouse or type `C-a C-SPC C-e').
 > 5. Type `M-$'
 > => The selected window splits vertically, in the lower one of these,
 >    `thre' is highlighted, the upper window contains a two-line high
 >    *Choices* buffer displaying 10 corrections for `thre'.
 > 6. Type `SPC'
 > => In the lower window now `threee' is highlighted, the *Choices*
 >    buffer in the upper window displays one empty line, and is
 >    unscrollable.
 >
 > If at step 4 the window with (window-height) 18 is selected, then step 5
 > is the same, but in step 6, the *Choices* buffer is five lines high and
 > shows 28 alternatives for `threee'.

It's because of the obscure construct below from `ispell-command-loop'
which has max-lines equal 0 in the small window case and 11 in the large
window case.  So choices simply don't get inserted into the buffer in
the small window case.

(defun ispell-command-loop (miss guess word start end)
[...]
	;; ensure 4 context lines.
	(max-lines (- (ispell-adjusted-window-height) 4))
[...]
       (while (and choices
		  (< (if (> (+ 7 (current-column) (length (car choices))
			       (if (> count ?~) 3 0))
			    (window-width))
			 (progn
			   (insert "\n")
			   (setq line (1+ line)))
		       line)
		     max-lines))

I don't have the slightest idea what this is necessary for and suppose
that the calculations are off by one or two anyway.  Maybe the reason is
that choices buffers can't (or shouldn't) be scrolled.  You can try to
replace the binding by something like

	(max-lines (- (ispell-adjusted-window-height) (if guess 4 0)))

but this just slightly improves things.

martin





  reply	other threads:[~2009-05-29 14:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28 22:39 bug#3413: 23.0.94; ispell choices buffer display problem Stephen Berman
2009-05-29 14:43 ` martin rudalics [this message]
2014-12-25 10:36 ` martin rudalics
2015-01-02 16:21   ` Stephen Berman
2015-01-03 17:17     ` martin rudalics
2015-01-03 18:20       ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A1FF48D.5020909@gmx.at \
    --to=rudalics@gmx.at \
    --cc=3413@emacsbugs.donarmstrong.com \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.