Daniel Doherty writes: > I have attached a small file that demonstrates the problem, which > appears to happen following a here-doc. Can't reproduce with recent ruby-mode. The version string below shows you're using an Emacs that's older than even the current stable version (24.2). Could you try with a version from from emacs24 or trunk? > In GNU Emacs 24.1.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) > of 2012-08-17 on saturn If obtaining the full build is too much trouble, you can download and evaluate just ruby-mode.el: http://bzr.savannah.gnu.org/lh/emacs/trunk/files/head:/lisp/progmodes/ (the download buttons are in the rightmost column) Also please check that you're not using "ruby-mode 1.1" from Marmalade. Evaluating (find-library-name "ruby-mode") should return a path inside the Emacs tree. Attaching your example file after reindenting (C-x h C-M-\).