From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Render a buffer or string to a simpler string? Date: Sun, 26 May 2013 13:16:17 -0400 Message-ID: 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 1369588616 19905 80.91.229.3 (26 May 2013 17:16:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 May 2013 17:16:56 +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 19:16:55 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 1UgeYw-0001Mr-W4 for geh-help-gnu-emacs@m.gmane.org; Sun, 26 May 2013 19:16:55 +0200 Original-Received: from localhost ([::1]:43607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgeYw-0003G3-Ie for geh-help-gnu-emacs@m.gmane.org; Sun, 26 May 2013 13:16:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgeYk-0003Al-D5 for help-gnu-emacs@gnu.org; Sun, 26 May 2013 13:16:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UgeYj-0003nH-IZ for help-gnu-emacs@gnu.org; Sun, 26 May 2013 13:16:42 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:57511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgeYj-0003nB-Bm for help-gnu-emacs@gnu.org; Sun, 26 May 2013 13:16:41 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UgeYi-0001Aj-3M for help-gnu-emacs@gnu.org; Sun, 26 May 2013 19:16:40 +0200 Original-Received: from 69-165-157-233.dsl.teksavvy.com ([69.165.157.233]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 May 2013 19:16:40 +0200 Original-Received: from monnier by 69-165-157-233.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 May 2013 19:16:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 17 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 69-165-157-233.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:ogibVxi/WgeZS+SKs00Ij+oNFdA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:91076 Archived-At: > 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. Obviously, some ERT tests could use such a feature, but things like htmlfontify could probably also make use of it. Stefan