From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] render region with eww Date: Thu, 27 Jun 2013 15:03:39 -0400 Message-ID: References: <87y59xb8mh.fsf@kanis.fr> <2066702.3NLJt1OV8x@descartes> <87mwqbcu0x.fsf_-_@kanis.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1372359827 26846 80.91.229.3 (27 Jun 2013 19:03:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Jun 2013 19:03:47 +0000 (UTC) Cc: =?iso-8859-1?Q?R=FCdiger?= Sonderfeld , Lars Ingebrigtsen , emacs-devel@gnu.org To: Ivan Kanis Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 27 21:03:47 2013 Return-path: Envelope-to: ged-emacs-devel@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 1UsHTu-0006pq-14 for ged-emacs-devel@m.gmane.org; Thu, 27 Jun 2013 21:03:46 +0200 Original-Received: from localhost ([::1]:42790 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsHTt-0003CJ-Lg for ged-emacs-devel@m.gmane.org; Thu, 27 Jun 2013 15:03:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsHTp-0003CD-Bn for emacs-devel@gnu.org; Thu, 27 Jun 2013 15:03:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsHTo-0002wy-HU for emacs-devel@gnu.org; Thu, 27 Jun 2013 15:03:41 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:20351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsHTo-0002ws-Dq for emacs-devel@gnu.org; Thu, 27 Jun 2013 15:03:40 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFMCppA/2dsb2JhbABEvw4Xc4IfAQVWIxALNBIUGA0kiCTBLZEKA6R6gV6DEw X-IPAS-Result: Av4EABK/CFFMCppA/2dsb2JhbABEvw4Xc4IfAQVWIxALNBIUGA0kiCTBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="17316606" Original-Received: from 76-10-154-64.dsl.teksavvy.com (HELO pastel.home) ([76.10.154.64]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 27 Jun 2013 15:03:34 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 1D71763BA7; Thu, 27 Jun 2013 15:03:39 -0400 (EDT) In-Reply-To: <87mwqbcu0x.fsf_-_@kanis.fr> (Ivan Kanis's message of "Thu, 27 Jun 2013 20:01:34 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161150 Archived-At: > +(defun shr-render-region (begin end &optional buffer) > + "Display the HTML rendering of the region between BEGIN and END." > + (interactive "r") > + (unless (fboundp 'libxml-parse-html-region) > + (error "This function requires Emacs to be compiled with libxml2")) > + (with-current-buffer (or buffer (current-buffer)) > + (let ((dom (libxml-parse-html-region begin end))) > + (kill-region begin end) > + (goto-char begin) > + (shr-insert-document dom)))) I think this should use delete-region, not kill-region. Stefan