help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Render a buffer or string to a simpler string?


From: Eli Zaretskii
Subject: Re: Render a buffer or string to a simpler string?
Date: Sun, 26 May 2013 05:50:45 +0300

> From: Dmitry Gutov <dgutov@yandex.ru>
> Cc: help-gnu-emacs@gnu.org
> Date: Sun, 26 May 2013 01:46:52 +0400
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Dmitry Gutov <dgutov@yandex.ru>
> >> Date: Sat, 25 May 2013 23:36:52 +0400
> >> 
> >> Is there an easy way to convert a string with `line-prefix' and,
> >> optionally, `prefix' and `display' properties to a string without those
> >> properties corresponding to how the former string is going to be
> >> displayed?
> >
> > Why do you need that?  What do you need to accomplish that needs such
> > a strange feature?
> 
> Write an automated test (with ERT) that would be easy to read and modify
> later.

We lack such a feature currently.  Display rendering is a C-level
operation, whose result is not a string, but an array of structures
called "glyphs" which are passed to the terminal back end for drawing
on the screen.  So you need primitives (which don't exist) to produce
Lisp strings out of those glyphs.

> To put it differently, the goal is to make the buffer look a certain way,
> so I'd like to be able to check that it does look that way.

That's hard to do automatically, unless you use external software that
grabs screen portions.  Rendering is just one of the aspects, there's
also alignment, decorations, remnants from previous redisplay cycles,
etc.

> (For my current purpose, it would be fine if that render-to-string
> function disregarded eyecandy text-properties, like `face', but in the
> general case, being able to compare them, too, would be handy.)

Removing properties from strings is a feature we do have.



reply via email to

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