If M-x align deletes a lot of whitespace doing its alignment it can get an "Invalid search bound" error. Eg. with foo.el below emacs -Q foo.el M-x end-of-buffer M-x align => Invalid search bound (wrong side of point) In `align-region' it seems `last-point' is established from `b' which is an integer buffer position but that position is invalidated by whitespace deletes before that point (done by `align-regions'). I get some joy from making the marker before changing the buffer, per below. Alternately (untested!) perhaps `b' could be a marker to start with, ready to be the new value of `last-point'. 2010-05-17 Kevin Ryde * align.el (align-region): For `last-point' take marker of b position before align-regions because that function inserts or deletes text before there. In particular fixes "Invalid search bound" when there's two sections in the region and alignment in the first deletes a lot of whitespace.