# HG changeset patch # User Richard M. Stallman # Date 1193213457 0 # Node ID 24b435ba9bceb15087310b00d1d666e0441e3bb7 # Parent afa7fa1e71f42ddf1537ed75346fc346f39f5a4d (indent-to-left-margin): If point's in the indentation, move to the end of the indentation. diff -r afa7fa1e71f4 -r 24b435ba9bce lisp/indent.el --- a/lisp/indent.el Wed Oct 24 08:09:30 2007 +0000 +++ b/lisp/indent.el Wed Oct 24 08:10:57 2007 +0000 @@ -184,7 +184,12 @@ ;; used in Fundamental Mode, Text Mode, etc. (defun indent-to-left-margin () "Indent current line to the column given by `current-left-margin'." - (indent-line-to (current-left-margin))) + (save-excursion (indent-line-to (current-left-margin))) + ;; If we are within the indentation, move past it. + (when (save-excursion + (skip-chars-backward " \t") + (bolp)) + (skip-chars-forward " \t"))) (defun delete-to-left-margin (&optional from to) "Remove left margin indentation from a region.