From 6e724ca2c2e36dcd30803c314319b8faf8472e7d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 26 Oct 2011 13:27:51 -0400 Subject: [PATCH] * lisp/gnus/message.el: Don't insert TAB in headers with completion. (message-completion-function): Don't fallback on message-tab-body-function when message-completion-alist fails to find a completion. Fixes: debbugs:9158 --- lisp/gnus/ChangeLog | 8 +++++++- lisp/gnus/message.el | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 8b4e993149e..7519252f037 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2011-10-26 Stefan Monnier + + * message.el (message-completion-function): Make sure + message-tab-body-function is not attempted if one of + message-completion-alist fails to find a completion (bug#9158). + 2011-10-26 Daiki Ueno * mml.el (mml-quote-region): Quote <#secure> tag. @@ -7,7 +13,7 @@ * gnus-cite.el (gnus-message-citation-mode): Doc fix (in Emacs 24, calling a minor mode from Lisp with nil arg enables it, so we have to - make the working a bit ambiguous here). + make the wording a bit ambiguous here). 2011-10-18 Teodor Zlatanov diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 948892d1e13..723f8fb72b5 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -7888,7 +7888,11 @@ those headers." (let ((mail-abbrev-mode-regexp (caar alist))) (not (mail-abbrev-in-expansion-header-p)))) (setq alist (cdr alist))) - (cdar alist))) + (when (cdar alist) + (lexical-let ((fun (cdar alist))) + ;; Even if completion fails, return a non-nil value, so as to avoid + ;; falling back to message-tab-body-function. + (lambda () (funcall fun) 'completion-attempted))))) (eval-and-compile (condition-case nil -- 2.11.4.GIT