From 8afb0f0ec8e645b41c8da2a5d5156e63fc04bdbd Mon Sep 17 00:00:00 2001 From: Aymeric Agon-Rambosson Date: Tue, 14 Nov 2023 00:03:46 +0100 Subject: [PATCH] Repair tab-always-indent Take the values word, word-or-paren, word-or-paren-or-punct correctly into account in the function indent-for-tab-command : * syntax-after returns a list, not an integer, either memq or member must be used (partial revert of c7234011518). * the constraints on completion-at-point must be cumulative when we go from word to word-or-paren to word-or-paren-or-punct. Otherwise, tab always complete with values word-or-paren or word-or-paren-or-punct, which is not what the docstring seems to say --- lisp/indent.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/indent.el b/lisp/indent.el index 89de0a1d7d1..de8101dc76e 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -191,13 +191,17 @@ prefix argument is ignored." (eolp)) (and (memq tab-first-completion '(word word-or-paren word-or-paren-or-punct)) - (not (eql 2 syn))) + (not (memq 2 syn))) (and (memq tab-first-completion '(word-or-paren word-or-paren-or-punct)) - (not (or (eql 4 syn) - (eql 5 syn)))) + (not (or (memq 2 syn) + (memq 4 syn) + (memq 5 syn)))) (and (eq tab-first-completion 'word-or-paren-or-punct) - (not (eql 1 syn))))) + (not (or (memq 2 syn) + (memq 4 syn) + (memq 5 syn) + (memq 1 syn)))))) (completion-at-point)) ;; If a prefix argument was given, rigidly indent the following -- 2.39.2