]> git.eshelyaron.com Git - emacs.git/commitdiff
(indent-to-left-margin): If point's in the indentation,
authorRichard M. Stallman <rms@gnu.org>
Wed, 24 Oct 2007 08:10:57 +0000 (08:10 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 24 Oct 2007 08:10:57 +0000 (08:10 +0000)
move to the end of the indentation.

lisp/indent.el

index a005abebee55e5de13b6a14984cc28d048743619..3c51b4f37a840397dd2eb5f5245cfe0437866d71 100644 (file)
@@ -184,7 +184,12 @@ interactively or with optional argument FORCE, it will be fixed."
 ;; 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.