all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Garreau\, Alexandre" <galex-713@galex-713.eu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: refill paragraph but visually (like visual-line-mode)?
Date: Wed, 17 Oct 2018 12:54:42 +0200	[thread overview]
Message-ID: <87o9bsg7wt.fsf@portable.galex-713.eu> (raw)
In-Reply-To: <83zhvfs0a0.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 15 Oct 2018 18:21:59 +0300")

On 2018-10-15 at 18:21, Eli Zaretskii wrote:
>> From: "Garreau\, Alexandre" <galex-713@galex-713.eu>
>> Date: Mon, 15 Oct 2018 11:35:50 +0200
>> 
>> 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).
>
> Did you try to enlarge the window's display margins?

No, I didn’t know of them, only of fringes, which I recalled could be
resized, but forgot how.

visual-fill-column-mode is really great, it even centers text (I
wouldn’t have hoped so).  Then comes the other (now solved) problems:

>> 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.
>
> Such options don't exist.  You need to keep in mind that
> visual-line-mode (or "word wrap", as this feature is known in the
> internals) is just a semi-kludgey hack: we tweak the line-continuation
> code to start the continuation line on whitespace characters.  Other
> than that, it's still the same continuation line, and uses the same
> code to detect when it's time to wrap the line.  And even this
> relatively simple tweak makes the line-wrapping code devilishly
> complicated and hard to wrap your head around.
>
> It is possible that making the wrap coordinate controllable by users
> is not too hard, but Someone™ should look at the relevant code and try
> making it happen.  Maybe we will be lucky.
>
> Wanna try it?

isn’t it what visual-fill-column-mode does?

>> 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?
>
> Could be, but again, Someone™ should work on this.  One potential
> obstacle to negotiate is that, unlike the existing indentation
> functions, which traverse the buffer in order to find out the
> indentation of surrounding lines, the display code cannot easily do
> that, because the display routines are expected to be able to be
> called with a buffer position from which to start display, and be able
> to lay out a single screen line without knowing anything about the
> neighboring lines.  Some algorithm is needed to calculate the right
> indentation in those cases.

I was only thinking about some sort of adaptive-wrap-prefix-mode that
would use indentation of the first line as adaptive-prefix-wrap already
does.  Yet indeed, if all visual lines are actually from a single long
continued hard line, that has to be really difficult as some special
indentation should have to be stored invisible with the rest of logical
line (ie. e.g. instruction line) so that to be used afterwards, lazily
as it is currently done.

>> 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.
>
> This should be possible by hiding newlines behind display properties
> or overlays.

Hence visual-fill-mode, with some improvement it might work terribly
well everywhere in emacs.

> Patches are welcome to implement any of these useful features.

Patches? do you fill that would be relevant in main emacs?  maybe
keeping them as packages for a while before, so that to test them?

At least visual-fill-mode needs some twiddling related to some modes (or
maybe do modes need to specify when newlines (or any other character
such as “;” (both C and lisp), or "\n\t" (python)) are of semantical
relevance and should not be hidden, and when they’re not and should be?)
before, I’d say.



  reply	other threads:[~2018-10-17 10:54 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 [this message]
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
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=87o9bsg7wt.fsf@portable.galex-713.eu \
    --to=galex-713@galex-713.eu \
    --cc=eliz@gnu.org \
    --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.