From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?R=FCdiger?= Sonderfeld Newsgroups: gmane.emacs.devel Subject: Re: render region with eww Date: Wed, 26 Jun 2013 11:00:31 +0200 Message-ID: <2066702.3NLJt1OV8x@descartes> References: <87y59xb8mh.fsf@kanis.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1372237252 29370 80.91.229.3 (26 Jun 2013 09:00:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Jun 2013 09:00:52 +0000 (UTC) Cc: Ivan Kanis , Lars Ingebrigtsen To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 26 11:00:52 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 1Urlat-0004IH-Ds for ged-emacs-devel@m.gmane.org; Wed, 26 Jun 2013 11:00:51 +0200 Original-Received: from localhost ([::1]:56512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urlat-0002Ct-0z for ged-emacs-devel@m.gmane.org; Wed, 26 Jun 2013 05:00:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urlal-0002Cj-EG for emacs-devel@gnu.org; Wed, 26 Jun 2013 05:00:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Urlai-0006fb-L7 for emacs-devel@gnu.org; Wed, 26 Jun 2013 05:00:43 -0400 Original-Received: from ptmx.org ([178.63.28.110]:42299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urlai-0006fD-BY for emacs-devel@gnu.org; Wed, 26 Jun 2013 05:00:40 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id C997E21D60; Wed, 26 Jun 2013 11:00:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ptmx.org Original-Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xwpfg8pEmQd3; Wed, 26 Jun 2013 11:00:37 +0200 (CEST) Original-Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id F0E0A21C66; Wed, 26 Jun 2013 11:00:35 +0200 (CEST) User-Agent: KMail/4.10.3 (Linux/3.8.0-23-generic; KDE/4.10.3; x86_64; ; ) In-Reply-To: <87y59xb8mh.fsf@kanis.fr> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 178.63.28.110 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:161079 Archived-At: On Wednesday 26 June 2013 10:04:38 Ivan Kanis wrote: > emacs-w3m has a function called w3m-region. As the name implies it > renders html within a region. The package newsticker (included in Ema= cs) > uses that feature. I think it's implemented as a minor mode. >=20 > I am not sure how to write it wit eww. Any thoughts? You can do this with shr alone. A quick hack: (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)))) Best Regards R=C3=BCdiger