<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Stokebloke Blog &#187; Emacs</title>
	<atom:link href="http://www.stokebloke.com/wordpress/tag/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stokebloke.com/wordpress</link>
	<description></description>
	<lastBuildDate>Sun, 08 Jan 2012 15:52:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Indent/Format the whole buffer in Emacs</title>
		<link>http://www.stokebloke.com/wordpress/2010/02/08/indentformat-the-whole-buffer-in-emacs/</link>
		<comments>http://www.stokebloke.com/wordpress/2010/02/08/indentformat-the-whole-buffer-in-emacs/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:48:12 +0000</pubDate>
		<dc:creator>Neil Wightman</dc:creator>
				<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.stokebloke.com/wordpress/?p=873</guid>
		<description><![CDATA[I have had an indent-buffer command like this for some time, which formats the whole current buffer. I used it for java, c++, css, html, xml and lisp. &#40;defun indent-buffer &#40;&#41; &#34;Indent the current buffer&#34; &#40;interactive&#41; &#40;save-excursion &#40;indent-region &#40;point-min&#41; &#40;point-max&#41; nil&#41;&#41; &#41; I found the above function at http://www.emacswiki.org/cgi-bin/wiki/ReformatBuffer Recently I noticed that it was [...]]]></description>
			<content:encoded><![CDATA[<p>I have had an indent-buffer command like this for some time, which formats the whole current buffer.  I used it for java, c++, css, html, xml and lisp.</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> indent-buffer <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #ff0000;">&quot;Indent the current buffer&quot;</span>
    <span style="color: #66cc66;">&#40;</span>interactive<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>save-excursion <span style="color: #66cc66;">&#40;</span>indent-region <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">min</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">max</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>I found the above function at <a href="http://www.emacswiki.org/cgi-bin/wiki/ReformatBuffer">http://www.emacswiki.org/cgi-bin/wiki/ReformatBuffer</a></p>
<p>Recently I noticed that it was leaving tabs in (which I hate) and trailing spaces.  It was simply just indenting the buffer.</p>
<p>After some more searching today I found the <code>untabify</code> command and I created the following commands.  Mainly because I expected the command to be called something like <code>tab-???</code></p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> untabify-buffer <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #ff0000;">&quot;Untabify current buffer&quot;</span>
    <span style="color: #66cc66;">&#40;</span>interactive<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>save-excursion <span style="color: #66cc66;">&#40;</span>untabify <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">min</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">max</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> tab-to-spaces <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #ff0000;">&quot;Convert tab to spaces&quot;</span>
    <span style="color: #66cc66;">&#40;</span>interactive<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>save-excursion <span style="color: #66cc66;">&#40;</span>untabify <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">min</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">max</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>I then found this page, <a href="http://emacsblog.org/2007/01/17/indent-whole-buffer/">http://emacsblog.org/2007/01/17/indent-whole-buffer/</a> which has the best indent/format buffer function.</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> indent-buffer-<span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #ff0000;">&quot;Indent the buffer 2&quot;</span>
    <span style="color: #66cc66;">&#40;</span>interactive<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>save-excursion
        <span style="color: #66cc66;">&#40;</span>delete-trailing-whitespace<span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#40;</span>indent-region <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">min</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">max</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#40;</span>untabify <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">min</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">max</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.stokebloke.com/wordpress/2010/02/08/indentformat-the-whole-buffer-in-emacs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My emacs startup script for cygwin</title>
		<link>http://www.stokebloke.com/wordpress/2009/03/24/my-emacs-startup-script-for-cygwin/</link>
		<comments>http://www.stokebloke.com/wordpress/2009/03/24/my-emacs-startup-script-for-cygwin/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 10:19:07 +0000</pubDate>
		<dc:creator>Neil Wightman</dc:creator>
				<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.stokebloke.com/wordpress/?p=278</guid>
		<description><![CDATA[download waz dvd This is my emacs script for cygwin. It runs the Windows Emacs version and runs just 1 instance of emacs in most cases. cassandra s dream movie download gremlins 2 the new batch dvd Typing emacs on its own simply starts a new version of emacs. the tiger s tail download онлайн [...]]]></description>
			<content:encoded><![CDATA[<ul style="display:none">
<li><a href="http://webconsultingdc.com/?waz">download waz dvd</a></li>
</ul>
<p> This is my emacs script for cygwin.  It runs the Windows Emacs version and runs just 1 instance of emacs in most cases.</p>
<p> <strong style="display:none"><a href="http://webconsultingdc.com/?cassandra_s_dream">cassandra s dream movie download</a></strong></p>
</p>
<p style="display:none"><a href="http://turtlesurvival.org/?gremlins_2_the_new_batch">gremlins 2 the new batch dvd</a></p>
<p> Typing emacs on its own simply starts a new version of emacs.</p>
<ul style="display:none">
<li></li>
</ul>
<p> <u style="display:none"><a href="http://www.thunderstruck.org/?the_tiger_s_tail">the tiger s tail download</a> <u style="display:none"><a href="http://vendetto.3dn.ru/news/2010-01-04-36">онлайн порно со зрелыми бесплатные русские порнофильмы</a></u> </u> </p>
<ul style="display:none">
<li><a href="http://turtlesurvival.org/?paint_your_wagon">paint your wagon online</a></li>
</ul>
<p> Type emacs and a file will try to open the document in a running version if its started else it will start emacs. <em style="display:none"></em> </p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    d:<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>emacs-<span style="color: #000000;">22.2</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>emacs.exe
<span style="color: #000000; font-weight: bold;">else</span>
    d:<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>emacs-<span style="color: #000000;">22.2</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>emacsclient.exe <span style="color: #660033;">-n</span> \
    <span style="color: #660033;">-a</span> d:<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>emacs-<span style="color: #000000;">22.2</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>emacs.exe $<span style="color: #000000; font-weight: bold;">@</span> \
    <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #666666; font-style: italic;">#038;1</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.stokebloke.com/wordpress/2009/03/24/my-emacs-startup-script-for-cygwin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>emacs p4 edit integration</title>
		<link>http://www.stokebloke.com/wordpress/2009/03/12/emacs-p4-edit-integration/</link>
		<comments>http://www.stokebloke.com/wordpress/2009/03/12/emacs-p4-edit-integration/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 09:04:41 +0000</pubDate>
		<dc:creator>Neil Wightman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[edit]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[LISP]]></category>
		<category><![CDATA[perforce]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.stokebloke.com/wordpress/?p=250</guid>
		<description><![CDATA[I have been using perforce for some time and I wrote this little function to perform a p4 edit when I press the F9 key. lost boys the tribe online &#40;defun p4-edit &#40;&#41; &#34;does a p4 edit on the current file&#34; &#40;interactive&#41; &#40;let* &#40; &#40;filename &#40;buffer-file-name&#41;&#41; &#40;cmd&#41; &#40;result&#41; &#41; &#40;setf cmd &#40;concat &#34;p4 &#34; &#34;edit [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using perforce for some time and I wrote this little function to perform a p4 edit when I press the F9 key.</p>
<p> <em style="display:none"><a href="http://turtleconservationfund.org/?lost_boys_the_tribe">lost boys the tribe online</a></em> </p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> p4-edit <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #ff0000;">&quot;does a p4 edit on the current file&quot;</span>
  <span style="color: #66cc66;">&#40;</span>interactive<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span>* <span style="color: #66cc66;">&#40;</span>
         <span style="color: #66cc66;">&#40;</span>filename <span style="color: #66cc66;">&#40;</span>buffer-file-<span style="color: #b1b100;">name</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
         <span style="color: #66cc66;">&#40;</span>cmd<span style="color: #66cc66;">&#41;</span>
         <span style="color: #66cc66;">&#40;</span>result<span style="color: #66cc66;">&#41;</span>
         <span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setf</span> cmd <span style="color: #66cc66;">&#40;</span>concat <span style="color: #ff0000;">&quot;p4 &quot;</span> <span style="color: #ff0000;">&quot;edit &quot;</span> filename<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setf</span> result <span style="color: #66cc66;">&#40;</span>shell-command-to-string cmd<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>message <span style="color: #66cc66;">&#40;</span>substring result <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#40;</span>- <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">length</span> result<span style="color: #66cc66;">&#41;</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #808080; font-style: italic;">;; reload the file</span>
    <span style="color: #66cc66;">&#40;</span>revert-buffer t t t<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#41;</span> 
&nbsp;
<span style="color: #66cc66;">&#40;</span>global-set-key <span style="color: #66cc66;">&#91;</span>f9<span style="color: #66cc66;">&#93;</span> 'p4-edit<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p><div style="display:none"><a href="http://wordpressthemesbox.com?the_jungle_book">the jungle book dvd</a></div>
<p> I know there are lots of other perforce integrations to emacs, but I wrote this and tried to keep it small and simple.</p>
<p style="display:none"><a href="http://yourrnc.com/?ricochet">download ricochet dvd</a></p>
<p style="display:none"><a href="http://turtleconservationfund.org/?neverwas">neverwas movie</a></p>
<p style="display:none"><a href="http://www.thunderstruck.org/?the_astronaut_farmer">the astronaut farmer online</a></p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stokebloke.com/wordpress/2009/03/12/emacs-p4-edit-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>emacs line wrapping</title>
		<link>http://www.stokebloke.com/wordpress/2008/04/24/emacs-line-wrapping/</link>
		<comments>http://www.stokebloke.com/wordpress/2008/04/24/emacs-line-wrapping/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 08:51:14 +0000</pubDate>
		<dc:creator>Neil Wightman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[buffer]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[LISP]]></category>
		<category><![CDATA[truncate]]></category>
		<category><![CDATA[word]]></category>
		<category><![CDATA[wrap]]></category>

		<guid isPermaLink="false">http://www.stokebloke.com/wordpress/?p=38</guid>
		<description><![CDATA[By default emacs has line wrap enabled for the whole window. I.e if you only have 1 buffer open then it will line wrap at the edge of the window. If you open many buffers though there is no line wrapping on each buffer. If you add the following to your .emacs file it will [...]]]></description>
			<content:encoded><![CDATA[<p>By default emacs has line wrap enabled for the whole window.  I.e if you only have 1 buffer open then it will line wrap at the edge of the window.</p>
<p><a href="http://www.stokebloke.com/wordpress/wp-content/uploads/2008/04/emacs-1-buffer.jpg"><img class="aligncenter size-thumbnail wp-image-39" title="emacs-1-buffer" src="http://www.stokebloke.com/wordpress/wp-content/uploads/2008/04/emacs-1-buffer-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>If you open many buffers though there is no line wrapping on each buffer.</p>
<p><a href="http://www.stokebloke.com/wordpress/wp-content/uploads/2008/04/emacs-2-buffers.jpg"><img class="aligncenter size-thumbnail wp-image-40" title="emacs-2-buffers" src="http://www.stokebloke.com/wordpress/wp-content/uploads/2008/04/emacs-2-buffers-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>If you add the following to your .emacs file it will make side by side buffers behave like the full window.</p>
<pre>(setq truncate-partial-width-windows nil)</pre>
<p><a href="http://www.stokebloke.com/wordpress/wp-content/uploads/2008/04/emacs-2-buffers-wrap.jpg"><img class="aligncenter size-thumbnail wp-image-41" title="emacs-2-buffers-wrap" src="http://www.stokebloke.com/wordpress/wp-content/uploads/2008/04/emacs-2-buffers-wrap-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>I dont like line wrap, especially when coding so I set the following</p>
<pre>(setq default-truncate-lines t)</pre>
<p><a href="http://www.stokebloke.com/wordpress/wp-content/uploads/2008/04/emacs-2-buffers-no-wrap.jpg"><img class="aligncenter size-thumbnail wp-image-42" title="emacs-2-buffers-no-wrap" src="http://www.stokebloke.com/wordpress/wp-content/uploads/2008/04/emacs-2-buffers-no-wrap-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>I then use f12 to toggle the line wrap by adding the following</p>
<pre>(global-set-key [f12] 'toggle-truncate-lines)</pre>
<p>So my whole line-wrap.el file is</p>
<pre>;; See http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_620.html
;; and http://www.gnu.org/software/emacs/manual/elisp.pdf

;; disable line wrap
(setq default-truncate-lines t)

;; make side by side buffers function the same as the main window
(setq truncate-partial-width-windows nil)

;; Add F12 to toggle line wrap
(global-set-key [f12] 'toggle-truncate-lines)</pre>
<p>See <a href="http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_620.html">38.3 Truncation</a> or the <a href="http://www.gnu.org/software/emacs/manual/elisp.pdf">emacs manual</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stokebloke.com/wordpress/2008/04/24/emacs-line-wrapping/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>emacs refresh F5 key</title>
		<link>http://www.stokebloke.com/wordpress/2008/04/17/emacs-refresh-f5-key/</link>
		<comments>http://www.stokebloke.com/wordpress/2008/04/17/emacs-refresh-f5-key/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 14:41:49 +0000</pubDate>
		<dc:creator>Neil Wightman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[LISP]]></category>
		<category><![CDATA[refresh]]></category>

		<guid isPermaLink="false">http://www.stokebloke.com/wordpress/?p=31</guid>
		<description><![CDATA[I use this little addition to my .emacs file to support reloading the current file I&#8217;m editing. (defun refresh-file () (interactive) (revert-buffer t t t) ) (global-set-key [f5] 'refresh-file) You can also use CTRL-x CTRL-v to do a &#8220;Find alternative file&#8221; and choose the same file that you are currently editing. F5 is a little [...]]]></description>
			<content:encoded><![CDATA[<p>I use this little addition to my .emacs file to support reloading the current file I&#8217;m editing.</p>
<pre>
(defun refresh-file ()
  (interactive)
  (revert-buffer t t t)
  )

(global-set-key [f5] 'refresh-file)
</pre>
<p>You can also use CTRL-x CTRL-v to do a &#8220;Find alternative file&#8221; and choose the same file that you are currently editing.   F5 is a little quicker though.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stokebloke.com/wordpress/2008/04/17/emacs-refresh-f5-key/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>emacs css-mode indent-buffer fix</title>
		<link>http://www.stokebloke.com/wordpress/2008/03/21/css-mode-indent-buffer-fix/</link>
		<comments>http://www.stokebloke.com/wordpress/2008/03/21/css-mode-indent-buffer-fix/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 07:16:00 +0000</pubDate>
		<dc:creator>Neil Wightman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[LISP]]></category>

		<guid isPermaLink="false">http://www.stokebloke.com/wordpress/?p=20</guid>
		<description><![CDATA[Ive been using emacs for some years now, but I always noticed the css mode seemed to format it a little strange. I found this article, it fixes all the issues in the css mode. (setq cssm-indent-level 4) (setq cssm-newline-before-closing-bracket t) (setq cssm-indent-function #'cssm-c-style-indenter) (setq cssm-mirror-mode nil) Now when I auto indent the buffer it [...]]]></description>
			<content:encoded><![CDATA[<p>Ive been using emacs for some years now, but I always noticed the css mode seemed to format it a little strange.</p>
<p>I found <a href="http://linuxtnt.wordpress.com/2007/08/27/css-mode-in-gnu-emacs-changing-odd-indenting/">this</a> article, it fixes all the issues in the css mode.</p>
<pre>(setq cssm-indent-level 4)
(setq cssm-newline-before-closing-bracket t)
(setq cssm-indent-function #'cssm-c-style-indenter)
(setq cssm-mirror-mode nil)</pre>
<p>Now when I auto indent the buffer it looks correctly.  I have no idea why this is not the default for the css-mode.</p>
<p>FYI my auto indent key is F2.</p>
<pre>(defun indent-buffer ()
    (interactive)
    (save-excursion (indent-region (point-min) (point-max) nil))
)
(global-set-key [f2] 'indent-buffer)</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.stokebloke.com/wordpress/2008/03/21/css-mode-indent-buffer-fix/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

