aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/indent.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/indent.el b/lisp/indent.el
index 89c75472bc3..6c2f1462de9 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -43,17 +43,18 @@ Function to indent current line.")
43 "Indent line in proper way for current major mode." 43 "Indent line in proper way for current major mode."
44 (interactive "P") 44 (interactive "P")
45 (if (eq indent-line-function 'indent-to-left-margin) 45 (if (eq indent-line-function 'indent-to-left-margin)
46 (insert-tab) 46 (insert-tab prefix-arg)
47 (if prefix-arg 47 (if prefix-arg
48 (funcall indent-line-function prefix-arg) 48 (funcall indent-line-function prefix-arg)
49 (funcall indent-line-function)))) 49 (funcall indent-line-function))))
50 50
51(defun insert-tab () 51(defun insert-tab (&optional prefix-arg)
52 (if abbrev-mode 52 (let ((count (prefix-numeric-value prefix-arg)))
53 (expand-abbrev)) 53 (if abbrev-mode
54 (if indent-tabs-mode 54 (expand-abbrev))
55 (insert ?\t) 55 (if indent-tabs-mode
56 (indent-to (* tab-width (1+ (/ (current-column) tab-width)))))) 56 (insert ?\t count)
57 (indent-to (* tab-width (+ count (/ (current-column) tab-width)))))))
57 58
58(defun indent-rigidly (start end arg) 59(defun indent-rigidly (start end arg)
59 "Indent all lines starting in the region sideways by ARG columns. 60 "Indent all lines starting in the region sideways by ARG columns.