From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daimrod Subject: Re: [org-contacts] need help for making gnus/message-mode integration optional Date: Wed, 27 Feb 2013 13:39:50 +0100 Message-ID: <87ehg2lyll.fsf@tanger.home> References: <87fw0ivfbc.fsf@tu-dortmund.de> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAgI4-0006Dx-3U for emacs-orgmode@gnu.org; Wed, 27 Feb 2013 07:39:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAgI2-0005mD-8Y for emacs-orgmode@gnu.org; Wed, 27 Feb 2013 07:39:20 -0500 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:58613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAgI1-0005lw-Sj for emacs-orgmode@gnu.org; Wed, 27 Feb 2013 07:39:18 -0500 Received: by mail-we0-f179.google.com with SMTP id p43so437629wea.10 for ; Wed, 27 Feb 2013 04:39:16 -0800 (PST) In-Reply-To: <87fw0ivfbc.fsf@tu-dortmund.de> (Simon Campese's message of "Wed, 27 Feb 2013 00:13:59 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Simon Campese Cc: emacs-orgmode@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Simon Campese writes: > Hello, Hi Simon, > I have one quick feature request for org-contacts.el that should be > pretty easy and quick to implement: Could someone please introduce > customizable variables to optionally disable the gnus/message mode > integration?=20=20 I've added a custom boolean, `org-contacts-enable-completion', that you can set to nil to disable the `message-mode' integration. Thanks for reporting this. > I don't know a lot of elisp, so instead of copy-pasting my way to a > half-baked solution that would maybe not be accepted upstream, I thought > that asking the experts here is more appropriate.=20=20 > > My reason for this request: > For email address completion in message mode, I use a program that scans > through my whole email database (I use notmuch to manage emails and have > all my mails stored locally). This program is stored in > 'notmuch-address-command' and the integration has so far been done by > 'notmuch-address'. However, the recent version of org-contacts breaks > this behaviour, i.e. I only get the emails from my org-contacts file > when I try to complete recipients. As I don't want to add all the people > I correspond with electronically to my org-contacts file, this is a huge= =20=20 > annoyance. Could you try the attached patch and set the variable `org-contacts-complete-exclusive' to nil and see if it still happens. With this patch org-contacts should fail silently to complete and let other functions do the completion, so it should complete with both org-contacts and notmuch. Regards, --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-org-contacts.el-Add-a-custom-variable-to-let-others-.patch Content-Transfer-Encoding: quoted-printable From=209eef3177dc401b49a902fcbcbdf86dc1d63865d8 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Gr=3DC3=3DA9goire=3D20Jadi?=3D Date: Wed, 27 Feb 2013 13:31:12 +0100 Subject: [PATCH] org-contacts.el: Add a custom variable to let others functions complete in `message-mode' * contrib/lisp/org-contacts.el (org-contacts-complete-exclusive): a custom boolean variable to let others functions complete in `message-mode'. (org-contacts-complete-group, org-contacts-complete-name): Use `org-contacts-complete-exclusive'. =2D-- contrib/lisp/org-contacts.el | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index 8674533..8189da2 100644 =2D-- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -138,6 +138,12 @@ This overrides `org-email-link-description-format' if = set." :group 'org-contacts :type 'boolean) =20 +(defcustom org-contacts-complete-exclusive t + "Determine whether `org-contacts-message-complete-function' +should be the only function to complete or not." + :group 'org-contacts + :type 'boolean) + ;; Decalre external functions and variables (declare-function wl-summary-message-number "ext:wl-summary" ()) (declare-function wl-address-header-extract-address "ext:wl-address") @@ -421,7 +427,10 @@ A group FOO is composed of contacts with the tag FOO." ", "))) ;; We haven't found the correct group (completion-table-case-fold completion-list =2D (not org-contacts-completion-ignore-case)))))))) + (not org-contacts-completion-ignore-case))) + :exclusive (if org-contacts-complete-exclusive + 'yes + 'no)))))) =20 (defun org-contacts-complete-name (start end string) "Complete text at START with a user name and email." @@ -445,7 +454,10 @@ A group FOO is composed of contacts with the tag FOO." (org-contacts-make-collection-prefix (org-contacts-all-completions-prefix string =2D (remove-duplicates completion-list :test #'equalp))))))) + (remove-duplicates completion-list :test #'equalp))) + :exclusive (if org-contacts-complete-exclusive + 'yes + 'no))))) =20 (defun org-contacts-message-complete-function (&optional start) "Function used in `completion-at-point-functions' in `message-mode'." =2D-=20 1.7.10.4 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 Daimrod/Greg --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBAgAGBQJRLf6WAAoJEBNzVHcrZRiU8XUQAKdYj01/lamKmlkTHlFQU7ro 2N+mjgsKHGOdv31eAxjcn49EEtz3J0FXxrZ+eVl6IKMdxce+BsLI8thZtG+6B3xH POlwWZQBczjuh9uGVEvBNm4dHfbtrqsC2Iv1F+1W5sEUY04M45l1EYsVOBotv9Oo UsWH+Zc6A49sT6S2GN/LbCIhb2PUHlFDcmUAnXddDtaHphIwgUylMq3O+Glk9p73 nIKGrMLYYkMUOwZcCmZPCBkFZr6wcIzOuUbqgMYo2LxSipxhC2LE9HQpd/EZmx9q 6r54EZqKejINDqvi4+wXLrrWJ3++vNC+tUJlWT2QBWfzGhllt5kE+feadkYxK+Yq TlCnWSQMl29NyA/26E08yoBvvA/xqoWJSqqqhy7SkzQkMIgB/OaEDqrT3Yw1hq7c nhU4fPO0IUHZKoXfBoCXHm077eF8BJ8Jw7YhTyLgKfNxF6h7eF49Yj9NCBT+E6y6 ecGvyePEmBk1f7Izh2M/PaJVgpL+TTSTinlbty/Yb5cP/11UnHmb0TnVJc+ch612 eXrrgK7yzQhiGj3bu2dzKVLJ3Vxgne/lovg6toOu1yOz3CqWKwbMZSfx+u6l88Tk Z8N5ZEY4RMMm+nyuG7PrAFedlcxznN2cevVvDKBNVpQTKs7XnkcAw/5r6SPAhO0K wMSqjLbA9OpFY6E4w3mu =T4Rp -----END PGP SIGNATURE----- --==-=-=--