unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ivan Kanis <ivan@kanis.fr>
To: Glenn Morris <rgm@gnu.org>
Cc: Eli Zaretskii <eliz@gnu.org>,
	Emacs Development List <emacs-devel@gnu.org>
Subject: Re: fill length of visual line mode
Date: Fri, 03 Oct 2014 22:39:17 +0200	[thread overview]
Message-ID: <87vbo0ga6i.fsf_-_@kanis.fr> (raw)
In-Reply-To: <f6sij6pj2l.fsf@fencepost.gnu.org> (Glenn Morris's message of "Thu, 02 Oct 2014 11:50:10 -0400, Thu, 02 Oct 2014 18:16:48 +0300")

October, 02 at 18:16 Eli wrote:

>> From: Ivan Kanis <ivan@kanis.fr>
>> 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



  reply	other threads:[~2014-10-03 20:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02  7:48 fill length of visual line mode Ivan Kanis
2014-10-02 15:16 ` Eli Zaretskii
2014-10-03 21:19   ` Johan Bockgård
2014-10-04  7:07     ` Eli Zaretskii
2014-10-04 17:16       ` Johan Bockgård
2014-10-02 15:50 ` Glenn Morris
2014-10-03 20:39   ` Ivan Kanis [this message]
2014-10-03 21:20     ` Stefan Monnier
2014-10-04  9:58       ` Harald Hanche-Olsen
2014-10-04 15:45         ` Drew Adams
2014-10-04 14:23       ` Ivan Kanis
2014-10-04 22:25         ` Stefan Monnier
2014-10-05  7:59           ` Ivan Kanis

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87vbo0ga6i.fsf_-_@kanis.fr \
    --to=ivan@kanis.fr \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rgm@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).