Indent/Format the whole buffer in Emacs

February 8th, 2010

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.

(defun indent-buffer ()
    "Indent the current buffer"
    (interactive)
    (save-excursion (indent-region (point-min) (point-max) nil))
)

I found the above function at http://www.emacswiki.org/cgi-bin/wiki/ReformatBuffer

Recently I noticed that it was leaving tabs in (which I hate) and trailing spaces.  It was simply just indenting the buffer.

After some more searching today I found the untabify command and I created the following commands.  Mainly because I expected the command to be called something like tab-???

(defun untabify-buffer ()
    "Untabify current buffer"
    (interactive)
    (save-excursion (untabify (point-min) (point-max)))
)
 
(defun tab-to-spaces ()
    "Convert tab to spaces"
    (interactive)
    (save-excursion (untabify (point-min) (point-max)))
)

I then found this page, http://emacsblog.org/2007/01/17/indent-whole-buffer/ which has the best indent/format buffer function.

(defun indent-buffer-2 ()
    "Indent the buffer 2"
    (interactive)
    (save-excursion
        (delete-trailing-whitespace)
        (indent-region (point-min) (point-max) nil)
        (untabify (point-min) (point-max))
    )
)

St Anton 2010 Photographs

January 26th, 2010

I uploaded the photographs from our St Anton 2010 snowboarding trip.

Everyone survived with no broken bones.

The complete gallery is here

Bruges 2009 Photographs

December 12th, 2009

I finally got around to uploading all the photographs from Bruges (Brugge).

Steve and I spent 3 days there on the way back from the UK in September.

The full gallery is here

We didn’t see any midgets though.

Steves Volksfest Photos 2009

September 29th, 2009

Well Steves Volksfest photos are online.

голова болит секс

голова болит секс голова болит секс голова болит секс

You can view them here

Bobbahn 2008 videos back

August 21st, 2009

Well after the bobbahn videos from 2008 vanished from facebook, I have added them to stokebloke.

The videos were take at Seewald Freizeitpark Enzklösterle

голова болит секс

Woody and Coz

This is a cool video of Woody and Coz bombing down the bobbahn.

View the video here

лесбиянки фото

Steve

This is a video of Steve flying down. голова болит секс

View the video here голова болит секс голова болит секс