[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correct use of text properties?

From: Joshua Lambert
Subject: Re: Correct use of text properties?
Date: Thu, 2 Mar 2023 09:25:20 -0600

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 AM 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 always 1.
Also, pointer motions such as move-end-of-line and forward-paragraph jump to
the end of the file. Since I was adding newline characters as text properties, I
thought the line numbers might increment as I moved point down past those

> 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 want 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 manipulate
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 discovered
the display tables and text properties and thought I would explore those.

J. Lambert

Attachment: marc-add-newlines.el
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]