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: Fri, 09 Mar 2012 11:14:35 +0200 Message-ID: <8362ee16h0.fsf@gnu.org> References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> <83ty2grpn0.fsf@gnu.org> <87d393zj1l.fsf@gnu.org> <83linrs8rj.fsf@gnu.org> <87sjhoiu4q.fsf@gnu.org> <83zkbw9tyv.fsf@gnu.org> <87boobd9tr.fsf@gnu.org> <83linf9cup.fsf@gnu.org> <83ipii9ylf.fsf@gnu.org> <83d38pa0yl.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1331284526 14304 80.91.229.3 (9 Mar 2012 09:15:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2012 09:15:26 +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 Fri Mar 09 10:15:25 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S5vv2-0006kK-3S for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Mar 2012 10:15:24 +0100 Original-Received: from localhost ([::1]:36296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5vv1-0002zH-93 for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Mar 2012 04:15:23 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5vut-0002yo-HQ for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2012 04:15:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5vum-00023X-Pp for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2012 04:15:15 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5vum-00023T-MB for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2012 04:15:08 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S5vve-0005IP-Ht for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2012 04:16: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: Fri, 09 Mar 2012 09:16:02 +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.133128453820327 (code B ref 6830); Fri, 09 Mar 2012 09:16:02 +0000 Original-Received: (at 6830) by debbugs.gnu.org; 9 Mar 2012 09:15:38 +0000 Original-Received: from localhost ([127.0.0.1]:39964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S5vvG-0005Ho-0g for submit@debbugs.gnu.org; Fri, 09 Mar 2012 04:15:38 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:34419) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S5vv3-0005HW-LQ for 6830@debbugs.gnu.org; Fri, 09 Mar 2012 04:15:36 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M0M003001LGKP00@a-mtaout22.012.net.il> for 6830@debbugs.gnu.org; Fri, 09 Mar 2012 11:14:29 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.138.42]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M0M003NP1O4KB10@a-mtaout22.012.net.il>; Fri, 09 Mar 2012 11:14:29 +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:57576 Archived-At: > From: Stefan Monnier > Cc: cyd@gnu.org, 6830@debbugs.gnu.org > Date: Wed, 07 Mar 2012 17:09:56 -0500 > > > The value of `field' on MS-Windows is neither `boundary' nor nil. > > It is the value of the widget itself. Here's just its beginning, as an > > illustration: > > Oh, I think I see, now. > There are 2 overlays defining a field: one if the setup by the > completion code, the other by the widget code. both cover the same text > area Yes. > so using either would be fine. ??? I don't understand this part. It maybe OK in this particular case, because all you care about is the range of buffer positions covered by the overlay. But in general, the value of the field property is presumably of at least some importance to the Lisp application that examines the field. So feeding the application by some other overlay, even if covers the same text, is generally unsafe, don't you agree? Or am I missing something? > Now since both overlays cover the exact same area, and have no > `priority', none has priority over the other, so which of the two is > used depends on arbitrary details, e.g. implementation of the > `sort' function. Right. > Now, until here, there's still no bug because indeed it doesn't matter > which overlay we use to determine the field. See above. I'm not sure this is correct in general. And what if one of the overlays covers more buffer positions than the other? Wouldn't it sometimes confuse the completion code? > Does the patch below fix the problem? It does, but on Windows both `before_field' and `field' now have the value of the widget, not of `completion'. More generally, the overlay returned by get-char-property-and-overlay in this situation is still arbitrary after your change, and the Lisp application still has no control on which one will be returned. So same issue of having more than one `field' overlay on the same buffer position still remains.