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 18:11:36 +0300 Message-ID: <834ndprd1z.fsf@gnu.org> References: <87bo7yq2az.fsf@yandex.ru> <83d2serd46.fsf@gnu.org> <87vc66d96b.fsf@yandex.ru> <83a9niqwsa.fsf@gnu.org> <87y5b2tnpl.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1369581123 13457 80.91.229.3 (26 May 2013 15:12:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 May 2013 15:12:03 +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 17:12:02 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 1Ugcc3-00078g-TS for geh-help-gnu-emacs@m.gmane.org; Sun, 26 May 2013 17:12:00 +0200 Original-Received: from localhost ([::1]:48178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ugcc3-0005Qc-Bq for geh-help-gnu-emacs@m.gmane.org; Sun, 26 May 2013 11:11:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ugcbo-0005QU-NW for help-gnu-emacs@gnu.org; Sun, 26 May 2013 11:11:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ugcbj-0002Gt-3Y for help-gnu-emacs@gnu.org; Sun, 26 May 2013 11:11:44 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:47556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ugcbi-0002Ga-Rg for help-gnu-emacs@gnu.org; Sun, 26 May 2013 11:11:39 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MNE00A00VEJ5F00@a-mtaout22.012.net.il> for help-gnu-emacs@gnu.org; Sun, 26 May 2013 18:11:30 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MNE00AH5VJ53830@a-mtaout22.012.net.il> for help-gnu-emacs@gnu.org; Sun, 26 May 2013 18:11:30 +0300 (IDT) In-reply-to: <87y5b2tnpl.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.172 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:91071 Archived-At: > From: Dmitry Gutov > Cc: help-gnu-emacs@gnu.org > Date: Sun, 26 May 2013 07:38:30 +0400 > > Eli Zaretskii writes: > > 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. > > That's what I figured, but had to ask anyway. Thanks for the reply. 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. > >> 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. > > 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? > 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.