diff options
| author | Boris Goldowsky | 1995-03-16 22:36:26 +0000 |
|---|---|---|
| committer | Boris Goldowsky | 1995-03-16 22:36:26 +0000 |
| commit | ca2a3cb73fbd4f372825c0ed256cdb01577eca80 (patch) | |
| tree | 1cd38fe1e7e6dde6d605efbe0e5bb2b79ee92f89 | |
| parent | 475f903199bbb603461e326c72fda636497b1e21 (diff) | |
| download | emacs-ca2a3cb73fbd4f372825c0ed256cdb01577eca80.tar.gz emacs-ca2a3cb73fbd4f372825c0ed256cdb01577eca80.zip | |
(indent-line-to): move to end of indentation, even if it didn't change.
| -rw-r--r-- | lisp/indent.el | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/indent.el b/lisp/indent.el index d1777c8681a..59112846d79 100644 --- a/lisp/indent.el +++ b/lisp/indent.el | |||
| @@ -77,15 +77,13 @@ Called from a program, takes three arguments, START, END and ARG." | |||
| 77 | "Indent current line to COLUMN. | 77 | "Indent current line to COLUMN. |
| 78 | This function removes or adds spaces and tabs at beginning of line | 78 | This function removes or adds spaces and tabs at beginning of line |
| 79 | only if necessary. It leaves point at end of indentation." | 79 | only if necessary. It leaves point at end of indentation." |
| 80 | (beginning-of-line) | 80 | (back-to-indentation) |
| 81 | (let ((bol (point)) | 81 | (let ((cur-col (current-column))) |
| 82 | (cur-col (current-indentation))) | 82 | (cond ((< cur-col column) |
| 83 | (cond ((> cur-col column) ; too far right (after tab?) | 83 | (indent-to column)) |
| 84 | ((> cur-col column) ; too far right (after tab?) | ||
| 84 | (delete-region (progn (move-to-column column t) (point)) | 85 | (delete-region (progn (move-to-column column t) (point)) |
| 85 | (progn (back-to-indentation) (point)))) | 86 | (progn (back-to-indentation) (point))))))) |
| 86 | ((< cur-col column) | ||
| 87 | (back-to-indentation) | ||
| 88 | (indent-to column))))) | ||
| 89 | 87 | ||
| 90 | (defun current-left-margin () | 88 | (defun current-left-margin () |
| 91 | "Return the left margin to use for this line. | 89 | "Return the left margin to use for this line. |