From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87050 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: message-completion-alist and message-expand-name Date: Tue, 17 May 2016 12:01:58 +0800 Message-ID: <87mvnp8h8p.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1463457804 11105 80.91.229.3 (17 May 2016 04:03:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 May 2016 04:03:24 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M35271@lists.math.uh.edu Tue May 17 06:03:12 2016 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b2WDv-0000Br-3K for ding-account@gmane.org; Tue, 17 May 2016 06:03:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.86_2) (envelope-from ) id 1b2WD5-0006bv-0A; Mon, 16 May 2016 23:02:19 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1b2WD1-0006bH-5n for ding@lists.math.uh.edu; Mon, 16 May 2016 23:02:15 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_2) (envelope-from ) id 1b2WCz-00010b-9S for ding@lists.math.uh.edu; Mon, 16 May 2016 23:02:15 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1b2WCx-0006cR-Ri for ding@gnus.org; Tue, 17 May 2016 06:02:11 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b2WCv-0008Lk-I8 for ding@gnus.org; Tue, 17 May 2016 06:02:10 +0200 Original-Received: from 123.116.192.70 ([123.116.192.70]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 May 2016 06:02:09 +0200 Original-Received: from eric by 123.116.192.70 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 May 2016 06:02:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 123.116.192.70 User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:hV/NRm7BJ0yd0iCsXaHpHNCcaWo= X-Spam-Score: 0.2 (/) X-Spam-Report: SpamAssassin (3.4.1 2015-04-28) analysis follows Bayesian score: 0.0949 Ham tokens: 0.000-14--648h-0s--0d--H*M:fsf, 0.000-13--613h-0s--0d--H*MI:fsf, 0.000-13--577h-0s--0d--H*UA:Emacs, 0.000-13--574h-0s--0d--H*u:Emacs, 0.000-10--471h-0s--0d--H*UA:Gnus Spam tokens: 0.995-1869--55h-1223s--0d--H*RT:sk:junkmas, 0.995-1869--55h-1223s--0d--HX-Envelope-From:sk:junkmas, 0.995-1869--55h-1223s--0d--Hx-spam-relays-internal:sk:junkmas, 0.993-18614--714h-12286s--0d--HTo:D*gnus.org, 0.993-19563--809h-12950s--0d--Hx-spam-relays-external:quimby.gnus.org Autolearn status: ham autolearn_force=no -1.0 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [80.91.229.3 listed in list.dnswl.org] 1.2 RCVD_NUMERIC_HELO Received: contains an IP address used for HELO -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 BAYES_20 BODY: Bayes spam probability is 5 to 20% [score: 0.0949] 1.5 FSL_HELO_BARE_IP_2 No description available. List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87050 Archived-At: Hi, I'm working on a contact management package, and trying to make it work with message-mode header completion. Right now, it looks like header completion works at two levels: First the header point is in is looked up in `message-completion-alist', and the function found in that alist is called. In the To/Cc/Bcc/etc headers, the function that's found is `message-expand-name'. That function looks in the variable `message-expand-name-databases', and tries to use a completion function from there. `message-expand-name-databases' is a customization option, which is a bit deceptive since `message-expand-name' only checks for the values of 'eudc and 'bbdb, and ignores anything else in there. Right now, if I want my contacts package to provide mail completion in message-mode, I seem to have three options: 1. Use a hook to override the binding of TAB in message-mode. 2. Use a hook to fudge `message-completion-alist' so that completion in To/Cc/Bcc headers calls my own completion function instead of `message-expand-name'. 3. Change `message-expand-name' so that it will check an alist of arbitrary values, and use whichever one is fboundp. Then add '(mypkg . mypkg-complete-name) to `message-expand-name-databases'. Does anyone have any thoughts on this? I think option three makes the most logical sense -- after all, I want `message-expand-name' to expand a name, and having my own function in `message-expand-name-databases' seems like TRT. Hardcoding to 'eudc or 'bbdb seems like an unnecessary restriction. If that seems to make sense, I can make a patch to message.el... Thanks, Eric