From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#9158: 24.0.50; Regression in e-mail heade completion Date: Fri, 21 Oct 2011 18:57:04 -0400 Message-ID: References: <87fwlxgcwq.fsf@kanis.fr> <87wrdt4txa.fsf@kanis.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1319237877 7832 80.91.229.12 (21 Oct 2011 22:57:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 21 Oct 2011 22:57:57 +0000 (UTC) Cc: 9158@debbugs.gnu.org To: Ivan Kanis Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 22 00:57:51 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RHO2B-0007Cw-0D for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Oct 2011 00:57:51 +0200 Original-Received: from localhost ([::1]:43476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHO2A-0000Dk-DH for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Oct 2011 18:57:50 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHO27-0000Df-Ku for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2011 18:57:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RHO26-00084d-Fr for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2011 18:57:47 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHO26-00084U-8t for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2011 18:57:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RHO3K-00033P-2s for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2011 18:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Oct 2011 22:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9158 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 9158-submit@debbugs.gnu.org id=B9158.131923791211697 (code B ref 9158); Fri, 21 Oct 2011 22:59:01 +0000 Original-Received: (at 9158) by debbugs.gnu.org; 21 Oct 2011 22:58:32 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RHO2q-00032a-62 for submit@debbugs.gnu.org; Fri, 21 Oct 2011 18:58:32 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RHO2l-00032I-Ai for 9158@debbugs.gnu.org; Fri, 21 Oct 2011 18:58:29 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsFAO73oU5MCqLO/2dsb2JhbABDpxiCBoEGgW4BAQQBViMQCzQSFBgNJIgTs36IQAShMoRF X-IronPort-AV: E=Sophos;i="4.69,388,1315195200"; d="scan'208";a="143662539" Original-Received: from 76-10-162-206.dsl.teksavvy.com (HELO pastel.home) ([76.10.162.206]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 21 Oct 2011 18:57:04 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 1561959154; Fri, 21 Oct 2011 18:57:04 -0400 (EDT) In-Reply-To: <87wrdt4txa.fsf@kanis.fr> (Ivan Kanis's message of "Wed, 31 Aug 2011 15:00:49 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 21 Oct 2011 18:59:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:53009 Archived-At: >>> I get the message "completion for "foo" unfound" which is fine. The bug >>> is that the cursor moves forward several spaces. Apparently >>> indent-relative gets called when it shouldn't. >>> I expected the cursor to remain at the end of the entry that did not >>> match. It worked fine on 23.3. >> The way the new code works can't handle this correctly because the BBDB >> code doesn't indicate that something happened: it just always returns nil >> whether something was done or not. >> The new BBDB-3 has fixed this, AFAIK, so you may want to try that out. > I have just installed bbdb 3. It doesn't fix it. I'll reopen the bug > because it's a regression. After looking into it some more, I realized that it's actually behaving as designed, but not as documented in the docstring. Could you try the patch below? Stefan === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2011-10-11 13:02:03 +0000 +++ lisp/gnus/message.el 2011-10-21 22:54:20 +0000 @@ -7892,7 +7892,11 @@ (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))))) (defun message-debbugs-completion () (save-excursion