diff options
| -rw-r--r-- | lisp/indent.el | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/lisp/indent.el b/lisp/indent.el index 89de0a1d7d1..f64049d64b2 100644 --- a/lisp/indent.el +++ b/lisp/indent.el | |||
| @@ -170,8 +170,7 @@ prefix argument is ignored." | |||
| 170 | (t | 170 | (t |
| 171 | (let ((old-tick (buffer-chars-modified-tick)) | 171 | (let ((old-tick (buffer-chars-modified-tick)) |
| 172 | (old-point (point)) | 172 | (old-point (point)) |
| 173 | (old-indent (current-indentation)) | 173 | (old-indent (current-indentation))) |
| 174 | (syn (syntax-after (point)))) | ||
| 175 | 174 | ||
| 176 | ;; Indent the line. | 175 | ;; Indent the line. |
| 177 | (or (not (eq (indent--funcall-widened indent-line-function) 'noindent)) | 176 | (or (not (eq (indent--funcall-widened indent-line-function) 'noindent)) |
| @@ -185,19 +184,14 @@ prefix argument is ignored." | |||
| 185 | ((and (eq tab-always-indent 'complete) | 184 | ((and (eq tab-always-indent 'complete) |
| 186 | (eql old-point (point)) | 185 | (eql old-point (point)) |
| 187 | (eql old-tick (buffer-chars-modified-tick)) | 186 | (eql old-tick (buffer-chars-modified-tick)) |
| 188 | (or (null tab-first-completion) | 187 | (or (eq last-command this-command) |
| 189 | (eq last-command this-command) | 188 | (let ((syn (syntax-class (syntax-after (point))))) |
| 190 | (and (eq tab-first-completion 'eol) | 189 | (pcase tab-first-completion |
| 191 | (eolp)) | 190 | ('nil t) |
| 192 | (and (memq tab-first-completion | 191 | ('eol (eolp)) |
| 193 | '(word word-or-paren word-or-paren-or-punct)) | 192 | ('word (not (eql 2 syn))) |
| 194 | (not (eql 2 syn))) | 193 | ('word-or-paren (not (memql syn '(2 4 5)))) |
| 195 | (and (memq tab-first-completion | 194 | ('word-or-paren-or-punct (not (memq syn '(2 4 5 1)))))))) |
| 196 | '(word-or-paren word-or-paren-or-punct)) | ||
| 197 | (not (or (eql 4 syn) | ||
| 198 | (eql 5 syn)))) | ||
| 199 | (and (eq tab-first-completion 'word-or-paren-or-punct) | ||
| 200 | (not (eql 1 syn))))) | ||
| 201 | (completion-at-point)) | 195 | (completion-at-point)) |
| 202 | 196 | ||
| 203 | ;; If a prefix argument was given, rigidly indent the following | 197 | ;; If a prefix argument was given, rigidly indent the following |