all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Render a buffer or string to a simpler string?
Date: Sun, 26 May 2013 05:50:45 +0300	[thread overview]
Message-ID: <83a9niqwsa.fsf@gnu.org> (raw)
In-Reply-To: <87vc66d96b.fsf@yandex.ru>

> 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	other threads:[~2013-05-26  2:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-25 19:36 Render a buffer or string to a simpler string? Dmitry Gutov
2013-05-25 20:58 ` Eli Zaretskii
2013-05-25 21:46   ` Dmitry Gutov
2013-05-26  2:50     ` Eli Zaretskii [this message]
2013-05-26  3:38       ` Dmitry Gutov
2013-05-26 15:11         ` Eli Zaretskii
2013-05-26 15:40           ` Dmitry Gutov
2013-05-26 16:15             ` Eli Zaretskii
2013-05-26 23:20               ` Dmitry Gutov
     [not found]             ` <mailman.418.1369584930.22516.help-gnu-emacs@gnu.org>
2013-05-26 17:08               ` esabof
2013-05-26 23:36                 ` Dmitry Gutov
2013-05-26 17:16       ` Stefan Monnier
2013-05-26 23:28         ` Dmitry Gutov
     [not found]       ` <mailman.419.1369588606.22516.help-gnu-emacs@gnu.org>
2013-05-26 17:56         ` esabof
2013-05-27  2:47           ` Eli Zaretskii
2013-05-27  2:48           ` Dmitry Gutov
     [not found]           ` <mailman.445.1369622831.22516.help-gnu-emacs@gnu.org>
2013-05-27 11:59             ` esabof
     [not found]           ` <mailman.446.1369622948.22516.help-gnu-emacs@gnu.org>
2013-05-27 12:14             ` esabof
     [not found] <mailman.381.1369510626.22516.help-gnu-emacs@gnu.org>
2013-05-25 20:45 ` Barry Margolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83a9niqwsa.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.