From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Render a buffer or string to a simpler string? Date: Sun, 26 May 2013 19:15:08 +0300 Message-ID: <83zjvhpvjn.fsf@gnu.org> References: <87bo7yq2az.fsf@yandex.ru> <83d2serd46.fsf@gnu.org> <87vc66d96b.fsf@yandex.ru> <83a9niqwsa.fsf@gnu.org> <87y5b2tnpl.fsf@yandex.ru> <834ndprd1z.fsf@gnu.org> <87sj19sqb2.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1369584942 17708 80.91.229.3 (26 May 2013 16:15:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 May 2013 16:15:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 26 18:15:42 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ugdbh-0003ec-Jx for geh-help-gnu-emacs@m.gmane.org; Sun, 26 May 2013 18:15:41 +0200 Original-Received: from localhost ([::1]:33735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ugdbh-0000nD-2a for geh-help-gnu-emacs@m.gmane.org; Sun, 26 May 2013 12:15:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgdbS-0000n6-Tt for help-gnu-emacs@gnu.org; Sun, 26 May 2013 12:15:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UgdbR-0003fQ-J5 for help-gnu-emacs@gnu.org; Sun, 26 May 2013 12:15:26 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:34930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgdbR-0003fJ-Ao for help-gnu-emacs@gnu.org; Sun, 26 May 2013 12:15:25 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MNE00E00YEYCQ00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Sun, 26 May 2013 19:15:02 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MNE00E1JYH18640@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Sun, 26 May 2013 19:15:02 +0300 (IDT) In-reply-to: <87sj19sqb2.fsf@yandex.ru> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91075 Archived-At: > From: Dmitry Gutov > Cc: help-gnu-emacs@gnu.org > Date: Sun, 26 May 2013 19:40:01 +0400 > > Eli Zaretskii 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. "Some classes" might not be enough for testing display. > Pixel-granular alignment would probably be ignored, `face' properties > would be either ignored, or just kept as-is in the rendered string. Keeping the faces makes sense if they are automatically generated, but not if they are put by explicit Lisp code, since then you just get whatever the code put. > >> 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. UI testing people do that all the time: you compare the grab with some baseline. > >> 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. Try looking at Customize, and you will see a different story.