changeset 79191:24b435ba9bce

(indent-to-left-margin): If point's in the indentation, move to the end of the indentation.
author Richard M. Stallman <rms@gnu.org>
date Wed, 24 Oct 2007 08:10:57 +0000
parents afa7fa1e71f4
children 8f2e292b71d0
files lisp/indent.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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.