[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fill length of visual line mode
From: |
Ivan Kanis |
Subject: |
Re: fill length of visual line mode |
Date: |
Fri, 03 Oct 2014 22:39:17 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux) |
October, 02 at 18:16 Eli wrote:
>> From: Ivan Kanis <address@hidden>
>> Date: Thu, 02 Oct 2014 09:48:12 +0200
>>
>> I just enabled visual line mode today. I have started using it to
>> display gnus article. I noticed that the fill happens at the width of
>> the Emacs window. I set fill-column to 70 and I was expecting it to wrap
>> there.
>
> That's not how word-wrap was designed and implemented. It works more
> like Web browsers, i.e. it wraps at the window edge.
It's too long for me at work where I use a tiling window manager and
wide screen.
>> There is a hack [1] by James Wright to make it work by expanding the
>> right margin of the buffer's window.
>>
>> I don't feel it should be so complicated to customize this behavior.
>>
>> Would it be OK to code wrap at fill-column?
>
> Not sure what you mean by your question. Are you asking whether
> patches to implement the wrap at fill-column will be accepted? If so,
> I'm quite sure the answer is YES.
It is what I meant.
October, 02 at 11:50 Glenn wrote:
> The code you quote seems mostly OK, but I don't know who wrote it, so
> I can't just install it, for copyright reasons.
>
> If someone can rewrite it and submit a patch, or if the original author
> can submit the patch, I'd be happy to install the feature.
It just boils down to setting the right margin. I have to hide the right
fringe or it looks wrong. FWIW here is how I cobbled for gnus article.
(defun ivan-gnus-hack-visual-line-length ()
"Set visual line length by expanding the right margin of the
buffer’s window."
(let ((window (selected-window)))
(select-window (car (get-buffer-window-list gnus-article-buffer)))
(set-window-margins nil 0 (- (window-width) 80))
(set-window-fringes (selected-window) 8 0)
(visual-line-mode)
(select-window window)))
(add-hook 'gnus-article-prepare-hook 'ivan-gnus-hack-visual-line-length)
It just feels hackish and wrong. The right thing I feel is to use
fill-column.
Ivan
--
You must've hit the wrong any key.
-- BOFH excuse #52