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: Dmitry Gutov
Subject: Re: Render a buffer or string to a simpler string?
Date: Sun, 26 May 2013 19:40:01 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

Eli Zaretskii <eliz@gnu.org> writes:
> Btw, the general problem you described -- "render to a string" -- is
> not necessarily solvable even in principle.  E.g., how do you express
> in a string variable fonts and other face attributes that don't change
> the text, only how it is displayed? what about pixel-granular
> alignment we do with :align-to and similar display properties? what to
> do with images and sounds? etc. etc.

That's true, but it can be solved well enough to be useful for testing
some classes of packages.

Pixel-granular alignment would probably be ignored, `face' properties
would be either ignored, or just kept as-is in the rendered string.

>> I think it's a shame, because out of all (?) text editors, Emacs is the
>> best positioned to enable human-readable UI tests, because of how often
>> people use text properties to do visuals.
>
> I don't understand this reasoning at all.  Why do you think Emacs is
> best positioned for this?  And what have human-readable UI tests to do
> with this; I thought you were talking about _automated_ tests?

A human has to write these tests, and then come back later, be able to
read and modify them. Try doing that efficiently with screen grabs.

>> Testing UI look in graphical applications has to involve screen grabs,
>> at least on some level.
>
> When Emacs runs on a graphical terminal, it acts as a graphical
> application.

The only means of building interface widgets exposed to Elisp are text
properties, AFAIK. They do include some graphical-only features, but
those aren't used as often as one might expect.



reply via email to

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