all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: refill paragraph but visually (like visual-line-mode)?
Date: Mon, 15 Oct 2018 11:56:57 -0400	[thread overview]
Message-ID: <jwvsh17wac3.fsf-monnier+gmane.emacs.help@gnu.org> (raw)
In-Reply-To: 87y3azpn61.fsf@portable.galex-713.eu

> The current problem of visual-line mode and why I almost never use is up
> to three reasons:
>
> First of all, the text ends wrapped at the right edge of window, even if
> that means quite long lines (such as more than 66 columns: 111 is the
> default with my default current font), which is more a pain of reading
> (eye must move more, stuff to see are more distant from each others).
> Oddly I found nor in searching variables/functions nor in documentation
> anything to limit automatic visual word-wrapping to something such as
> 66, 72, or something more comfortable.

You might like the visual-fill-column packaqe which widens the margin
such that your 111-wide window only has 66-wide columns (sounds like
a big waste to me: I'd rather make the window narrower and use the
remaining space for something else, but to each his own).

> In second stance, when reading source code, and this is normally the
> case I’d find word-wrap the most useful, the wrap just happens to
> continue the logical line from the *beginning* of the next visual line.
> So indentation is broken, and it hard to correctly read afterwards.  I
> guess this may be complicated to implement, but as emacs auto indent
> works most of time, wouldn’t there a way to put visual indent too?

You might like the adaptive-wrap package for that.
[ Here again, I'd suggest to shorten the source lines as a better
  solution, because long lines in source code are just an abomination,
  but admittedly if it's not your code adaptive-wrap-prefix-mode might
  be helpful.  ]

> And last but not least: if the text (usually human text) I’m reading is
> already wrapped, by fill-paragraph for instance, I end up with pairs of
> filled long-lines + very short lines (lines end) which is really ugly:
> word-wrap only wraps, but not refill.  I’d like an option or mode that
> puts at the end of the visual line the beginning of the next logical
> line, just as fill-paragraph do, but only visually, and keeping an
> (invisible) trace of the original/logical newlines.  Maybe while filling
> at fill-column behind the scenes.  So I stop hitting M-q
> (`fill-paragraph') repetedly while word-wrap is on (isn’t this what
> word-wrap is supposed to stop?) to make text readable.

I don't have a package to suggest here :-(
Hopefully, one exists, tho.

There's `refill-mode` which provides a related feature, but it just
does the M-q for you while you edit the text, which won't help you if
you're only reading the text.

The main difficulty here is that to do a proper refill, you need to find
the paragraph boundaries and there's no reliable rule for that (only
heuristics and conventions), so doing it 100% automatically tends to
come with warts and all (which is why refill-mode only performs the
refill for the paragraphs which you do edit, for example).

But I guess if you do it without modifying the buffer (i.e. only using
features which affect the display but not the buffer's contents), the
warts would at least be "harmless".


        Stefan




  parent reply	other threads:[~2018-10-15 15:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15  9:35 refill paragraph but visually (like visual-line-mode)? Garreau, Alexandre
2018-10-15 15:21 ` Eli Zaretskii
2018-10-17 10:54   ` Garreau, Alexandre
2018-10-17 15:52     ` Joost Kremers
2018-10-17 16:09       ` Eli Zaretskii
2018-10-17 16:00     ` Eli Zaretskii
2018-10-17 20:53       ` Garreau, Alexandre
2018-10-20  8:31         ` Eli Zaretskii
2018-10-15 15:56 ` Stefan Monnier [this message]
2018-10-16  2:26   ` detect sentence/paragraph ending (was: refill paragraph but visually (like visual-line-mode)?) Van L
2018-10-16  2:36   ` refill paragraph but visually (like visual-line-mode)? Stefan Monnier
2018-10-17 11:12     ` Garreau, Alexandre
     [not found]   ` <mailman.2229.1539656812.1284.help-gnu-emacs@gnu.org>
2018-10-16  9:51     ` detect sentence/paragraph ending (was: refill paragraph but visually (like visual-line-mode)?) Emanuel Berg
2018-10-16 10:21       ` tomas
     [not found]       ` <mailman.2239.1539685299.1284.help-gnu-emacs@gnu.org>
2018-10-16 10:31         ` Emanuel Berg
2018-10-16 11:05           ` Van L
2018-10-17  9:55   ` refill paragraph but visually (like visual-line-mode)? Garreau, Alexandre

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=jwvsh17wac3.fsf-monnier+gmane.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@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 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.