unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Manuel Giraud <manuel@ledu-giraud.fr>
Cc: larsi@gnus.org, 56335@debbugs.gnu.org
Subject: bug#56335: 29.0.50; [PATCH] Add more breakpoint chars support to longlines-mode
Date: Mon, 04 Jul 2022 14:18:46 +0300	[thread overview]
Message-ID: <834jzx9ld5.fsf@gnu.org> (raw)
In-Reply-To: <87iloduwt0.fsf@elite.giraud> (message from Manuel Giraud on Mon,  04 Jul 2022 10:06:03 +0200)

> From: Manuel Giraud <manuel@ledu-giraud.fr>
> Cc: Manuel Giraud <manuel@ledu-giraud.fr>,  larsi@gnus.org,
>   56335@debbugs.gnu.org
> Date: Mon, 04 Jul 2022 10:06:03 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > If and when visual-line-mode becomes fast on long lines, we won't need
> > visual-line-mode for that.  Unlike longlines, visual-line-mode does
> > NOT insert newlines into the character stream examined by the display
> > code, it just breaks a visual line in certain places it considers
> > appropriate.  Thus, visual-line-mode cannot help where newlines do: in
> > breaking long lines into shorter ones.  It suffers from the same
> > problems as "normal" display, and any solution, if we find it, will
> > fix both.
> 
> Hi Eli,
> 
> I don't really understand.  If the visual breaking of lines works
> flawlessly for editing such file, longlines.el will not be needed
> anymore.  And I think it'd be better to have that and *not* insert
> newlines into a user's buffer.

The difference between these two methods may not be self-evident,
because they change the display in similar ways.  But they do it on
different levels: longlines does it _before_ the display code examines
the buffer text, whereas visual-line-mode is a feature implemented in
the display code itself, and does its job as buffer text is being
traversed.

The other part of this puzzle is the reason _why_ redisplay is slow
with long lines: it's because its design requires it to start its
layout decisions from the previous newline (that's a simplification,
but it describes what actually happens quite accurately).  In a buffer
with very long lines, this means starting very far away from point,
then examining all the many characters in-between.

Now, visual-line-mode still does all those layout decisions the same
way, it just produces a different layout.  So it, too, must start far
away and them march all the way back.  By contrast, under longlines
the display code can start from a much closer place, where longlines
inserted a newline.

I hope I've succeeded to explain why visual-line-mode cannot be as
fast as longlines, and why, if we find a way of speeding up
visual-line-mode, we'll see the same speedup in the "normal" display
(actually, it will be even faster, since visual-line-mode incurs some
additional processing in the display code).

> >> Now I'm going to check corner cases in longlines.el because the previous
> >> code used to replace space with soft newline. This patch should not
> >> replace any characters (just add soft newline)… but I could have missed
> >> some.
> >
> > Please indicate when you have a version that we should install.
> 
> Ok.  Could I add patch onto this bug report or should I create a new
> one?

No need for a new bug report, you can post here.

Thanks.





  reply	other threads:[~2022-07-04 11:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01 10:35 bug#56335: 29.0.50; [PATCH] Add more breakpoint chars support to longlines-mode Manuel Giraud
2022-07-01 13:33 ` Manuel Giraud
2022-07-02 12:14 ` Lars Ingebrigtsen
2022-07-02 12:23   ` Visuwesh
2022-07-02 12:46     ` Phil Sainty
2022-07-02 12:39   ` Eli Zaretskii
2022-07-02 12:44     ` Lars Ingebrigtsen
2022-07-02 13:03       ` Eli Zaretskii
2022-07-02 15:39         ` Lars Ingebrigtsen
2022-07-02 21:19           ` Manuel Giraud
2022-07-03  5:14             ` Eli Zaretskii
2022-07-04  8:06               ` Manuel Giraud
2022-07-04 11:18                 ` Eli Zaretskii [this message]
2022-07-05 13:07                   ` Manuel Giraud
2022-07-05 16:32                     ` Lars Ingebrigtsen
2022-07-06  7:43                       ` Manuel Giraud
2022-07-06 11:18                         ` Lars Ingebrigtsen
2022-07-06 10:18                       ` Manuel Giraud
2022-07-06 11:20                         ` Lars Ingebrigtsen
2022-07-06 18:49                         ` Juri Linkov
2022-07-06 20:47                           ` Manuel Giraud
2022-07-08  3:32                             ` Richard Stallman
2022-07-08  7:14                               ` Manuel Giraud
2022-07-08  7:22                                 ` Eli Zaretskii
2022-07-10  8:58                                   ` Manuel Giraud
2022-07-10 13:02                                     ` Lars Ingebrigtsen

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=834jzx9ld5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=56335@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=manuel@ledu-giraud.fr \
    /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).