From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: [PATCH] Fix org-contacts completion at point (was: org-contacts completion stopped working) Date: Thu, 13 Oct 2011 17:05:43 +0200 Message-ID: <87wrc9hqyg.fsf_-_@thinkpad.tsdh.de> References: <87sjmyldzs.fsf@free.fr> <87ty7e10fi.fsf@thinkpad.tsdh.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:42782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REMrH-0004JR-Nx for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 11:06:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1REMrD-0000pR-1q for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 11:06:07 -0400 Received: from lo.gmane.org ([80.91.229.12]:44255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REMrC-0000pI-KP for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 11:06:03 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1REMr9-0006XO-Rt for emacs-orgmode@gnu.org; Thu, 13 Oct 2011 17:05:59 +0200 Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Oct 2011 17:05:59 +0200 Received: from tassilo by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Oct 2011 17:05:59 +0200 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: emacs-orgmode@gnu.org julien Barnier writes: Hi Julien, >> I use a very recent emacs 24 bzr checkout and org master from git. >> Not sure who's the culprit. > > Same problem here. After a quick look it seems that there has been a > recent change in the arguments taken by the completion-table-case-fold > function in minibuffer.el : > > http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/105991 Thanks for the pointer! > But I don't think I could be able to find a fix by myself. But I was able, so good teamwork, mate. :-) --8<---------------cut here---------------start------------->8--- >From d89ca3ce39cd7436e5205744adcf468d9619180f Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Thu, 13 Oct 2011 17:02:07 +0200 Subject: [PATCH 2/2] Fix org-contacts completion at point. --- contrib/lisp/org-contacts.el | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index 167caa0..74d68dc 100644 --- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -169,9 +169,10 @@ If both match values are nil, return all contacts." (when (not (fboundp 'completion-table-case-fold)) ;; That function is new in Emacs 24... - (defun completion-table-case-fold (table string pred action) - (let ((completion-ignore-case t)) - (complete-with-action action table string pred)))) + (defun completion-table-case-fold (table &optional dont-fold) + (lambda (string pred action) + (let ((completion-ignore-case (not dont-fold))) + (complete-with-action action table string pred))))) (defun org-contacts-complete-name (&optional start) "Complete text at START with a user name and email." @@ -226,9 +227,7 @@ If both match values are nil, return all contacts." ;; If the user has an email address, append USER . if email collect (org-contacts-format-email contact-name email)) ", "))))) - (list start end (if org-contacts-completion-ignore-case - (apply-partially #'completion-table-case-fold completion-list) - completion-list)))) + (list start end (completion-table-case-fold completion-list (not org-contacts-completion-ignore-case))))) (defun org-contacts-message-complete-function () "Function used in `completion-at-point-functions' in `message-mode'." -- 1.7.7 --8<---------------cut here---------------end--------------->8---