unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Evgeny Zajcev <lg.zevlg@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: truncate-lines as newline property
Date: Sun, 10 Mar 2024 21:38:54 +0200	[thread overview]
Message-ID: <86le6pvpv5.fsf@gnu.org> (raw)
In-Reply-To: <CAO=W_ZqYfaDPkwyBNa-87=rv=pQos8=a=xEcSS9CT4qybTKftg@mail.gmail.com> (message from Evgeny Zajcev on Sun, 10 Mar 2024 21:53:19 +0300)

> From: Evgeny Zajcev <lg.zevlg@gmail.com>
> Date: Sun, 10 Mar 2024 21:53:19 +0300
> 
> (setq truncate-lines nil)
> (insert "<very long line>"
>           (propertize "\n" 'truncate-lines t))   ; this line will be truncated
> (insert "<another very long line>" "\n")    ; this line will be wrapped

Btw, this specification would mean that redisplay needs to go all the
way to the newline to know what to do when a screen line exceeds the
window width, which could happen long before the newline is rendered.
This is completely against the current design of the display engine,
which tries very hard not to examine any characters except those it
needs to display.  So a better design would be to have the special
text property on the first character of a line, the one that _follows_
the newline, so as to make sure the display code knows whether or not
to truncate as soon as it needs to make that decision.



  parent reply	other threads:[~2024-03-10 19:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-10 18:53 truncate-lines as newline property Evgeny Zajcev
2024-03-10 19:32 ` Eli Zaretskii
2024-03-10 22:48   ` Kévin Le Gouguec
2024-03-13 13:15   ` Ihor Radchenko
2024-03-13 16:17     ` Rudolf Adamkovič
2024-03-10 19:38 ` Eli Zaretskii [this message]
2024-03-10 20:21   ` Evgeny Zajcev

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=86le6pvpv5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lg.zevlg@gmail.com \
    /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).