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: Mon, 27 May 2013 03:28:16 +0400 Message-ID: <87wqqlb9tb.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 1369610917 26476 80.91.229.3 (26 May 2013 23:28:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 May 2013 23:28:37 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 27 01:28:36 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 1UgkMd-0000rV-Rg for geh-help-gnu-emacs@m.gmane.org; Mon, 27 May 2013 01:28:35 +0200 Original-Received: from localhost ([::1]:43648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgkMd-0004Ff-2F for geh-help-gnu-emacs@m.gmane.org; Sun, 26 May 2013 19:28:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgkMQ-0004Fa-E9 for help-gnu-emacs@gnu.org; Sun, 26 May 2013 19:28:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UgkML-0005I6-Kk for help-gnu-emacs@gnu.org; Sun, 26 May 2013 19:28:22 -0400 Original-Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:59009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgkML-0005Ha-DL for help-gnu-emacs@gnu.org; Sun, 26 May 2013 19:28:17 -0400 Original-Received: by mail-la0-f45.google.com with SMTP id ec20so6006922lab.18 for ; Sun, 26 May 2013 16:28:16 -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=8MqAOIIxdqmBoNNba1/K5IWAoEiLWZ1qtSlgbyt3IPY=; b=OAHsDJQloh0k1Uo2tEt7cYS55AA16xUAd7/HM31dzySaVrpciuOfz20nz5/QzvuM0w 18nCQZaQ23ufok5x/2bd27NZI9xF0YraiNPEZM/LIRanDMws3loqtrt/V4BTix8XB7yO W8iRA1/d1Q8eIlFGDfxot3DpxCMrT6spYxIeNNtqyS5juw6uhHik705RAYmeU/ZfviAW pilAqWr7+6VFGDHSVFUnpLUcl8dHReha5iztIGqlhwu3almeuoh0F1zMtNowQWJKvByU BFLP2Wu4DjqFKRRDBKBK4GO3yiaijAfu707uOlUpcueiWLazWzS5+Pt56xsvs4fcq+yc zjYQ== X-Received: by 10.152.8.231 with SMTP id u7mr13335670laa.27.1369610896460; Sun, 26 May 2013 16:28:16 -0700 (PDT) Original-Received: from SOL ([178.252.98.87]) by mx.google.com with ESMTPSA id e9sm9535407lbj.3.2013.05.26.16.28.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 May 2013 16:28:15 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 26 May 2013 13:16:17 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) X-Antivirus: avast! (VPS 130526-0, 26.05.2013), Outbound message X-Antivirus-Status: Clean X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22d 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:91079 Archived-At: Stefan Monnier 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. > > Maybe we could provide some way to "render to Elisp", which would > provide access to the glyph matrix somehow (probably exporting it as, > say, an array of "glyphs"). I'd imagine an interface along the lines of > "(render-to-lisp START END &optional WINDOW)" to render a particular > region of the current buffer as it would be displayed in WINDOW. Right, I should be able to use that almost directly, even though I've no idea what kind of values are contained in "glyphs". I'd just render to glyphs both the buffer under test and a reference buffer, and compare results.