From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: truncate-lines as newline property Date: Sun, 10 Mar 2024 21:38:54 +0200 Message-ID: <86le6pvpv5.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11529"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Evgeny Zajcev Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 10 20:39:41 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rjP1J-0002na-0K for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Mar 2024 20:39:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjP0g-0003ki-Ec; Sun, 10 Mar 2024 15:39:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjP0e-0003kV-Jg for emacs-devel@gnu.org; Sun, 10 Mar 2024 15:39:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjP0e-0004gB-BB; Sun, 10 Mar 2024 15:39:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=lEeW/2m2UCnEdahz9EPpLayBuls0UEBWuFwm6XTMp7k=; b=fvx2fvvS0oLW qHhWSA++kGmYDco8ogEPIvUDavdgFEtkOgqHAcYnEPJiMKYySWPZ6otputKhk6rVqrmzyXHLofMcM 78eZEFPqYkUsvl1a14lckvFXDuvwdZ78WO5kMdBt9Lz+1sO0BOl6WP5ef7mfZDqmZ9PKURuFZSfkP C0ihO/onOEM3Zdy3yALM3PAq/fFallyFSZd/YW29JC3P+XdhZ87J8zhYtcwh5f3p5UthxFyJPbPqa CW97o4iFwdItYwMq0A7xVkzUGDvM1araUUW2UK7mjHn+GkMEOTHCzDDQq7exuC2WKkumsS9epLt2i qoXNRwtNM2DsCnpb5nYAXQ==; In-Reply-To: (message from Evgeny Zajcev on Sun, 10 Mar 2024 21:53:19 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316984 Archived-At: > From: Evgeny Zajcev > Date: Sun, 10 Mar 2024 21:53:19 +0300 > > (setq truncate-lines nil) > (insert "" > (propertize "\n" 'truncate-lines t)) ; this line will be truncated > (insert "" "\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.