diff options
author | Richard M. Stallman <rms@gnu.org> | 2007-10-24 08:10:57 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2007-10-24 08:10:57 +0000 |
commit | caadec436df8b452370bd24187ef56b90bf55918 (patch) | |
tree | e44f017667b97a41c0f648cad836a78d5f3282fd /lisp/indent.el | |
parent | 8c89fb87b43d3b95101e257681a42b498c85e1a4 (diff) | |
download | emacs-caadec436df8b452370bd24187ef56b90bf55918.tar.gz |
(indent-to-left-margin): If point's in the indentation,
move to the end of the indentation.
Diffstat (limited to 'lisp/indent.el')
-rw-r--r-- | lisp/indent.el | 7 |
1 files changed, 6 insertions, 1 deletions
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. |