From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Bennee Newsgroups: gmane.emacs.help Subject: Formatting C (or other code) to HTML for blog posts Date: Thu, 30 Oct 2008 15:45:44 +0000 Message-ID: <1225381544.13198.16.camel@pitcairn.cambridgebroadband.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1225381616 27649 80.91.229.12 (30 Oct 2008 15:46:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Oct 2008 15:46: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 Thu Oct 30 16:47:58 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 1KvZkH-0000xc-KW for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Oct 2008 16:47:37 +0100 Original-Received: from localhost ([127.0.0.1]:59461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvZjB-0004Tx-9U for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Oct 2008 11:46:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvZih-0004M5-H3 for help-gnu-emacs@gnu.org; Thu, 30 Oct 2008 11:45:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvZie-0004KR-Pu for help-gnu-emacs@gnu.org; Thu, 30 Oct 2008 11:45:58 -0400 Original-Received: from [199.232.76.173] (port=42388 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvZie-0004KE-Le for help-gnu-emacs@gnu.org; Thu, 30 Oct 2008 11:45:56 -0400 Original-Received: from mailhost.cambridgebroadband.com ([212.44.17.77]:36137 helo=cambridgebroadband.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KvZie-0004Fp-1v for help-gnu-emacs@gnu.org; Thu, 30 Oct 2008 11:45:56 -0400 Original-Received: from exchange.cbl.local (exchange.cambridgebroadband.com [212.44.17.76]) by cambridgebroadband.com (8.14.1/8.14.1) with ESMTP id m9UFjilJ007768 for ; Thu, 30 Oct 2008 15:45:44 GMT Original-Received: from [10.0.0.166] ([10.0.0.166]) by exchange.cbl.local with Microsoft SMTPSVC(6.0.3790.3959); Thu, 30 Oct 2008 15:45:03 +0000 X-Mailer: Evolution 2.22.3.1 X-OriginalArrivalTime: 30 Oct 2008 15:45:03.0640 (UTC) FILETIME=[79A1D180:01C93AA6] X-Scanned-By: MIMEDefang 2.62 on 212.44.17.77 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:59258 Archived-At: 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). -- Alex Bennee, Software Engineer Tcl tends to get ported to weird places like routers. -- Larry Wall in <199710071721.KAA19014@wall.org>