diff options
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 810fc95614d..89d5659f300 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -748,14 +748,12 @@ function is `common-lisp-indent-function'." | |||
| 748 | :type 'function | 748 | :type 'function |
| 749 | :group 'lisp) | 749 | :group 'lisp) |
| 750 | 750 | ||
| 751 | (defun lisp-indent-line (&optional _whole-exp) | 751 | (defun lisp-indent-line () |
| 752 | "Indent current line as Lisp code. | 752 | "Indent current line as Lisp code." |
| 753 | With argument, indent any additional lines of the same expression | 753 | (interactive) |
| 754 | rigidly along with this one." | 754 | (let ((indent (calculate-lisp-indent)) |
| 755 | (interactive "P") | 755 | (pos (- (point-max) (point)))) |
| 756 | (let ((indent (calculate-lisp-indent)) shift-amt | 756 | (beginning-of-line) |
| 757 | (pos (- (point-max) (point))) | ||
| 758 | (beg (progn (beginning-of-line) (point)))) | ||
| 759 | (skip-chars-forward " \t") | 757 | (skip-chars-forward " \t") |
| 760 | (if (or (null indent) (looking-at "\\s<\\s<\\s<")) | 758 | (if (or (null indent) (looking-at "\\s<\\s<\\s<")) |
| 761 | ;; Don't alter indentation of a ;;; comment line | 759 | ;; Don't alter indentation of a ;;; comment line |
| @@ -767,11 +765,7 @@ rigidly along with this one." | |||
| 767 | ;; as comment lines, not as code. | 765 | ;; as comment lines, not as code. |
| 768 | (progn (indent-for-comment) (forward-char -1)) | 766 | (progn (indent-for-comment) (forward-char -1)) |
| 769 | (if (listp indent) (setq indent (car indent))) | 767 | (if (listp indent) (setq indent (car indent))) |
| 770 | (setq shift-amt (- indent (current-column))) | 768 | (indent-line-to indent)) |
| 771 | (if (zerop shift-amt) | ||
| 772 | nil | ||
| 773 | (delete-region beg (point)) | ||
| 774 | (indent-to indent))) | ||
| 775 | ;; If initial point was within line's indentation, | 769 | ;; If initial point was within line's indentation, |
| 776 | ;; position after the indentation. Else stay at same point in text. | 770 | ;; position after the indentation. Else stay at same point in text. |
| 777 | (if (> (- (point-max) pos) (point)) | 771 | (if (> (- (point-max) pos) (point)) |