From 1d1c5af904afe595cee12cd6c05e60694111cce5 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 20 Sep 2004 16:09:32 +0000 Subject: [PATCH] (move-to-left-margin): Special case for minibuffer. --- lisp/indent.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/indent.el b/lisp/indent.el index 2d223b05ad6..3f423adbace 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -164,14 +164,18 @@ interactively or with optional argument FORCE, it will be fixed." (interactive (list (prefix-numeric-value current-prefix-arg) t)) (beginning-of-line n) (skip-chars-forward " \t") - (let ((lm (current-left-margin)) - (cc (current-column))) - (cond ((> cc lm) - (if (> (move-to-column lm force) lm) - ;; If lm is in a tab and we are not forcing, move before tab - (backward-char 1))) - ((and force (< cc lm)) - (indent-to-left-margin))))) + (if (minibufferp (current-buffer)) + (if (save-excursion (beginning-of-line) (bobp)) + (goto-char (minibuffer-prompt-end)) + (beginning-of-line)) + (let ((lm (current-left-margin)) + (cc (current-column))) + (cond ((> cc lm) + (if (> (move-to-column lm force) lm) + ;; If lm is in a tab and we are not forcing, move before tab + (backward-char 1))) + ((and force (< cc lm)) + (indent-to-left-margin)))))) ;; This used to be the default indent-line-function, ;; used in Fundamental Mode, Text Mode, etc. -- 2.39.2