emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix org-contacts completion at point (was: org-contacts completion stopped working)
Date: Thu, 13 Oct 2011 17:05:43 +0200	[thread overview]
Message-ID: <87wrc9hqyg.fsf_-_@thinkpad.tsdh.de> (raw)
In-Reply-To: loom.20111013T104422-867@post.gmane.org

julien Barnier <julien@nozav.org> 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 <tassilo@member.fsf.org>
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 <EMAIL>.
                                            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---

  reply	other threads:[~2011-10-13 15:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12 10:07 org-contacts completion stopped working Julien Cubizolles
2011-10-12 19:20 ` Tassilo Horn
2011-10-13  8:49   ` julien Barnier
2011-10-13 15:05     ` Tassilo Horn [this message]
2011-10-17 14:00       ` [Accepted] Fix org-contacts completion at point (was: org-contacts completion stopped working) Carsten Dominik
2011-12-16  5:57   ` org-contacts completion stopped working Noorul Islam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wrc9hqyg.fsf_-_@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).