From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#6830: widget-complete bad completions in :type 'file Date: Sat, 25 Feb 2012 09:45:00 +0200 Message-ID: <83ehtjs6f7.fsf@gnu.org> References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> <83ty2grpn0.fsf@gnu.org> <87d393zj1l.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1330155824 9916 80.91.229.3 (25 Feb 2012 07:43:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Feb 2012 07:43:44 +0000 (UTC) Cc: 6830@debbugs.gnu.org, cyd@gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 25 08:43:41 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S1CI5-0002Lp-M3 for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Feb 2012 08:43:37 +0100 Original-Received: from localhost ([::1]:59554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1CI4-0000si-QB for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Feb 2012 02:43:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1CHx-0000sH-Ou for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2012 02:43:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1CHs-0007iO-Ke for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2012 02:43:29 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1CHs-0007iI-GU for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2012 02:43:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S1CKQ-0005v0-7u for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2012 02:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Feb 2012 07:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6830 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6830-submit@debbugs.gnu.org id=B6830.133015594322724 (code B ref 6830); Sat, 25 Feb 2012 07:46:01 +0000 Original-Received: (at 6830) by debbugs.gnu.org; 25 Feb 2012 07:45:43 +0000 Original-Received: from localhost ([127.0.0.1]:55022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1CK7-0005uT-2h for submit@debbugs.gnu.org; Sat, 25 Feb 2012 02:45:43 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:36428) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1CK2-0005uJ-Rd for 6830@debbugs.gnu.org; Sat, 25 Feb 2012 02:45:40 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LZX00H00UMHV600@a-mtaout22.012.net.il> for 6830@debbugs.gnu.org; Sat, 25 Feb 2012 09:42:59 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.12.178]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LZX00HW2URLV400@a-mtaout22.012.net.il>; Sat, 25 Feb 2012 09:42:58 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:57225 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , 6830@debbugs.gnu.org > Date: Sat, 25 Feb 2012 00:26:05 -0500 > > >> On GNU/Linux, the first overlay in the sorted array happens to be the > >> one whose `field' value is equal to the text property, so find_field > >> works. On MS-Windows, the first overlay is the one whose value is > >> `completion', so find_field decides that the field begins and ends at > >> the same position. The rest, as they say, is history. > > Interesting. The overlays code should be independent of operating > > system. Any idea what causes the sort order to be different? > > > Does the problem go away if in > > > (let ((minibuffer-completion-table collection) > > (minibuffer-completion-predicate predicate) > > (ol (make-overlay start end nil nil t))) > > (overlay-put ol 'field 'completion) > > > you also specify a `priority' of (say) 5? > > > I'm wondering what is this other overlay, why it's here It's created by widget-specify-field here: (let ((overlay (make-overlay from to nil nil rear-sticky))) (widget-put widget :field-overlay overlay) ;;(overlay-put overlay 'detachable nil) (overlay-put overlay 'field widget) <<<<<<<<<<<<<<<<<<<<<<<<<<<< (overlay-put overlay 'local-map keymap) (overlay-put overlay 'face face) (overlay-put overlay 'follow-link follow-link) (overlay-put overlay 'help-echo help-echo))) The Lisp backtrace looks like this when this is called: "widget-specify-field" (0x82eac8) "widget-setup" (0x82ed24) "custom-buffer-create-internal" (0x82ef94) "custom-buffer-create" (0x82f1e4) "customize-variable" (0x82f4c4) "call-interactively" (0x82f704) "execute-extended-command" (0x82f954) "call-interactively" (0x82fb84) IIUC, this code is part of setting up editable fields of a widget. > and why it ends up sometimes taking precedence, This one I think I already explained: the order in which we get overlays of the same priority having the same property depends on the implementation of qsort. In any case, looking only at the first of a list of overlays for the same property, when we are interested in a specific value of the property and not just for any value, is asking for trouble, I think.