From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Monnier Subject: Re: [Orgmode] Re: Announcing org-contacts, a bbdb-like contact manager for Org Date: Fri, 11 Feb 2011 09:47:54 -0500 Message-ID: References: <87r5bhysp6.fsf@keller.adm.naquadah.org> <878vxovsym.fsf@keller.adm.naquadah.org> <87k4h7ua23.fsf@member.fsf.org> <87vd0romky.fsf@keller.adm.naquadah.org> <87mxm2na63.fsf@member.fsf.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <87mxm2na63.fsf@member.fsf.org> (Tassilo Horn's message of "Fri, 11 Feb 2011 11:21:56 +0100") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org To: Tassilo Horn Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org List-Id: emacs-orgmode.gnu.org > So the question is: how can the completion-ignore-case value be > propagated from the completion gathering function in > `completion-at-point-functions' to the function that actually applies > this completion, without having to modify the global or buffer local > value of `completion-ignore-case'? Assuming you have a completion table in variable `table', you should be able to construct a new completion table that's case-insensitive with something like the untested code below: (defun completion-table-case-fold (table string pred action) (let ((completion-ignore-case t)) (complete-with-action action table string pred))) [...] (let ((newtable (apply-partially #'completion-table-case-fold table))) [...]) where completion-table-case-fold is an auxiliary function which (c|sh)ould be added to minibuffer.el. The case-sensitivity of the completion code is indeed problematic. Here's for example an excerpt from minibuffer.el: ;; - case-sensitivity currently confuses two issues: ;; - whether or not a particular completion table should be case-sensitive ;; (i.e. whether strings that differ only by case are semantically ;; equivalent) ;; - whether the user wants completion to pay attention to case. ;; e.g. we may want to make it possible for the user to say "first try ;; completion case-sensitively, and if that fails, try to ignore case". Stefan