(t
(let ((old-tick (buffer-chars-modified-tick))
(old-point (point))
- (old-indent (current-indentation))
- (syn (syntax-after (point))))
+ (old-indent (current-indentation)))
;; Indent the line.
(or (not (eq (indent--funcall-widened indent-line-function) 'noindent))
((and (eq tab-always-indent 'complete)
(eql old-point (point))
(eql old-tick (buffer-chars-modified-tick))
- (or (null tab-first-completion)
- (eq last-command this-command)
- (and (eq tab-first-completion 'eol)
- (eolp))
- (and (memq tab-first-completion
- '(word word-or-paren word-or-paren-or-punct))
- (not (eql 2 syn)))
- (and (memq tab-first-completion
- '(word-or-paren word-or-paren-or-punct))
- (not (or (eql 4 syn)
- (eql 5 syn))))
- (and (eq tab-first-completion 'word-or-paren-or-punct)
- (not (eql 1 syn)))))
+ (or (eq last-command this-command)
+ (let ((syn (syntax-class (syntax-after (point)))))
+ (pcase tab-first-completion
+ ('nil t)
+ ('eol (eolp))
+ ('word (not (eql 2 syn)))
+ ('word-or-paren (not (memql syn '(2 4 5))))
+ ('word-or-paren-or-punct (not (memq syn '(2 4 5 1))))))))
(completion-at-point))
;; If a prefix argument was given, rigidly indent the following