From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: Formatting C (or other code) to HTML for blog posts Date: Thu, 30 Oct 2008 09:41:32 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0afeef4c-dc37-4b7a-946c-a947e9aed28a@z18g2000prn.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1225388458 21581 80.91.229.12 (30 Oct 2008 17:40:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Oct 2008 17:40:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 30 18:41:57 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KvbWu-0008Oi-9Y for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Oct 2008 18:41:57 +0100 Original-Received: from localhost ([127.0.0.1]:35483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvbVm-0003SJ-OY for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Oct 2008 13:40:46 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2!postnews.google.com!z18g2000prn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 23 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1225384892 13049 127.0.0.1 (30 Oct 2008 16:41:32 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 30 Oct 2008 16:41:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z18g2000prn.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:163921 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59264 Archived-At: On Oct 30, 8:45 am, Alex Bennee wrote: > Hi, > > Is there a function that will format some source code into HTML so I > don't loose formatting from the spaces and tabs being eaten up. Usually > I would wrap the code in
 but for various reasons this is not so
> easy to do (the blog software chews double spaces).
>
> It would be extra nice if the function did pretty syntax highlighting!
>
> I tried format-encode-region to html but that didn't seem to so what I
> wanted (or at least I didn't see a bunch of &nsp;'s and 
's appear). not sure about blogs because their support for raw html differs. anyhow, i use htmlize and am very happy about it. For detail, see: http://xahlee.org/emacs/elisp_htmlize.html Xah =E2=88=91 http://xahlee.org/ =E2=98=84