emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: flyspell + longlines: hang/wait


From: David Reitter
Subject: Re: flyspell + longlines: hang/wait
Date: Tue, 1 Nov 2005 19:33:31 +0000

On 1 Nov 2005, at 18:59, Kim F. Storm wrote:

Thanks for the explanations.

The next step would be to allow for wrap-column to follow the width
of the window (probably easy)

What do you mean?

analogous to longlines-wrap-follows-window-size.

The following does the job for me:

(add-hook 'window-size-change-functions
          (defun follow-size (frame)
            (set-window-wrap-column nil (window-width) t)))


I would imagine this "follow window size" mode is how most people would use it.
One could allow for something like

(set-window-wrap-column nil 'window-width t)

to indicate that lines should end at the maximal length in the window, whatever that is.


 It supports variable width fonts -- it is just the wrap-column that
is set in units of the default frame font.

You're right. Works like a charm!

This can be done in lisp - there are packages that does this for
continuation lines already.  Can't remember its name right now.
The relevant function to use is "vertical-motion".

OK, but how to keep track of the horizontal cursor position?
The current previous-line and friends (actually, line-move-1) doesn't really work well for variable-width fonts, because it always tries to jump to the same character position, which can be far to the left or to the right. For example, position the cursor at the end of line 1 in the following example, then go down.

1: iiiiiiiiii*
2: OOOOOOOOOO*

You end up at the end of line 2, and not after the 4th or 5th O, as you would expect in a variable-width font setting.

By the way, I just noticed that with window-wrap-column turned on (and not wrapping anything in the above two lines), I cannot jump down from 1 to 2 - the point always ends up in the line afterwards. Let me know if I should investigate further in case you can't reproduce.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]