From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12951 invoked from network); 23 Jan 2023 14:07:00 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 23 Jan 2023 14:07:00 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pJxTN-00F0QF-Bz for ml@inbox.vuxu.org; Mon, 23 Jan 2023 08:06:57 -0600 Received: from lists1.math.uh.edu ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.96) (envelope-from ) id 1pJxTN-005kYx-07 for ml@inbox.vuxu.org; Mon, 23 Jan 2023 08:06:57 -0600 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtp (Exim 4.96) (envelope-from ) id 1pJxTG-005kYo-0f for ding@lists.math.uh.edu; Mon, 23 Jan 2023 08:06:51 -0600 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pJxTD-00CPkh-UH for ding@lists.math.uh.edu; Mon, 23 Jan 2023 08:06:49 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sg23XITV0PlztzTwkVvbM74/7Ukjm9MIRyrBCTzk4mM=; b=DXmCe6276rzW1R9ku9mgQYhcnk WjXJQ56sGB0HmP0+sxIb6ANy8oM4a4QbqGRDjI1OKAI6Q9yhLB5pcjno1kUhQNekSvg7cn0Ndw8vW ShhhkCNj42Dg+m3S4ajfe9orD+YnsyNYjstKrMfNlFORYjXaTX9qHAG9fcl84Wms4OBE=; Received: from eggs.gnu.org ([2001:470:142:3::10]) by quimby.gnus.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pJxT4-0005MX-JT for ding@gnus.org; Mon, 23 Jan 2023 15:06:42 +0100 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJxSw-00015s-9Q; Mon, 23 Jan 2023 09:06:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=sg23XITV0PlztzTwkVvbM74/7Ukjm9MIRyrBCTzk4mM=; b=iE7MZyahZbTD+JJnbCl4 76s25DfHH/A+lN3nTLHpHjlHhjKw4qMANN+xpIU9nYT+1E7O3hOe+uq9Zt33261pddA0IQOEoztuX e2sK7S7XtDRpPiHAucHz7kAdNGkIP+VPhWGdiPt5Lp45Wlvn0T6oBdrf6lXCaHijoDHGVGBFB6+5O fl89QvHUbWZHto4WTIvwP+0AUA3XquvIilihbm9S8YsRe6xP48lQ65y/rErQN8Ewdxv/mF2M4p4AO iKraFJajQrdbOleu6q+g+hVIea7I2XqxkAJoovm/m/SVazJ7CO92QtO2517cyJYYZNXaxCZBPm7xV /WZNpKxJyW2Rtw==; Received: from pd9fb7ab6.dip0.t-ipconnect.de ([217.251.122.182] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJxSu-0002Nq-Sh; Mon, 23 Jan 2023 09:06:30 -0500 From: Arash Esbati To: Julien Cubizolles Cc: ding@gnus.org, Thomas Fitzsimmons Subject: Re: completion no more working with latest HEADs (emacs and bbdb) In-Reply-To: <87ilgx8uh1.fsf@free.fr> (Julien Cubizolles's message of "Mon, 23 Jan 2023 10:34:50 +0100") References: <87r0y42vnh.fsf@a16n.net> <86edu3ibkp.fsf@gnu.org> <87leobgucs.fsf@a16n.net> <867czvi8d8.fsf@gnu.org> <87zgcrp63k.fsf@a16n.net> <86edu3m8fb.fsf@gnu.org> <87ilgx8uh1.fsf@free.fr> Date: Mon, 23 Jan 2023 15:05:20 +0100 Message-ID: <867cxdny73.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 MIME-Version: 1.0 Content-Type: text/plain List-ID: Precedence: bulk Julien Cubizolles writes: > It's not working in GNU Emacs 30.0.50 in emacs -Q with this setup and > your recipe: > > (setq eudc-server-hotlist '(("localhost" . bbdb))) > > (add-hook 'message-mode-hook > (lambda () > (setq-local completion-at-point-functions > (delq 'message-completion-function > completion-at-point-functions)))) > > Pressing TAB after typing the beginning of a name in the To: field only > inserts a tabulation, whereas (bbdb-complete-mail) finds several > matches. Thanks for reminding me; I can confirm this behavior and didn't look at it again back then. FTR, I have an entry for `eudc-capf-complete' in my `completion-at-point-functions' in message-mode. `eudc-capf-complete' calls `eudc-capf-message-expand-name' which is defined like this: --8<---------------cut here---------------start------------->8--- (defun eudc-capf-message-expand-name () "Email address completion function for `message-completion-alist'. [...]" (if (or eudc-server eudc-server-hotlist) (progn (let* ((beg (save-excursion (re-search-backward "\\([:,]\\|^\\)[ \t]*") (match-end 0))) ;; ^^^^^^^^ (end (point)) (prefix (save-excursion (buffer-substring-no-properties beg end)))) (let ((result (eudc-query-with-words (split-string prefix "[ \t]+") t))) (when result (list beg end (completion-table-with-cache (lambda (_) result) t)))))))) --8<---------------cut here---------------end--------------->8--- While searching back, it picks up the `match-end' which will not work for the case where you the beginning of the name in your BBDB database. A change like this should fix it: --8<---------------cut here---------------start------------->8--- (defun eudc-capf-message-expand-name () "Email address completion function for `message-completion-alist'. [...]" (if (or eudc-server eudc-server-hotlist) (progn (let* ((beg (save-excursion ;; change follows: (if (member (char-before) '(?, ?: ?\s)) (progn (re-search-backward "\\([:,]\\|\\^\\)[ \t]*") (match-end 0)) (skip-chars-backward "[:alnum:]" (line-beginning-position)) (point)))) (end (point)) (prefix (buffer-substring-no-properties beg end))) (let ((result (eudc-query-with-words (split-string prefix "[ \t]+") t))) (when result (list beg end (completion-table-with-cache (lambda (_) result) t)))))))) --8<---------------cut here---------------end--------------->8--- @Thomas: Can you please have a look at this issue? I think this is still related to bug#59314. TIA. Best, Arash