From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Evgeny Zajcev Newsgroups: gmane.emacs.devel Subject: truncate-lines as newline property Date: Sun, 10 Mar 2024 21:53:19 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ed3127061352f084" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27167"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 10 19:54:22 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 1rjOJS-0006u6-AJ for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Mar 2024 19:54:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjOIq-0001NB-Pf; Sun, 10 Mar 2024 14:53:44 -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 1rjOIh-0001KY-74 for emacs-devel@gnu.org; Sun, 10 Mar 2024 14:53:36 -0400 Original-Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjOIf-0005s1-GT for emacs-devel@gnu.org; Sun, 10 Mar 2024 14:53:34 -0400 Original-Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-29b9f258cd9so2245662a91.3 for ; Sun, 10 Mar 2024 11:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710096811; x=1710701611; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=KXcEVkCn1lTD23OAjcCmou4P6p6ySqgE58pCAXISO6g=; b=jSlEioDeYBjkcshRld09XfAVwSBuGwjZBWBCP3GrX9W8BEs4lRETNMc9zKByc0hSxr yFAPrbBgxLznry11JBLa3XdGCk5DK/7tE7DXaXE0UN3smkhZ3929TSFHa6O3kKvbOXgS CSGQeSCgp6vf69N+OsGCsiiz0SZe8tbC1pDB3uBrB1qh0+Aa/10YUi7FvuwiYzcMyzLm yLnlOFSRXRz3Mr2kXXLDDJss4QgfGfZASFm3axIBhFeEbAFtMPO1ECOiVUwTgIGVC8Z9 z0UQZqZfnEmN8+AA+DGHqqZliMmNdLsT2ZLRhSD9h4PxYVFkfe8dPPyVtFXHmaLziyAM R25w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710096811; x=1710701611; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=KXcEVkCn1lTD23OAjcCmou4P6p6ySqgE58pCAXISO6g=; b=MRt5UdY8dkwIwavhgBXGLTw7Pdiw20DnnbicDf/vVD5EGQbg6Lo6viRNq7PXuQ3kaF bhiSqti1CeasUmLX/p4rMcPFTUg85fMqKEXCtCuY+AGSYMR18IsB0CkoosVwyvnoW0iy uceqWFk0JY3gg1+8jAtJ/aOHd5Fz06f8eBp6Ni2eFPr+WK5ps0X5XBigYyKITQyXvn3r bAJBNsFWTGZJwXbaYAVl3/JL4iEAoNk1aT3ilxYMEF9vV7reb+Re3OTGRxGyvERdP67g Zv+QBPVwuVTJsJfmh25bC/waJ8rjN06GoDyaGv37DX0DFg3fVEXlIzk3QXmQjV9BqF00 FS8w== X-Gm-Message-State: AOJu0YwGqmfhvRMfNourl7enJsRqiSPfPGdVebM1MtCBHBLF1q1LRmEp 1FyvoXTeSUYlYDErYCRg4jxlSdIK2NRYdpJW28j8UL2AY3B0Y9Xh2U9SKc0f56gc+pPVM4xgCxk n4PH8Q+8Z0aHfmH7TvAZvL812oHGAAHjJ X-Google-Smtp-Source: AGHT+IFAiZHZ3KB/WSnWdmMb47BH24XTBmtmEGc9hXQHYDrYA4UD4P4jK0ajcMQIuVj/PL/TfcDY809hvTIhfS8HZKI= X-Received: by 2002:a17:90a:17ea:b0:29b:cf67:7543 with SMTP id q97-20020a17090a17ea00b0029bcf677543mr1591159pja.4.1710096810583; Sun, 10 Mar 2024 11:53:30 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=lg.zevlg@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:316981 Archived-At: --000000000000ed3127061352f084 Content-Type: text/plain; charset="UTF-8" As I understand, truncate-lines is a buffer property, so it applies to every line in the buffer. Is it possible with some rather small changes to redisplay make it per newline property, so you can specify which line to truncate and to which apply buffer setting? Here is the example: (setq truncate-lines nil) (insert "" (propertize "\n" 'truncate-lines t)) ; this line will be truncated (insert "" "\n") ; this line will be wrapped What do you think about this feature? -- lg --000000000000ed3127061352f084 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
As I understand, truncate-lines is a buffer property, so i= t applies to every line in the buffer.

Is it possible with some rather small changes to redisplay make it pe= r newline property, so you can specify which line to truncate and to which = apply buffer setting?

Here is the example:

(setq truncate-lines nil)
(insert "<= ;very long line>"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (propertize "\n" 'truncate-lines t))=C2=A0=C2= =A0 ; this line will be truncated
(insert "<another very = long line>" "\n")=C2=A0=C2=A0=C2=A0 ; this line will be w= rapped

What do you think about this feature?

--
lg
--000000000000ed3127061352f084--