* [org-contacts] need help for making gnus/message-mode integration optional
@ 2013-02-26 23:13 Simon Campese
2013-02-27 8:36 ` Bastien
2013-02-27 12:39 ` Daimrod
0 siblings, 2 replies; 3+ messages in thread
From: Simon Campese @ 2013-02-26 23:13 UTC (permalink / raw)
To: emacs-orgmode
Hello,
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?
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.
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
annoyance.
Thank you very much,
Simon
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [org-contacts] need help for making gnus/message-mode integration optional
2013-02-26 23:13 [org-contacts] need help for making gnus/message-mode integration optional Simon Campese
@ 2013-02-27 8:36 ` Bastien
2013-02-27 12:39 ` Daimrod
1 sibling, 0 replies; 3+ messages in thread
From: Bastien @ 2013-02-27 8:36 UTC (permalink / raw)
To: Simon Campese; +Cc: daimrod, emacs-orgmode
Hi Simon,
Simon Campese <emacs-orgmode@campese.de> writes:
> 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
> annoyance.
CC'ing Grégoire, as I think this is related to a change he made.
Grégoire, do you know how to fix this?
Thanks!
--
Bastien
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [org-contacts] need help for making gnus/message-mode integration optional
2013-02-26 23:13 [org-contacts] need help for making gnus/message-mode integration optional Simon Campese
2013-02-27 8:36 ` Bastien
@ 2013-02-27 12:39 ` Daimrod
1 sibling, 0 replies; 3+ messages in thread
From: Daimrod @ 2013-02-27 12:39 UTC (permalink / raw)
To: Simon Campese; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1617 bytes --]
Simon Campese <emacs-orgmode@campese.de> 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?
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.
>
> 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
> 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,
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-org-contacts.el-Add-a-custom-variable-to-let-others-.patch --]
[-- Type: text/x-diff, Size: 2410 bytes --]
From 9eef3177dc401b49a902fcbcbdf86dc1d63865d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= <gregoire.jadi@gmail.com>
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'.
---
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
--- 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)
+(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
- (not org-contacts-completion-ignore-case))))))))
+ (not org-contacts-completion-ignore-case)))
+ :exclusive (if org-contacts-complete-exclusive
+ 'yes
+ 'no))))))
(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
- (remove-duplicates completion-list :test #'equalp)))))))
+ (remove-duplicates completion-list :test #'equalp)))
+ :exclusive (if org-contacts-complete-exclusive
+ 'yes
+ 'no)))))
(defun org-contacts-message-complete-function (&optional start)
"Function used in `completion-at-point-functions' in `message-mode'."
--
1.7.10.4
[-- Attachment #1.3: Type: text/plain, Size: 21 bytes --]
--
Daimrod/Greg
[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-27 12:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-26 23:13 [org-contacts] need help for making gnus/message-mode integration optional Simon Campese
2013-02-27 8:36 ` Bastien
2013-02-27 12:39 ` Daimrod
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).