From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1297435697 22284 80.91.229.12 (11 Feb 2011 14:48:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 11 Feb 2011 14:48:17 +0000 (UTC) Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 11 15:48:12 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PnuI7-0001nH-BJ for ged-emacs-devel@m.gmane.org; Fri, 11 Feb 2011 15:48:11 +0100 Original-Received: from localhost ([127.0.0.1]:59524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnuI6-0007Ku-Oo for ged-emacs-devel@m.gmane.org; Fri, 11 Feb 2011 09:48:10 -0500 Original-Received: from [140.186.70.92] (port=49167 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnuHt-0007JE-EE for emacs-devel@gnu.org; Fri, 11 Feb 2011 09:47:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnuHr-0003l2-Dm for emacs-devel@gnu.org; Fri, 11 Feb 2011 09:47:56 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:26949 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnuHr-0003ke-5b; Fri, 11 Feb 2011 09:47:55 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEADXbVE1FxIyy/2dsb2JhbAClc3S6eoVdBIUBjzk X-IronPort-AV: E=Sophos;i="4.60,455,1291611600"; d="scan'208";a="91326202" Original-Received: from 69-196-140-178.dsl.teksavvy.com (HELO ceviche.home) ([69.196.140.178]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 11 Feb 2011 09:47:54 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 0B394660C9; Fri, 11 Feb 2011 09:47:54 -0500 (EST) In-Reply-To: <87mxm2na63.fsf@member.fsf.org> (Tassilo Horn's message of "Fri, 11 Feb 2011 11:21:56 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-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 Xref: news.gmane.org gmane.emacs.devel:135892 gmane.emacs.orgmode:37465 Archived-At: > 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