From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.help Subject: Re: Render a buffer or string to a simpler string? Date: Sun, 26 May 2013 07:38:30 +0400 Message-ID: <87y5b2tnpl.fsf@yandex.ru> References: <87bo7yq2az.fsf@yandex.ru> <83d2serd46.fsf@gnu.org> <87vc66d96b.fsf@yandex.ru> <83a9niqwsa.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1369539543 23209 80.91.229.3 (26 May 2013 03:39:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 May 2013 03:39:03 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 26 05:39: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 1UgRnR-0005cV-HH for geh-help-gnu-emacs@m.gmane.org; Sun, 26 May 2013 05:39:01 +0200 Original-Received: from localhost ([::1]:35565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgRnR-0007m5-62 for geh-help-gnu-emacs@m.gmane.org; Sat, 25 May 2013 23:39:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgRnA-0007ly-N4 for help-gnu-emacs@gnu.org; Sat, 25 May 2013 23:38:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UgRn2-0002jw-Qg for help-gnu-emacs@gnu.org; Sat, 25 May 2013 23:38:44 -0400 Original-Received: from mail-lb0-f169.google.com ([209.85.217.169]:47160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgRn2-0002jp-J0; Sat, 25 May 2013 23:38:36 -0400 Original-Received: by mail-lb0-f169.google.com with SMTP id 10so5828946lbf.14 for ; Sat, 25 May 2013 20:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:x-antivirus:x-antivirus-status; bh=CpUILbnm2/O473LT+m22sfeYO/w2h61cHGkzuecRVFc=; b=etrL2LTF7MA2IQOUrUX3trHWNsgEEsnPD+j+VUwTy3eXZrxs9vjwtGKKlR+921Xu/j GpB8lr3Awy3/9aPt+pbzqO0NW8mKIYxjMrnpKos0id/e/d/5A5mCpXxqL24yxfEEoYNO G7xxDdjbQBarngZ8gG8CfuM1Lz/YGZfwtE6+gWchYdNnmE4B7QT8c5oog9d85OWrX2qB aZJTJKYEOOd2GUNWPT5PQ84flnup4cxBFL1gnJnUjDbfXOnLf3C7GeMtaBNZLnsNbKpp DsAUKO3FbwXrDV6laXTtP5SkKsomaw5Wa8NDMJk4cgbxqob85xsnCn41V2b8mgup49Ct 5FoA== X-Received: by 10.112.145.100 with SMTP id st4mr11766965lbb.102.1369539515283; Sat, 25 May 2013 20:38:35 -0700 (PDT) Original-Received: from SOL ([178.252.98.87]) by mx.google.com with ESMTPSA id n7sm9136051lbd.12.2013.05.25.20.38.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 25 May 2013 20:38:34 -0700 (PDT) In-Reply-To: <83a9niqwsa.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 26 May 2013 05:50:45 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) X-Antivirus: avast! (VPS 130525-1, 26.05.2013), Outbound message X-Antivirus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.217.169 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:91062 Archived-At: 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. Anyway, instead of writing a hacky fix + a bunch of new tests, I ended up finding a better fix instead (and changing existing tests). >> 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. Testing UI look in graphical applications has to involve screen grabs, at least on some level. >> (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. Sure. That's not what I was asking. If render-to-string included those text properties, that would be fine, too.