From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Charles Sebold Newsgroups: gmane.emacs.help Subject: Re: Formatting C (or other code) to HTML for blog posts Date: Thu, 30 Oct 2008 10:52:34 -0500 Organization: Ministry of Silly Walks Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1225384872 8328 80.91.229.12 (30 Oct 2008 16:41:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Oct 2008 16:41:12 +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 17:42:13 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 1Kvaaj-0007ID-5N for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Oct 2008 17:41:49 +0100 Original-Received: from localhost ([127.0.0.1]:48562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvaZc-00088p-5m for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Oct 2008 12:40:40 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe06.iad.POSTED!7564ea0f!not-for-mail Mail-Copies-To: nobody Original-Newsgroups: gnu.emacs.help X-Using-Mail-Mode: Gmail Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAAAXNSR0IArs4c6QAAAAxQTFRF Py4qdFVKtYRz3aSQR+07SwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9gIEhcaB8/5OroA AAHxSURBVCjPLdExa9tAFMDxp1Jl6OZBGrJ36ac4g+2hSxXwCexAOzmQM9QfIIs9NLMNOYPVoUsl 0BNIUwafQPoKGdolHbo0BstgLy3FEuj15HS7H/93B3cHxExMieiLzwBwbotcI2xA8zM8aDwupxoP /BnP5fyE4vuMgWQ8yiuiv08LBtlUxDpQXX5iQLNh0oDWtw7Uczc64ejNgKaWaNZYvp+DeHjp5lRL V31YAGeWMT743J+8/QZbo9UXGIwz790vmBn99pAU5lHPh99mu+PWkifl7VfonvW4e/T7Vi2vwXnF ZdcN73uT4A66risuN/iHo9+HzcBbiQ2uuWy1oL0KwjebLaK3R/Dt69XHQ5FgRAjMdDnuirj4XBcA 9uoqXZdRFe0bIFKGiJNSj9l6Ot1yj3aoS/yDMqpyKlWDn1V5up4u58ljUTcoY7izswCj/6Xy8EKc UChIvfBF2DxWjQrU0jH4ZVN2ClA6FrfzpuwBfcsLcKxLpCAYDVwshkRVtodi8Zp7+VKPHUqI/YFA IfWmKoVCuiIONTLSR0vLS+gpqahScOzzC0H+5JDra0tmOqKU+vf2Cu6Z0Rni4ian/alw4S9uqMGI Ga43utBjSr8bszCU3UiHUMP0Qt6O0hRl842DFTejSgUDWDvmcNTpqjhc8n9hvWnVsoKmHAAAAABJ RU5ErkJggg== User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (windows-nt) Cancel-Lock: sha1:jsiti9OBngulHlcS91Oqzcfkkfc= Original-Lines: 22 Original-NNTP-Posting-Host: cbggobbepdfeflbildaedobifmeaokba Original-X-Complaints-To: abuse@charter.net Original-X-Trace: emlnjhpjaknjmmohfkhgnhldfhiklkalbdjlpjblafipdapocbggobbepdfeflbiddfpoklkdebinfchbhfponancgpagdbmdmkflckmfnipolkhlbphpgcnngnhkccffdlbpmaelemcakjp Original-NNTP-Posting-Date: Thu, 30 Oct 2008 15:52:35 UTC Original-Xref: news.stanford.edu gnu.emacs.help:163917 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:59262 Archived-At: On 30 Oct 2008, Alex Bennee wrote: > 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). htmlize.el works, but it might be overkill for what you want. I have used that to get code onto blog posts in Wordpress but I still end up massaging it a fair bit. http://www.emacswiki.org/emacs/Htmlize Check out the other possibilities on that page as well. -- Charles Sebold 30th of October, 2008