aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/indent.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/indent.el b/lisp/indent.el
index ccf0e99c08b..400280f615a 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -142,13 +142,11 @@ prefix argument is ignored."
142 (old-indent (current-indentation))) 142 (old-indent (current-indentation)))
143 143
144 ;; Indent the line. 144 ;; Indent the line.
145 (or (not (eq (funcall indent-line-function) 'noindent)) 145 (or (not (eq (indent--funcall-widened indent-line-function) 'noindent))
146 (indent--default-inside-comment) 146 (indent--default-inside-comment)
147 (when (or (<= (current-column) (current-indentation)) 147 (when (or (<= (current-column) (current-indentation))
148 (not (eq tab-always-indent 'complete))) 148 (not (eq tab-always-indent 'complete)))
149 (save-restriction 149 (indent--funcall-widened (default-value 'indent-line-function))))
150 (widen)
151 (funcall (default-value 'indent-line-function)))))
152 150
153 (cond 151 (cond
154 ;; If the text was already indented right, try completion. 152 ;; If the text was already indented right, try completion.
@@ -170,6 +168,11 @@ prefix argument is ignored."
170 (< (point) end-marker)) 168 (< (point) end-marker))
171 (indent-rigidly (point) end-marker indentation-change)))))))))) 169 (indent-rigidly (point) end-marker indentation-change))))))))))
172 170
171(defun indent--funcall-widened (func)
172 (save-restriction
173 (widen)
174 (funcall func)))
175
173(defun insert-tab (&optional arg) 176(defun insert-tab (&optional arg)
174 (let ((count (prefix-numeric-value arg))) 177 (let ((count (prefix-numeric-value arg)))
175 (if (and abbrev-mode 178 (if (and abbrev-mode