From caadec436df8b452370bd24187ef56b90bf55918 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 24 Oct 2007 08:10:57 +0000 Subject: [PATCH] (indent-to-left-margin): If point's in the indentation, move to the end of the indentation. --- lisp/indent.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/indent.el b/lisp/indent.el index a005abebee5..3c51b4f37a8 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -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. -- 2.39.2