unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: emacs-devel@gnu.org
Subject: Re: so-long-mode and line-move-visual
Date: Sun, 08 May 2022 14:20:41 +0300	[thread overview]
Message-ID: <837d6ww9rq.fsf@gnu.org> (raw)
In-Reply-To: <c71663b913de1914c00f7db28bdcfea3@webmail.orcon.net.nz> (message from Phil Sainty on Sun, 08 May 2022 22:02:34 +1200)

> Date: Sun, 08 May 2022 22:02:34 +1200
> From: Phil Sainty <psainty@orcon.net.nz>
> Cc: emacs-devel@gnu.org
> 
> With the option combo currently set by so-long, Emacs is only
> displaying a small portion of a long line, and basic cursor
> movements are only moving around within that visible area, so
> it's less likely that the user will cause themselves problems
> by moving point.

How is this consistent with this:

  (defcustom so-long-variable-overrides
    '((bidi-inhibit-bpa . t)
      (bidi-paragraph-direction . left-to-right)
      (buffer-read-only . t)
      (global-hl-line-mode . nil)
      (line-move-visual . t)
      (show-paren-mode . nil)
      (truncate-lines . nil)  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      (which-func-mode . nil))

When truncate-lines is nil, lines are NOT truncated, so long lines
wrap around, and we display whole lines (at least their parts that fit
in a window, and windows nowadays tend to be very tall), not their
small portions.  What am I missing?

> A nil line-move-visual risks the user accidentally skipping to the
> end of an enormous line (which may be very bad for performance),
> whereas a non-nil value protects them from that.

That's not what happens in reality, though.  When line-move-visual is
nil, C-n moves to the next _physical_ line by looking for the next
newline in the buffer (via 'memchr'), which is very fast.  If lines
are truncated, this move to the next physical line skips large
portions of the buffer that are not visible on display, and skips them
very quickly.  By contrast, with line-move-visual non-nil, we use
simulation of the display code to find what is the character directly
below the cursor on the next visual line, and that requires us to
traverse all the characters in-between, loading fonts and colors,
computing the metrics of the font glyphs, etc.

> As such, I don't think these defaults should be changed.

Well, I found the defaults sub-optimal in the case someone presented
on help-gnu-emacs yesterday, thus my question.  If you are still
unconvinced, so be it.



  reply	other threads:[~2022-05-08 11:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-08  5:44 so-long-mode and line-move-visual Eli Zaretskii
2022-05-08 10:02 ` Phil Sainty
2022-05-08 11:20   ` Eli Zaretskii [this message]
2022-05-08 12:24     ` Phil Sainty

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=837d6ww9rq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=psainty@orcon.net.nz \
    /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).