From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joshua Lambert Newsgroups: gmane.emacs.help Subject: Re: Correct use of text properties? Date: Thu, 2 Mar 2023 09:25:20 -0600 Message-ID: References: <83sfenei8u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000081103505f5ec70cf" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3720"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 02 16:26:11 2023 Return-path: Envelope-to: geh-help-gnu-emacs@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 1pXkot-0000rB-Nb for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 02 Mar 2023 16:26:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXkoM-0000C7-T7; Thu, 02 Mar 2023 10:25:39 -0500 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 1pXkoK-0000BL-Sb for help-gnu-emacs@gnu.org; Thu, 02 Mar 2023 10:25:36 -0500 Original-Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXkoJ-00084E-8F; Thu, 02 Mar 2023 10:25:36 -0500 Original-Received: by mail-wr1-x431.google.com with SMTP id bx12so13742958wrb.11; Thu, 02 Mar 2023 07:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677770732; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=M8pv5u6ro+19KueartY3NQWf+WQke2FHNJXf+9q9KAA=; b=NeQ4+eBLO5Cosv1fI+qSIJKYXYng1f426woak7JFEzTbGpO2jnUrH8Y9hOqsGFPNBr /6kyBuMIxgCAz+oyNo3+Va5+1r1BYdGBL3ZImWKEHBO/eChFvdhut5NokBPJO9k4mEMm gOFGhKTiGxAYPdbOUKfFH2x75Xmp3G5DkA2vkAisTCwfg2volIm3580Dyi6IFwMcGlFp qCZMGwWIp9g3F+ZUh0/wFVJ1AzA8BduLKwpZXUo36KoIfL6+bkgRwDduexFMhnKhycyZ UqT5wzBMpzA5OOSPUTP12yk5W4d/GFw/5sqE+tvxPKvviUMUUT8Xd68OmFypulUSxgm9 TA9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677770732; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M8pv5u6ro+19KueartY3NQWf+WQke2FHNJXf+9q9KAA=; b=S7fSDdUWCdg1rB/Zr1bCKCAQ56uS8WK5WvQO5aqb5ufZ4+34Hy2i4S75B5fEsfIJhr +uE8oTK3+TBC2M8SODyA53aGf8JiDdi3L/l4FN7Fy/8TLCHyD3kRQYEwUqtVFhTNZ1F/ i7POAtIMJT9LdOmpALXFZzilxJAUKugIgT5wLVFnJahHXC1oXFQ7QrrxdDCsq8N3JHaP TAgrAlbF4rWmBD8dAtZA7Zg8GdjZDBGuUml/mDfMtSsqti7m3zwLBRqvyk1Q0SrChZZi twahisBt/ujwj7/Aac/aM3JnjS69zqUZWdqU0UELkehrcj8vASXNzcHDk3h9ignCU4I2 U46w== X-Gm-Message-State: AO0yUKWWvWYFl8dumNotamZcxjwidKx5p9+ZHN4JiTdp5D9tdz1Fh+GZ yu11HLEn9BVsZ2m9OrngghgujOczeYyz3/tmJsUYHK+5BfY= X-Google-Smtp-Source: AK7set+7rzqLsihWcpW7EI7p3eIzjnRZOCDJKFpZf+4h7KV8JY7/WhpwvI8qUV4Eda1h2VOxDqaLT8V8LrPFPctojmE= X-Received: by 2002:a5d:5141:0:b0:2c9:8df7:b385 with SMTP id u1-20020a5d5141000000b002c98df7b385mr2117978wrt.1.1677770732130; Thu, 02 Mar 2023 07:25:32 -0800 (PST) In-Reply-To: <83sfenei8u.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=jlambert.lis.tech@gmail.com; helo=mail-wr1-x431.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142889 Archived-At: --00000000000081103505f5ec70cf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The pasted code may not have come through due to my copying and pasting non-printing characters. Attached is the function in its own file. On Thu, Mar 2, 2023 at 1:16=E2=80=AFAM Eli Zaretskii wrote: > > > From: Joshua Lambert > > Date: Wed, 1 Mar 2023 22:21:14 -0600 > > > > It seems to visually accomplish what I want, but line numbers and some > > cursor motions don't treat the newlines like true newlines. Is that > > expected behavior? > > Probably. But you don't describe the behavior you found surprising, > so it is hard to tell whether what you see is expected. Please tell > more about the behavior you observe that surprised you. In the modeline and with display-line-numbers-mode the line number is alway= s 1. Also, pointer motions such as move-end-of-line and forward-paragraph jump t= o the end of the file. Since I was adding newline characters as text properti= es, I thought the line numbers might increment as I moved point down past those newlines. > If all you want is to break long lines on space characters, I suggest > to try visual-line-mode instead: it does that automatically in > low-level display code. Did you try that? > I have to break the lines in specific places so this won't work. I only wan= t to break lines when there is a codepoint 29 or 30 in the file. Thanks for your time and attention. Many if not all programs that manipulat= e MARC records break/transform the data structure for human consumption and then later remake it. I expected to have to do that in Emacs and then disco= vered the display tables and text properties and thought I would explore those. J. Lambert --00000000000081103505f5ec70cf Content-Type: application/octet-stream; name="marc-add-newlines.el" Content-Disposition: attachment; filename="marc-add-newlines.el" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ler81fvb0 KGRlZnVuIG1hcmMtYWRkLW5ld2xpbmVzICgpDQogICJSZXBsYWNlIHRoZSBkaXNwbGF5IHRleHQg cHJvcGVydHkgb2YgYWxsIHdpdGggbmV3bGluZS4iDQogIChpbnRlcmFjdGl2ZSkNCiAgKHNhdmUt ZXhjdXJzaW9uDQogICAgKGdvdG8tY2hhciAocG9pbnQtbWluKSkNCiAgICAod2hpbGUgKHJlLXNl YXJjaC1mb3J3YXJkICIdIiBuaWwgMSkgOzsgcmVwbGFjZSBjb2RlcG9pbnQgMjkgd2l0aCBuZXds aW5lDQogICAgICAocHV0LXRleHQtcHJvcGVydHkgKC0gKHBvaW50KSAxKSAocG9pbnQpICdkaXNw bGF5ICJcbiIpKSkNCiAgKHNhdmUtZXhjdXJzaW9uDQogICAgKGdvdG8tY2hhciAocG9pbnQtbWlu KSkNCiAgICAod2hpbGUgKHJlLXNlYXJjaC1mb3J3YXJkICIeIiBuaWwgMSkgOzsgcmVwbGFjZSBj b2RlcG9pbnQgMzAgd2l0aCBuZXdsaW5lDQogICAgICAocHV0LXRleHQtcHJvcGVydHkgKC0gKHBv aW50KSAxKSAocG9pbnQpICdkaXNwbGF5ICJcbiIpKSkpDQo= --00000000000081103505f5ec70cf--