From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 09 07:45:42 2010 Received: (at submit) by debbugs.gnu.org; 9 Aug 2010 11:45:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiQnV-00061i-Ur for submit@debbugs.gnu.org; Mon, 09 Aug 2010 07:45:42 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiQnU-00061c-2O for submit@debbugs.gnu.org; Mon, 09 Aug 2010 07:45:40 -0400 Received: from lists.gnu.org ([199.232.76.165]:48795) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OiQo9-00052B-6d for submit@debbugs.gnu.org; Mon, 09 Aug 2010 07:46:21 -0400 Received: from [140.186.70.92] (port=40509 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiQo8-00047e-3o for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 07:46:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiQo6-0004wj-UF for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 07:46:19 -0400 Received: from mail-qy0-f176.google.com ([209.85.216.176]:45018) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiQo6-0004wX-P8 for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2010 07:46:18 -0400 Received: by qyk34 with SMTP id 34so8790635qyk.0 for ; Mon, 09 Aug 2010 04:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=2X+cJX/Rj4279rJhP6A9j5oRgp9Sbrx5XKQXS6ITmTM=; b=P8iAkFytc6JFRijYnNBhxlmFgh9dD/uwvYQ5FVTfCeN2qu+PqXugS9aXaykZ4lAbt1 BKzyFnR9VJTII5Z696x8ZZ5bqb+UR3wJeBxn08bHNygQQV3AdiSGSanSFTrJ2F7p+R3S zTSiKdXi1x7c9F7Rz9VZJ6V7rAEbAG4oLaQCo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=flVdil4USFRTnYt4R7W9jrvn2o1oqUIiu3m0BcQpID9dHQI51VHRHj3XtrghQW1iL/ /vJl8Vj+byrX3LnNTsYdikN6GjlJZ/gO4lP6ZvXMftrcHaT0yKecnVMDEBuFjq969XFk h+cCTGB498vzqidDl4wU/ulKrURQ1WsrhW9hQ= Received: by 10.229.249.200 with SMTP id ml8mr7220003qcb.115.1281354378137; Mon, 09 Aug 2010 04:46:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.54.80 with HTTP; Mon, 9 Aug 2010 04:45:58 -0700 (PDT) From: Lennart Borgman Date: Mon, 9 Aug 2010 13:45:58 +0200 Message-ID: Subject: widget-complete bad completions in :type 'file To: Emacs Bugs Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) I get bad completion alternatives in Custom for a field of type "file". It looks like it takes the files in the current directory and disregards the contents of the field. To see it start from "emacs -Q" and evaluate (defcustom pause-later-file "~/.emacs-pause-later" "File for storing pauses to do later." :type 'file :group 'pause-yoga) Then do "M-x customize-option" to customize it. Go to the file field, enter some text and do "M-x widget-complete" (the only way to complete it in an unpatched Emacs on w32). With a trunk checkout from 2010-08-04 on w32. I get a list of the file in the current dir. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 13:46:49 2010 Received: (at 6830) by debbugs.gnu.org; 4 Sep 2010 17:46:49 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrwpF-00026X-49 for submit@debbugs.gnu.org; Sat, 04 Sep 2010 13:46:49 -0400 Received: from pantheon-po41.its.yale.edu ([130.132.50.98]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrwpD-00026P-CD for 6830@debbugs.gnu.org; Sat, 04 Sep 2010 13:46:47 -0400 Received: from furry (173-14-147-246-NewEngland.hfc.comcastbusiness.net [173.14.147.246]) (authenticated bits=0) by pantheon-po41.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o84HmaUA015876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 4 Sep 2010 13:48:36 -0400 Received: by furry (Postfix, from userid 1000) id 230E5C018; Sat, 4 Sep 2010 13:48:35 -0400 (EDT) From: Chong Yidong To: Lennart Borgman Subject: Re: bug#6830: widget-complete bad completions in :type 'file References: Date: Sat, 04 Sep 2010 13:48:34 -0400 In-Reply-To: (Lennart Borgman's message of "Mon, 9 Aug 2010 13:45:58 +0200") Message-ID: <871v99wgb1.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) Lennart Borgman writes: > I get bad completion alternatives in Custom for a field of type > "file". It looks like it takes the files in the current directory and > disregards the contents of the field. > > To see it start from "emacs -Q" and evaluate > > (defcustom pause-later-file "~/.emacs-pause-later" > "File for storing pauses to do later." > :type 'file > :group 'pause-yoga) > > Then do "M-x customize-option" to customize it. Go to the file field, > enter some text and do "M-x widget-complete" (the only way to complete > it in an unpatched Emacs on w32). I can't reproduce any problem. Your description is too vague; you do not explain what "some text" is, or what happens, or why you think it is a bug. Please, provide a proper bug report (this is not the first time you've been asked this). From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 18:15:28 2010 Received: (at 6830) by debbugs.gnu.org; 4 Sep 2010 22:15:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Os11D-0005EC-Vt for submit@debbugs.gnu.org; Sat, 04 Sep 2010 18:15:28 -0400 Received: from mail-qw0-f44.google.com ([209.85.216.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Os11C-0005E6-5A for 6830@debbugs.gnu.org; Sat, 04 Sep 2010 18:15:26 -0400 Received: by qwc9 with SMTP id 9so2831376qwc.3 for <6830@debbugs.gnu.org>; Sat, 04 Sep 2010 15:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=jeOIjEoTxlL6w65pVvWlmSb48dSjEQNOi3iarUAJSdM=; b=ss1FEvnTwagDUrC8AWIs6Fs5imWUDTpluyi2RWbpjOwAFpRJ6GOh74wbGFYPrvMmx5 l5aonLekOLbMIRdbyTBPMeLrMQYszi4e86lmjFCPUys5qOjx/0XgfnztlWfkNeK32APr GWSRqENBlP/TD8j/WfVzyYG5Y6xGHVzT+5SMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=uhabHEniK2dWNQcmKHgOt6KeInqCIAOwK1UZUuEp+rlSyh7M3SRI8PTVjo4jUYkSAm wo2g33w8MwsVcOaA6/9Ilz9vG6iaCcWkzaRuYHPseHJkERgA1ExinadMOFza22zMETwl 3EaG1xVpRKnu6VQXXj/Iv5f7INx6sqK9qmLCw= Received: by 10.229.96.17 with SMTP id f17mr2139853qcn.142.1283638635092; Sat, 04 Sep 2010 15:17:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.216.74 with HTTP; Sat, 4 Sep 2010 15:16:55 -0700 (PDT) In-Reply-To: <871v99wgb1.fsf@stupidchicken.com> References: <871v99wgb1.fsf@stupidchicken.com> From: Lennart Borgman Date: Sun, 5 Sep 2010 00:16:55 +0200 Message-ID: Subject: Re: bug#6830: widget-complete bad completions in :type 'file To: Chong Yidong Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) On Sat, Sep 4, 2010 at 7:48 PM, Chong Yidong wrote: > Lennart Borgman writes: > >> I get bad completion alternatives in Custom for a field of type >> "file". It looks like it takes the files in the current directory and >> disregards the contents of the field. >> >> To see it start from "emacs -Q" and evaluate >> >> (defcustom pause-later-file "~/.emacs-pause-later" >> =C2=A0 "File for storing pauses to do later." >> =C2=A0 :type 'file >> =C2=A0 :group 'pause-yoga) >> >> Then do "M-x customize-option" to customize it. Go to the file field, >> enter some text and do "M-x widget-complete" (the only way to complete >> it in an unpatched Emacs on w32). > > I can't reproduce any problem. =C2=A0Your description is too vague; you d= o > not explain what "some text" is, or what happens, or why you think it is > a bug. > > Please, provide a proper bug report (this is not the first time you've > been asked this). Yes, I can see now it is a bit frustrating if you do not see the bug and think my description is not precise enough. Sorry. I just enter any text in the file field, for example "aaa" and then with point still in this field I do "M-x widget-complete". This gives me all of the files in default-directory in the *Completions* buffer. Don't you see the same? What Emacs are you testing with? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 21:45:56 2010 Received: (at 6830) by debbugs.gnu.org; 5 Sep 2010 01:45:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Os4It-0006Wq-RP for submit@debbugs.gnu.org; Sat, 04 Sep 2010 21:45:56 -0400 Received: from pantheon-po45.its.yale.edu ([130.132.50.79]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Os4Is-0006Wj-6X for 6830@debbugs.gnu.org; Sat, 04 Sep 2010 21:45:54 -0400 Received: from furry (adsl-99-89-95-190.dsl.wlfrct.sbcglobal.net [99.89.95.190]) (authenticated bits=0) by pantheon-po45.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o851lhQ7014175 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 4 Sep 2010 21:47:44 -0400 Received: by furry (Postfix, from userid 1000) id 3D681C018; Sat, 4 Sep 2010 21:47:43 -0400 (EDT) From: Chong Yidong To: Lennart Borgman Subject: Re: bug#6830: widget-complete bad completions in :type 'file References: <871v99wgb1.fsf@stupidchicken.com> Date: Sat, 04 Sep 2010 21:47:43 -0400 In-Reply-To: (Lennart Borgman's message of "Sun, 5 Sep 2010 00:16:55 +0200") Message-ID: <87tym5ufk0.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Lennart Borgman writes: > I just enter any text in the file field, for example "aaa" and then > with point still in this field I do "M-x widget-complete". This gives > me all of the files in default-directory in the *Completions* buffer. > > Don't you see the same? What Emacs are you testing with? If I enter "~/aaa" in the widget field and there is no file starting with "aaa" in my home directory, M-TAB does nothing except for displaying "No match" in the echo area. This is with the latest trunk, on GNU/Linux. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 10 16:31:04 2011 Received: (at control) by debbugs.gnu.org; 10 Apr 2011 20:31:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q91Hk-0005Wf-3m for submit@debbugs.gnu.org; Sun, 10 Apr 2011 16:31:04 -0400 Received: from vm-emlprdomr-03.its.yale.edu ([130.132.50.144]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q91Hh-0005Vx-SZ for control@debbugs.gnu.org; Sun, 10 Apr 2011 16:31:02 -0400 Received: from furball (dhcp128036159042.central.yale.edu [128.36.159.42]) (authenticated bits=0) by vm-emlprdomr-03.its.yale.edu (8.14.4/8.14.4) with ESMTP id p3AKUus3006579 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 10 Apr 2011 16:30:56 -0400 Received: by furball (Postfix, from userid 1000) id D9B1C160461; Sun, 10 Apr 2011 16:30:55 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: tags 6830 Date: Sun, 10 Apr 2011 16:30:55 -0400 Message-ID: <87pqotg874.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.144 X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) tags 6830 unreproducible moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 22 16:36:24 2012 Received: (at 6830) by debbugs.gnu.org; 22 Feb 2012 21:36:24 +0000 Received: from localhost ([127.0.0.1]:51489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0JrL-0003Io-SU for submit@debbugs.gnu.org; Wed, 22 Feb 2012 16:36:24 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:54569 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0JrJ-0003Ih-Aq for 6830@debbugs.gnu.org; Wed, 22 Feb 2012 16:36:22 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1S0Joy-0006Mo-Uq; Wed, 22 Feb 2012 16:33:57 -0500 From: Glenn Morris To: 6830@debbugs.gnu.org Subject: Re: bug#6830: widget-complete bad completions in :type 'file References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> X-Spook: quarter Lon Horiuchi BRLO SDI Al Jazeera passwd ISEC SSL X-Ran: qMVvS%i1*DW0R6'!Ct]5D@4N=@gU'fN&5lg$;;ul[)[^Jo-jp4Zd[Eie?iM]moC;5lfdRu X-Hue: yellow X-Attribution: GM Date: Wed, 22 Feb 2012 16:33:56 -0500 In-Reply-To: <87tym5ufk0.fsf@stupidchicken.com> (Chong Yidong's message of "Sat, 04 Sep 2010 21:47:43 -0400") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 6830 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Chong Yidong wrote: > If I enter "~/aaa" in the widget field and there is no file starting > with "aaa" in my home directory, M-TAB does nothing except for > displaying "No match" in the echo area. > > This is with the latest trunk, on GNU/Linux. I also cannot reproduce this. If no-one can reproduce this using stock Emacs on MS Windows, I suggest closing this. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 22 18:04:49 2012 Received: (at 6830) by debbugs.gnu.org; 22 Feb 2012 23:04:49 +0000 Received: from localhost ([127.0.0.1]:51600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0LEu-0005Un-1A for submit@debbugs.gnu.org; Wed, 22 Feb 2012 18:04:49 -0500 Received: from acsinet15.oracle.com ([141.146.126.227]:35471) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0LEr-0005Ua-3N for 6830@debbugs.gnu.org; Wed, 22 Feb 2012 18:04:46 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q1MN2Dsd000539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 22 Feb 2012 23:02:14 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q1MN2CBk012264 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Feb 2012 23:02:13 GMT Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q1MN2CHt002774; Wed, 22 Feb 2012 17:02:12 -0600 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 22 Feb 2012 15:02:11 -0800 From: "Drew Adams" To: "'Glenn Morris'" , <6830@debbugs.gnu.org> References: <871v99wgb1.fsf@stupidchicken.com><87tym5ufk0.fsf@stupidchicken.com> Subject: RE: bug#6830: widget-complete bad completions in :type 'file Date: Wed, 22 Feb 2012 15:02:10 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Aczxss1vK1lkmGvTTj+Rf7a3ZRJ7wAAAJlWQ X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090208.4F4573F6.0082,ss=1,re=0.000,fgs=0 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 6830 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) > > If I enter "~/aaa" in the widget field and there is no file starting > > with "aaa" in my home directory, M-TAB does nothing except for > > displaying "No match" in the echo area. > > > > This is with the latest trunk, on GNU/Linux. > > I also cannot reproduce this. > If no-one can reproduce this using stock Emacs on MS Windows, > I suggest closing this. I can reproduce it immediately, AFAICT. I wonder how you actually tried to reproduce it. I tested for less than a minute, with emacs -Q: In GNU Emacs 24.0.93.1 (i386-mingw-nt5.1.2600) of 2012-02-15 on MARVIN Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.6) --no-opt --enable-checking --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include' This seems to be similar to bug #6757 (?). If I type a file name and then do `M-x widget-complete', exactly as the bug recipe says, then, just as the bug report says, I get all of the files in the current directory as completion candidates. If I move point back one or more chars, so it is is not _after_ all of the text typed into the entry field, then I get completions that correspond to the text before point (more or less - see below). However, with point at some positions in the field I get all of the files in the current directory again, and point gets moved to the field end. E.g. with `foo' as the text in the field, left justified, no spaces: * With point after `foo', all files in the current dir are candidates. * With point after `fo', only files (in dir) with _prefix_ `fo' are candidates. * With point after `f', all files (in dir) are candidates, even though there are some files that begin with `f' and others that do not. Furthermore, point is automatically moved to the end of the field. What's that about? * With point before `f' (cursor on `f'), only files (in dir) that contain _substring_ `fo' are candidates. If you add some spaces before `foo', the behavior gets even weirder. Unlike most editing of text in Emacs (and most edit fields anywhere else), using such an edit field is odd, because it is apparently already filled with spaces and is in a mode similar to overwrite. It is as if you were in picture mode. Click in the middle and point stays there, as if preceded by spaces. Pretty incomprehensible behavior, if you ask me. I'm sure there's a logical explanation, and perhaps some or all of the behavior is even intentional (how to know?). However, users will never guess the behavior pattern without some explanation. I have no idea whether all of the behavior is intentional or there are one or more bugs. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 22 18:53:58 2012 Received: (at 6830) by debbugs.gnu.org; 22 Feb 2012 23:53:58 +0000 Received: from localhost ([127.0.0.1]:51647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0M0U-0006km-EZ for submit@debbugs.gnu.org; Wed, 22 Feb 2012 18:53:58 -0500 Received: from acsinet15.oracle.com ([141.146.126.227]:23471) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0M0R-0006kZ-C3 for 6830@debbugs.gnu.org; Wed, 22 Feb 2012 18:53:56 -0500 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q1MNpNAO003768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 22 Feb 2012 23:51:24 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q1MNpM5V023039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Feb 2012 23:51:22 GMT Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q1MNpL4X031429; Wed, 22 Feb 2012 17:51:21 -0600 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 22 Feb 2012 15:51:21 -0800 From: "Drew Adams" To: "'Glenn Morris'" , <6830@debbugs.gnu.org> References: <871v99wgb1.fsf@stupidchicken.com><87tym5ufk0.fsf@stupidchicken.com> Subject: RE: bug#6830: widget-complete bad completions in :type 'file Date: Wed, 22 Feb 2012 15:51:20 -0800 Message-ID: <29050B37428E48789508B853A46D8936@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Aczxss1vK1lkmGvTTj+Rf7a3ZRJ7wAAAJlWQAAHZQ7A= X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-CT-RefId: str=0001.0A090201.4F457F7C.006C,ss=1,re=0.000,fgs=0 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 6830 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) > If I type a file name and then do `M-x widget-complete', > exactly as the bug recipe says, then, just as the bug report > says, I get all of the files in the current directory as > completion candidates. > > E.g. with `foo' as the text in the field, left justified, no spaces... Similarly, for an absolute file name, such as `c:/foo'. With point at the end (regardless of the absolute file-name text preceding point), the completion candidates are all of the files in the current directory, not files c:/. If I had to guess (and guessing is all that's possible - no help available, AFAICT), I'd guess that the text before point is ignored, so the empty input "" is completed in `default-directory', since no absolute file name is found _after_ point. Most unusual behavior, in any case. Wrt there being no help: There is a tooltip, but it says only this: "M-TAB: complete field; RET: enter value" Hardly helpful in trying to understand the complex completion behavior. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 22 23:00:30 2012 Received: (at 6830) by debbugs.gnu.org; 23 Feb 2012 04:00:30 +0000 Received: from localhost ([127.0.0.1]:51734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0Pr2-00048x-Ru for submit@debbugs.gnu.org; Wed, 22 Feb 2012 23:00:29 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:34023 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0Pqz-00048p-Rb for 6830@debbugs.gnu.org; Wed, 22 Feb 2012 23:00:27 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1S0Pod-0002xx-Tm; Wed, 22 Feb 2012 22:57:59 -0500 From: Glenn Morris To: 6830@debbugs.gnu.org Subject: Re: bug#6830: widget-complete bad completions in :type 'file References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> X-Spook: codes Sundevil Khaddafi Crypto AG Leitrim SCUD missile X-Ran: jn0FaG*e6_EZ^?Y'=@4A5279'doBN+nM'ZT1d);I:lMXn%sk?7B\j#'FZJB$epYV#k6L-' X-Hue: cyan X-Attribution: GM Date: Wed, 22 Feb 2012 22:57:59 -0500 In-Reply-To: (Drew Adams's message of "Wed, 22 Feb 2012 15:02:10 -0800") Message-ID: <5qzkcap5fc.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 6830 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) "Drew Adams" wrote: > I can reproduce it immediately, AFAICT. I wonder how you actually tried to > reproduce it. Using GNU/Linux. Thanks for the insinuation. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 23 10:29:53 2012 Received: (at 6830) by debbugs.gnu.org; 23 Feb 2012 15:29:53 +0000 Received: from localhost ([127.0.0.1]:52889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0acD-0006BT-Fs for submit@debbugs.gnu.org; Thu, 23 Feb 2012 10:29:53 -0500 Received: from rcsinet15.oracle.com ([148.87.113.117]:25320) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0acA-0006BB-Vf for 6830@debbugs.gnu.org; Thu, 23 Feb 2012 10:29:51 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q1NFRFIA021767 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 23 Feb 2012 15:27:15 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q1NFRDKW010083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Feb 2012 15:27:14 GMT Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q1NFRDAL006965; Thu, 23 Feb 2012 09:27:13 -0600 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 23 Feb 2012 07:27:13 -0800 From: "Drew Adams" To: "'Glenn Morris'" , <6830@debbugs.gnu.org> References: <871v99wgb1.fsf@stupidchicken.com><87tym5ufk0.fsf@stupidchicken.com> <5qzkcap5fc.fsf@fencepost.gnu.org> Subject: RE: bug#6830: widget-complete bad completions in :type 'file Date: Thu, 23 Feb 2012 07:27:12 -0800 Message-ID: <79F72A60042D4260B93940CC79893DE3@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <5qzkcap5fc.fsf@fencepost.gnu.org> Thread-Index: Aczx502vBCe02sunTPuRED7CV9YYTwAV8rPg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090209.4F465AD4.0061,ss=1,re=0.000,fgs=0 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 6830 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) > > I can reproduce it immediately, AFAICT. I wonder how you > > actually tried to reproduce it. > > Using GNU/Linux. Thanks for the insinuation. No insuation. 1. By "you" I meant those people who were not able to reproduce it, starting with Yidong. Nothing personal intended. 2. By "how" I meant just that: what recipes you (pl.) followed. 3. You had already mentioned your platform. That's only part of "how". AFAICT, the bug clearly exists on MS Windows, at least. That was my point, in response to your statement: > If no-one can reproduce this using stock Emacs on MS Windows, > I suggest closing this. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 14:37:00 2012 Received: (at 6830) by debbugs.gnu.org; 24 Feb 2012 19:37:00 +0000 Received: from localhost ([127.0.0.1]:54525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10wt-0001Mm-MH for submit@debbugs.gnu.org; Fri, 24 Feb 2012 14:37:00 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]:60850) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10wq-0001MY-Di for 6830@debbugs.gnu.org; Fri, 24 Feb 2012 14:36:59 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LZW00D00WWR6R00@a-mtaout22.012.net.il> for 6830@debbugs.gnu.org; Fri, 24 Feb 2012 21:34:14 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.12.178]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LZW00D0TX111C60@a-mtaout22.012.net.il>; Fri, 24 Feb 2012 21:34:14 +0200 (IST) Date: Fri, 24 Feb 2012 21:35:15 +0200 From: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file In-reply-to: X-012-Sender: halo1@inter.net.il To: Glenn Morris Message-id: <83ty2grpn0.fsf@gnu.org> References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Glenn Morris > Date: Wed, 22 Feb 2012 16:33:56 -0500 > > Chong Yidong wrote: > > > If I enter "~/aaa" in the widget field and there is no file starting > > with "aaa" in my home directory, M-TAB does nothing except for > > displaying "No match" in the echo area. > > > > This is with the latest trunk, on GNU/Linux. > > I also cannot reproduce this. > If no-one can reproduce this using stock Emacs on MS Windows, I suggest > closing this. Please don't close it. IIUC (and I'm not at all sure, as the complexity of wid-edit.el and minibuffer.el is above my pay-grade), the fact that it works on GNU/Linux is sheer luck. What seems to happen is this: . widget-complete calls completion-in-region, which in turn calls minibuffer-complete, after let-binding the necessary variables: (let ((minibuffer-completion-table collection) (minibuffer-completion-predicate predicate) (ol (make-overlay start end nil nil t))) (overlay-put ol 'field 'completion) (when completion-in-region-mode-predicate (completion-in-region-mode 1) (setq completion-in-region--data (list (current-buffer) start end collection))) (unwind-protect (call-interactively 'minibuffer-complete) . minibuffer-complete calls completion--do-completion, which does this at its very beginning: (let* ((beg (field-beginning)) (end (field-end)) (string (buffer-substring beg end)) (md (completion--field-metadata beg)) On GNU/Linux, field-beginning is correctly computed to be at the beginning of the field, and thus buffer-substring correctly extracts whatever you typed into the field, and that substring is thereafter correctly completed. In contrast, on Windows, field-beginning returns the position of point, so if point is at the end of whatever you typed (as it usually is when one hits M-TAB), buffer-substring extracts an empty string, which is then "completed" to the files in the default-directory. The difference between the two system is, so it seems, that find_field, which is the workhorse of field-beginning, looks at overlays at point and before point which have the `field' property. The problem is that we have 2 such overlays before point: one whose `field' value is `completion' (as can be seen above, this overlay is put there by completion-in-region), and another whose `field' value is identical to the `field' text property at point. Both of these overlays have nil as their priority, so when get_char_property_and_overlay sorts the overlays by priority, the resulting order is arbitrary. 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. I hope that this analysis (if it is correct) will allow someone smarter than myself to figure out how to fix this. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 14:40:12 2012 Received: (at 6830) by debbugs.gnu.org; 24 Feb 2012 19:40:12 +0000 Received: from localhost ([127.0.0.1]:54539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1100-0001Tq-1D for submit@debbugs.gnu.org; Fri, 24 Feb 2012 14:40:12 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]:61509) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10zx-0001TK-9a for 6830@debbugs.gnu.org; Fri, 24 Feb 2012 14:40:09 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LZW00D00X2T7O00@a-mtaout22.012.net.il> for 6830@debbugs.gnu.org; Fri, 24 Feb 2012 21:37:28 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.12.178]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LZW00CQEX6B16S0@a-mtaout22.012.net.il>; Fri, 24 Feb 2012 21:37:25 +0200 (IST) Date: Fri, 24 Feb 2012 21:38:25 +0200 From: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file In-reply-to: <79F72A60042D4260B93940CC79893DE3@us.oracle.com> X-012-Sender: halo1@inter.net.il To: Drew Adams Message-id: <83sji0rphq.fsf@gnu.org> References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> <5qzkcap5fc.fsf@fencepost.gnu.org> <79F72A60042D4260B93940CC79893DE3@us.oracle.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 6830 Cc: rgm@gnu.org, 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: "Drew Adams" > Date: Thu, 23 Feb 2012 07:27:12 -0800 > > > > I can reproduce it immediately, AFAICT. I wonder how you > > > actually tried to reproduce it. > > > > Using GNU/Linux. Thanks for the insinuation. > > No insuation. > > 1. By "you" I meant those people who were not able to reproduce it, starting > with Yidong. Nothing personal intended. > > 2. By "how" I meant just that: what recipes you (pl.) followed. > > 3. You had already mentioned your platform. That's only part of "how". You may wish to review your style, next time, and perhaps apologize for writing something that can so easily be interpreted to mean "you didn't really try that". From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 14:50:13 2012 Received: (at 6830) by debbugs.gnu.org; 24 Feb 2012 19:50:13 +0000 Received: from localhost ([127.0.0.1]:54552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S119h-0001iz-Ma for submit@debbugs.gnu.org; Fri, 24 Feb 2012 14:50:13 -0500 Received: from acsinet15.oracle.com ([141.146.126.227]:17110) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S119f-0001ij-3Y for 6830@debbugs.gnu.org; Fri, 24 Feb 2012 14:50:12 -0500 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q1OJlSRs023140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 24 Feb 2012 19:47:29 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q1OJlRf6022846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Feb 2012 19:47:28 GMT Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q1OJlQmW022527; Fri, 24 Feb 2012 13:47:26 -0600 Received: from dradamslap1 (/10.159.39.252) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 24 Feb 2012 11:47:26 -0800 From: "Drew Adams" To: "'Eli Zaretskii'" , "'Glenn Morris'" References: <871v99wgb1.fsf@stupidchicken.com><87tym5ufk0.fsf@stupidchicken.com> <83ty2grpn0.fsf@gnu.org> Subject: RE: bug#6830: widget-complete bad completions in :type 'file Date: Fri, 24 Feb 2012 11:47:22 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <83ty2grpn0.fsf@gnu.org> Thread-Index: AczzK1hzRM6jpV/RQj2gIc8AKtrlUwAAF7Gw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-CT-RefId: str=0001.0A090205.4F47E951.00AA,ss=1,re=0.000,fgs=0 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) > Please don't close it. IIUC...the fact that it works > on GNU/Linux is sheer luck. What seems to happen is this: Thanks for this analysis. This was far from obvious, I think. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 22:33:20 2012 Received: (at 6830) by debbugs.gnu.org; 25 Feb 2012 03:33:20 +0000 Received: from localhost ([127.0.0.1]:54863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S18Nr-0006Bj-AQ for submit@debbugs.gnu.org; Fri, 24 Feb 2012 22:33:20 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:52482) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S18Np-0006Bc-6g for 6830@debbugs.gnu.org; Fri, 24 Feb 2012 22:33:18 -0500 Received: from bb116-14-103-36.singnet.com.sg ([116.14.103.36]:55248 helo=furball) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1S18LG-0003Vm-G1; Fri, 24 Feb 2012 22:30:39 -0500 From: Chong Yidong To: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> <83ty2grpn0.fsf@gnu.org> Date: Sat, 25 Feb 2012 11:30:30 +0800 In-Reply-To: <83ty2grpn0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 24 Feb 2012 21:35:15 +0200") Message-ID: <87d393zj1l.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 6830 Cc: Glenn Morris , 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Eli Zaretskii writes: > 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? From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 00:28:46 2012 Received: (at 6830) by debbugs.gnu.org; 25 Feb 2012 05:28:46 +0000 Received: from localhost ([127.0.0.1]:54963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1ABZ-0002lG-Rs for submit@debbugs.gnu.org; Sat, 25 Feb 2012 00:28:46 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.183]:29061) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1ABY-0002l9-Ap for 6830@debbugs.gnu.org; Sat, 25 Feb 2012 00:28:44 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9MCodT/2dsb2JhbACBX5x7eYhwnhmGGQSGUJRJhAs X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="164529020" Received: from 76-10-135-83.dsl.teksavvy.com (HELO pastel.home) ([76.10.135.83]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 25 Feb 2012 00:26:05 -0500 Received: by pastel.home (Postfix, from userid 20848) id 54AAC59673; Sat, 25 Feb 2012 00:26:05 -0500 (EST) From: Stefan Monnier To: Chong Yidong Subject: Re: bug#6830: widget-complete bad completions in :type 'file Message-ID: References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> <83ty2grpn0.fsf@gnu.org> <87d393zj1l.fsf@gnu.org> Date: Sat, 25 Feb 2012 00:26:05 -0500 In-Reply-To: <87d393zj1l.fsf@gnu.org> (Chong Yidong's message of "Sat, 25 Feb 2012 11:30:30 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >> 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, and why it ends up sometimes taking precedence, Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 01:55:04 2012 Received: (at 6830) by debbugs.gnu.org; 25 Feb 2012 06:55:04 +0000 Received: from localhost ([127.0.0.1]:55008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1BX6-0004lm-Di for submit@debbugs.gnu.org; Sat, 25 Feb 2012 01:55:04 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]:58028) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1BX3-0004lL-OS for 6830@debbugs.gnu.org; Sat, 25 Feb 2012 01:55:03 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LZX00H00RNSES00@a-mtaout22.012.net.il> for 6830@debbugs.gnu.org; Sat, 25 Feb 2012 08:52:22 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.12.178]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LZX00H1HSF9AA60@a-mtaout22.012.net.il>; Sat, 25 Feb 2012 08:52:22 +0200 (IST) Date: Sat, 25 Feb 2012 08:54:24 +0200 From: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file In-reply-to: <87d393zj1l.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: Chong Yidong Message-id: <83linrs8rj.fsf@gnu.org> References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> <83ty2grpn0.fsf@gnu.org> <87d393zj1l.fsf@gnu.org> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 6830 Cc: rgm@gnu.org, 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Chong Yidong > Cc: Glenn Morris , 6830@debbugs.gnu.org > Date: Sat, 25 Feb 2012 11:30:30 +0800 > > Eli Zaretskii writes: > > > 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? I think it's quite clear: the internal details of how qsort is implemented on each system. > 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 didn't try, but I don't see how this would help. The above overlay _is_ the cause of the problem: it causes find_field to fail work as expected. Here's the relevant fragment of find_field: before_field = (XFASTINT (pos) > BEGV ? get_char_property_and_overlay (make_number (XINT (pos) - 1), Qfield, Qnil, NULL) /* Using nil here would be a more obvious choice, but it would fail when the buffer starts with a non-sticky field. */ : after_field); /* See if we need to handle the case where MERGE_AT_BOUNDARY is nil and POS is at beginning of a field, which can also be interpreted as the end of the previous field. Note that the case where if MERGE_AT_BOUNDARY is non-nil (see function comment) is actually the more natural one; then we avoid treating the beginning of a field specially. */ if (NILP (merge_at_boundary)) { Lisp_Object field = get_pos_property (pos, Qfield, Qnil); if (!EQ (field, after_field)) at_field_end = 1; if (!EQ (field, before_field)) at_field_start = 1; The last comparison of `field' with `before_field' is the culprit: to work correctly, they must be equal, but the above overlay causes get_char_property_and_overlay to return `completion' instead of the expected field value, so find_field decides we are both at the beginning and at the end of the field, i.e. the field is empty. Having the priority of the above overlay higher will just cause the completion fail on GNU/Linux as well, AFAIU. We would need this overlay to have a _lower_ priority, for the code to DTRT, but (a) the ELisp manual says not to use negative priorities, and (b) doing so might very well cause trouble elsewhere, if the completion code calls get-char-property-and-overlay and expects to get the `completion' thing back. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 02:45:43 2012 Received: (at 6830) by debbugs.gnu.org; 25 Feb 2012 07:45:43 +0000 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 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 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) 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) Date: Sat, 25 Feb 2012 09:45:00 +0200 From: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file In-reply-to: X-012-Sender: halo1@inter.net.il To: Stefan Monnier Message-id: <83ehtjs6f7.fsf@gnu.org> References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> <83ty2grpn0.fsf@gnu.org> <87d393zj1l.fsf@gnu.org> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org, cyd@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 07:19:52 2012 Received: (at 6830) by debbugs.gnu.org; 25 Feb 2012 12:19:52 +0000 Received: from localhost ([127.0.0.1]:55233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1GbO-0005B6-I4 for submit@debbugs.gnu.org; Sat, 25 Feb 2012 07:19:51 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:59108) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1GbK-0005Ax-SG for 6830@debbugs.gnu.org; Sat, 25 Feb 2012 07:19:47 -0500 Received: from rms by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1S1GYb-0000xN-Eu; Sat, 25 Feb 2012 07:16:57 -0500 Date: Sat, 25 Feb 2012 07:16:57 -0500 Message-Id: Content-Type: text/plain; charset=ISO-8859-15 From: Richard Stallman To: Eli Zaretskii In-reply-to: <83sji0rphq.fsf@gnu.org> (message from Eli Zaretskii on Fri, 24 Feb 2012 21:38:25 +0200) Subject: Re: bug#6830: widget-complete bad completions in :type 'file References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> <5qzkcap5fc.fsf@fencepost.gnu.org> <79F72A60042D4260B93940CC79893DE3@us.oracle.com> <83sji0rphq.fsf@gnu.org> X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: rms@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) One way to avoid misunderstandings is to pose questions more directly. "I wonder how" could mean a request for information but it could also be sarcastic. "Would you please tell me the precise recipe for how" is clearly a request for information. -- Dr Richard Stallman President, Free Software Foundation 51 Franklin St Boston MA 02110 USA www.fsf.org www.gnu.org Skype: No way! That's nonfree (freedom-denying) software. Use free telephony http://directory.fsf.org/category/tel/ From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 04 04:39:01 2012 Received: (at 6830) by debbugs.gnu.org; 4 Mar 2012 09:39:01 +0000 Received: from localhost ([127.0.0.1]:60598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S47u8-00086X-T7 for submit@debbugs.gnu.org; Sun, 04 Mar 2012 04:39:01 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:40949) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S47tw-000867-F5 for 6830@debbugs.gnu.org; Sun, 04 Mar 2012 04:38:49 -0500 Received: from bb116-14-103-36.singnet.com.sg ([116.14.103.36]:53669 helo=furball) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1S47tF-0001i8-Qe; Sun, 04 Mar 2012 04:38:06 -0500 From: Chong Yidong To: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file References: <871v99wgb1.fsf@stupidchicken.com> <87tym5ufk0.fsf@stupidchicken.com> <83ty2grpn0.fsf@gnu.org> <87d393zj1l.fsf@gnu.org> <83linrs8rj.fsf@gnu.org> Date: Sun, 04 Mar 2012 17:37:57 +0800 In-Reply-To: <83linrs8rj.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 25 Feb 2012 08:54:24 +0200") Message-ID: <87sjhoiu4q.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 6830 Cc: rgm@gnu.org, 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Eli Zaretskii writes: >> 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 didn't try, but I don't see how this would help. The above overlay > _is_ the cause of the problem > ... > Having the priority of the above overlay higher will just cause the > completion fail on GNU/Linux as well, AFAIU. Sorry, I'm afraid I still don't understand. As far as the completion code is concerned, the correct field to use is the `completion' field assigned by completion-in-region. In this case, it's a mistake to pay attention to the underlying widget field. So why doesn't it work to give the `completion' overlay a higher priority? FWIW, increasing the priority of the `completion' overlay does not cause widget file name completion to fail on GNU/Linux. Could you try on Windows? From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 04 12:07:13 2012 Received: (at 6830) by debbugs.gnu.org; 4 Mar 2012 17:07:13 +0000 Received: from localhost ([127.0.0.1]:32924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4Ett-0003sB-CT for submit@debbugs.gnu.org; Sun, 04 Mar 2012 12:07:13 -0500 Received: from mtaout23.012.net.il ([80.179.55.175]:54978) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4Etg-0003rU-B5 for 6830@debbugs.gnu.org; Sun, 04 Mar 2012 12:07:01 -0500 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M0D00C00E14S200@a-mtaout23.012.net.il> for 6830@debbugs.gnu.org; Sun, 04 Mar 2012 19:06:15 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.124.35.38]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M0D00CNJE6E2XA0@a-mtaout23.012.net.il>; Sun, 04 Mar 2012 19:06:15 +0200 (IST) Date: Sun, 04 Mar 2012 19:06:16 +0200 From: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file In-reply-to: <87sjhoiu4q.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: Chong Yidong Message-id: <83zkbw9tyv.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> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 6830 Cc: rgm@gnu.org, 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Chong Yidong > Cc: rgm@gnu.org, 6830@debbugs.gnu.org > Date: Sun, 04 Mar 2012 17:37:57 +0800 > > As far as the completion code is concerned, the correct field to use is > the `completion' field assigned by completion-in-region. In this case, > it's a mistake to pay attention to the underlying widget field. So why > doesn't it work to give the `completion' overlay a higher priority? See this fragment from find_field: before_field = (XFASTINT (pos) > BEGV ? get_char_property_and_overlay (make_number (XINT (pos) - 1), Qfield, Qnil, NULL) /* Using nil here would be a more obvious choice, but it would fail when the buffer starts with a non-sticky field. */ : after_field); /* See if we need to handle the case where MERGE_AT_BOUNDARY is nil and POS is at beginning of a field, which can also be interpreted as the end of the previous field. Note that the case where if MERGE_AT_BOUNDARY is non-nil (see function comment) is actually the more natural one; then we avoid treating the beginning of a field specially. */ if (NILP (merge_at_boundary)) { Lisp_Object field = get_pos_property (pos, Qfield, Qnil); if (!EQ (field, after_field)) at_field_end = 1; if (!EQ (field, before_field)) at_field_start = 1; What do you get on GNU/Linux for the values of `field', `before_field', and `after_field'? > FWIW, increasing the priority of the `completion' overlay does not cause > widget file name completion to fail on GNU/Linux. Could you try on > Windows? Give me a patch to try, and I will. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 04 22:09:01 2012 Received: (at 6830) by debbugs.gnu.org; 5 Mar 2012 03:09:01 +0000 Received: from localhost ([127.0.0.1]:33276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4OIH-0001Oe-4q for submit@debbugs.gnu.org; Sun, 04 Mar 2012 22:09:01 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:53088) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4OHw-0001O4-6w for 6830@debbugs.gnu.org; Sun, 04 Mar 2012 22:08:50 -0500 Received: from bb116-14-103-36.singnet.com.sg ([116.14.103.36]:56419 helo=furball) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1S4OHA-0006Tp-W6; Sun, 04 Mar 2012 22:07:53 -0500 From: Chong Yidong To: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file 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> Date: Mon, 05 Mar 2012 11:07:44 +0800 In-Reply-To: <83zkbw9tyv.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 04 Mar 2012 19:06:16 +0200") Message-ID: <87boobd9tr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 6830 Cc: rgm@gnu.org, 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Eli Zaretskii writes: > What do you get on GNU/Linux for the values of `field', > `before_field', and `after_field'? This is from doing M-x customize-variable RET abbrev-file-name RET, and doing C-M-i after the end of the file name in the editable field: (gdb) pp after_field boundary (gdb) pp before_field completion (gdb) pp field completion >> FWIW, increasing the priority of the `completion' overlay does not cause >> widget file name completion to fail on GNU/Linux. Could you try on >> Windows? > > Give me a patch to try, and I will. === modified file 'lisp/minibuffer.el' *** lisp/minibuffer.el 2012-02-23 15:41:12 +0000 --- lisp/minibuffer.el 2012-03-05 03:04:20 +0000 *************** *** 1483,1488 **** --- 1483,1489 ---- (minibuffer-completion-predicate predicate) (ol (make-overlay start end nil nil t))) (overlay-put ol 'field 'completion) + (overlay-put ol 'priority 5) (when completion-in-region-mode-predicate (completion-in-region-mode 1) (setq completion-in-region--data From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 05 12:29:27 2012 Received: (at 6830) by debbugs.gnu.org; 5 Mar 2012 17:29:28 +0000 Received: from localhost ([127.0.0.1]:34402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4bix-0006mS-Gd for submit@debbugs.gnu.org; Mon, 05 Mar 2012 12:29:27 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]:63109) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4bib-0006lT-Fs for 6830@debbugs.gnu.org; Mon, 05 Mar 2012 12:29:15 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M0F004009FGBA00@a-mtaout22.012.net.il> for 6830@debbugs.gnu.org; Mon, 05 Mar 2012 19:28:15 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.124.119.172]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M0F004F09V01R70@a-mtaout22.012.net.il>; Mon, 05 Mar 2012 19:28:13 +0200 (IST) Date: Mon, 05 Mar 2012 19:28:14 +0200 From: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file In-reply-to: <87boobd9tr.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: Chong Yidong Message-id: <83linf9cup.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> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 6830 Cc: rgm@gnu.org, 6830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Chong Yidong > Cc: rgm@gnu.org, 6830@debbugs.gnu.org > Date: Mon, 05 Mar 2012 11:07:44 +0800 > > Eli Zaretskii writes: > > > What do you get on GNU/Linux for the values of `field', > > `before_field', and `after_field'? > > This is from doing M-x customize-variable RET abbrev-file-name RET, and > doing C-M-i after the end of the file name in the editable field: > > (gdb) pp after_field > boundary > (gdb) pp before_field > completion > (gdb) pp field > completion Then it looks like my analysis was partially incorrect: I assumed that the problem was with the value of `before_field', but it actually is with the value of `field'. (Same reason, though: sorting two items whose keys compare equal.) > >> FWIW, increasing the priority of the `completion' overlay does not cause > >> widget file name completion to fail on GNU/Linux. Could you try on > >> Windows? > > > > Give me a patch to try, and I will. > > === modified file 'lisp/minibuffer.el' > *** lisp/minibuffer.el 2012-02-23 15:41:12 +0000 > --- lisp/minibuffer.el 2012-03-05 03:04:20 +0000 > *************** > *** 1483,1488 **** > --- 1483,1489 ---- > (minibuffer-completion-predicate predicate) > (ol (make-overlay start end nil nil t))) > (overlay-put ol 'field 'completion) > + (overlay-put ol 'priority 5) > (when completion-in-region-mode-predicate > (completion-in-region-mode 1) > (setq completion-in-region--data Yes, this fixes the problem, thanks. But is this a safe solution? Can we safely assume that no code in widget.el or its companions will ever run between overlay-put and delete-overlay in the above function? If some widget.el code can run in between, it will find a value of the field property different from what it expects. In general, the semantics of having more than one overlay with the same property on the same text is only clear to me when these properties specify display features, or more generally features related to the same parent feature. Otherwise, it's not really clear what the precedence means; if we use it just as a means to get the upper hand in some use-case, we are running the risk that some other use-case will lose. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 05 16:30:01 2012 Received: (at 6830) by debbugs.gnu.org; 5 Mar 2012 21:30:02 +0000 Received: from localhost ([127.0.0.1]:34753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4fTl-0005aJ-Cc for submit@debbugs.gnu.org; Mon, 05 Mar 2012 16:30:01 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.183]:9976) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4fTQ-0005Zn-Eo for 6830@debbugs.gnu.org; Mon, 05 Mar 2012 16:29:50 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9FxJvl/2dsb2JhbACBX5x7eYhwnhmGGQSGUJRJhAs X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="166168903" Received: from 69-196-155-229.dsl.teksavvy.com (HELO pastel.home) ([69.196.155.229]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 Mar 2012 16:28:50 -0500 Received: by pastel.home (Postfix, from userid 20848) id 83AEB58DDA; Mon, 5 Mar 2012 16:28:49 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file Message-ID: 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> Date: Mon, 05 Mar 2012 16:28:49 -0500 In-Reply-To: <83linf9cup.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 05 Mar 2012 19:28:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org, Chong Yidong X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Then it looks like my analysis was partially incorrect: I assumed that > the problem was with the value of `before_field', but it actually is > with the value of `field'. (Same reason, though: sorting two items > whose keys compare equal.) Ideally, the cursor position should not be considered as "in the boundary", so the boundary overlay should not be considered for determining `field'. For that, I'd guess that you'd want the boundary's marker to use the insertion type t. But AFAIK, the code already sets its type to t. So I'm not sure what's going on, here. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 05 22:52:39 2012 Received: (at 6830) by debbugs.gnu.org; 6 Mar 2012 03:52:39 +0000 Received: from localhost ([127.0.0.1]:35049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4lS3-0007Yg-C4 for submit@debbugs.gnu.org; Mon, 05 Mar 2012 22:52:39 -0500 Received: from mtaout23.012.net.il ([80.179.55.175]:39753) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4lRf-0007Xn-9O for 6830@debbugs.gnu.org; Mon, 05 Mar 2012 22:52:26 -0500 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M0G00J002NLMA00@a-mtaout23.012.net.il> for 6830@debbugs.gnu.org; Tue, 06 Mar 2012 05:50:49 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.124.119.172]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M0G00J1T2OPJS50@a-mtaout23.012.net.il>; Tue, 06 Mar 2012 05:50:49 +0200 (IST) Date: Tue, 06 Mar 2012 05:50:52 +0200 From: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file In-reply-to: X-012-Sender: halo1@inter.net.il To: Stefan Monnier Message-id: <83ipii9ylf.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> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org, cyd@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Stefan Monnier > Cc: Chong Yidong , 6830@debbugs.gnu.org > Date: Mon, 05 Mar 2012 16:28:49 -0500 > > > Then it looks like my analysis was partially incorrect: I assumed that > > the problem was with the value of `before_field', but it actually is > > with the value of `field'. (Same reason, though: sorting two items > > whose keys compare equal.) > > Ideally, the cursor position should not be considered as "in the > boundary", so the boundary overlay should not be considered for > determining `field'. > For that, I'd guess that you'd want the boundary's marker to use the > insertion type t. But AFAIK, the code already sets its type to t. > So I'm not sure what's going on, here. I don't think I follow. Can you elaborate on the role of the boundary marker in this issue? From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 06 15:46:13 2012 Received: (at 6830) by debbugs.gnu.org; 6 Mar 2012 20:46:13 +0000 Received: from localhost ([127.0.0.1]:36503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S51Gu-0000vJ-F8 for submit@debbugs.gnu.org; Tue, 06 Mar 2012 15:46:12 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:51635) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S51Gh-0000uc-9p for 6830@debbugs.gnu.org; Tue, 06 Mar 2012 15:46:01 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9FxJvl/2dsb2JhbACBX5x7eYhwnhmGGQSGUJRJhAs X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="166402611" Received: from 69-196-155-229.dsl.teksavvy.com (HELO pastel.home) ([69.196.155.229]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 06 Mar 2012 15:45:03 -0500 Received: by pastel.home (Postfix, from userid 20848) id 93EE359414; Tue, 6 Mar 2012 15:45:02 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file Message-ID: 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> Date: Tue, 06 Mar 2012 15:45:02 -0500 In-Reply-To: <83ipii9ylf.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Mar 2012 05:50:52 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org, cyd@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >> > Then it looks like my analysis was partially incorrect: I assumed that >> > the problem was with the value of `before_field', but it actually is >> > with the value of `field'. (Same reason, though: sorting two items >> > whose keys compare equal.) >> >> Ideally, the cursor position should not be considered as "in the >> boundary", so the boundary overlay should not be considered for >> determining `field'. >> For that, I'd guess that you'd want the boundary's marker to use the >> insertion type t. But AFAIK, the code already sets its type to t. >> So I'm not sure what's going on, here. > I don't think I follow. Can you elaborate on the role of the boundary > marker in this issue? I'm not sure what's the role of the boundary marker. But from what you say, the problem is that the boundary overlay's field property interferes. But the cursor should not be considered as being "in the boundary field". And indeed, the boundary's start marker is of insertion-type t, which means that Fget_pos_property should ignore this overlay when we're right in front of it. The values that Chong sees for before_field, after_field, and field are correct. If in your case, `field' has a value different from `completion' (e.g. it has value `boundary' or nil), then this is the problem whose origin we need to find. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 06 16:13:23 2012 Received: (at 6830) by debbugs.gnu.org; 6 Mar 2012 21:13:23 +0000 Received: from localhost ([127.0.0.1]:36580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S51hC-0001Yu-El for submit@debbugs.gnu.org; Tue, 06 Mar 2012 16:13:23 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]:47921) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S51gz-0001YE-Hc for 6830@debbugs.gnu.org; Tue, 06 Mar 2012 16:13:11 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M0H00J00EFDLF00@a-mtaout22.012.net.il> for 6830@debbugs.gnu.org; Tue, 06 Mar 2012 23:12:04 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.124.223.165]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M0H00IN5EVYSXG0@a-mtaout22.012.net.il>; Tue, 06 Mar 2012 23:11:59 +0200 (IST) Date: Tue, 06 Mar 2012 23:12:02 +0200 From: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file In-reply-to: X-012-Sender: halo1@inter.net.il To: Stefan Monnier Message-id: <83d38pa0yl.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> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org, cyd@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Stefan Monnier > Cc: cyd@gnu.org, 6830@debbugs.gnu.org > Date: Tue, 06 Mar 2012 15:45:02 -0500 > > >> Ideally, the cursor position should not be considered as "in the > >> boundary", so the boundary overlay should not be considered for > >> determining `field'. > >> For that, I'd guess that you'd want the boundary's marker to use the > >> insertion type t. But AFAIK, the code already sets its type to t. > >> So I'm not sure what's going on, here. > > > I don't think I follow. Can you elaborate on the role of the boundary > > marker in this issue? > > I'm not sure what's the role of the boundary marker. But from what you > say, the problem is that the boundary overlay's field property > interferes. But the cursor should not be considered as being "in the > boundary field". And indeed, the boundary's start marker is of > insertion-type t, which means that Fget_pos_property should ignore this > overlay when we're right in front of it. Ah, that's a simple misunderstanding, then. The boundary marker is not related to this issue at all. See below. > The values that Chong sees for before_field, after_field, and field > are correct. If in your case, `field' has a value different from > `completion' (e.g. it has value `boundary' or nil), then this is the > problem whose origin we need to find. 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: (gdb) pp field (file :format " %v" :value "chown" :parent (custom-variable :documentation-shown t :custom-state modified :tag "Dired Chown Program" :value dired-chown-program :custom-form edit :custom-magic (custom-magic :args (nil) :parent #1 :indent 0 :children ((choice-item :help-echo "Change the state of this item." ... As I explained earlier, this value comes from this snippet in widget-specify-field: (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))) When this is called as part of Customize, the Lisp backtrace looks like this: "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. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 07 17:11:21 2012 Received: (at 6830) by debbugs.gnu.org; 7 Mar 2012 22:11:22 +0000 Received: from localhost ([127.0.0.1]:38049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S5P4q-0004Zp-6Z for submit@debbugs.gnu.org; Wed, 07 Mar 2012 17:11:21 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:2761) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S5P4V-0004Z2-4E for 6830@debbugs.gnu.org; Wed, 07 Mar 2012 17:11:09 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9FxJvl/2dsb2JhbACBX5x7eYhwnhmGGQSGUJRJhAs X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="166553640" Received: from 69-196-155-229.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.196.155.229]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 07 Mar 2012 17:09:57 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id C65906002; Wed, 7 Mar 2012 17:09:56 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file Message-ID: 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> Date: Wed, 07 Mar 2012 17:09:56 -0500 In-Reply-To: <83d38pa0yl.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Mar 2012 23:12:02 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org, cyd@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > 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, so using either would be fine. 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. Now, until here, there's still no bug because indeed it doesn't matter which overlay we use to determine the field. The bug comes up because one overlay is used to get `field' and the other is used to get `before_field'. I.e. the "arbitrary details" end up making a different choice. This is probably due to the presence of the boundary overlay, so `before_field' is computed based on the two main overlays only (because at that position, the boundary overlay is absent), whereas for `field', we take the overlays at the end pos, where we have the two main overlays plus the boundary overlay, so the sort is applied to a different list of overlays, resulting in a different ordering of the two overlays we care about. Does the patch below fix the problem? Stefan === modified file 'src/buffer.c' --- src/buffer.c 2012-03-02 15:57:16 +0000 +++ src/buffer.c 2012-03-07 22:08:13 +0000 @@ -2864,7 +2864,11 @@ return s1->beg < s2->beg ? -1 : 1; if (s1->end != s2->end) return s2->end < s1->end ? -1 : 1; - return 0; + /* Avoid the non-determinism of qsort by choosing an arbitrary ordering + between "equal" overlays. The result can still change between + invocations of Emacs, but it won't change in the middle of + `find_field' (bug#6830). */ + return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1; } /* Sort an array of overlays by priority. The array is modified in place. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 09 04:15:38 2012 Received: (at 6830) by debbugs.gnu.org; 9 Mar 2012 09:15:38 +0000 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 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 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) 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) Date: Fri, 09 Mar 2012 11:14:35 +0200 From: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file In-reply-to: X-012-Sender: halo1@inter.net.il To: Stefan Monnier 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> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org, cyd@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 09 23:51:37 2012 Received: (at 6830) by debbugs.gnu.org; 10 Mar 2012 04:51:37 +0000 Received: from localhost ([127.0.0.1]:41581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6EHI-0005gC-6V for submit@debbugs.gnu.org; Fri, 09 Mar 2012 23:51:37 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:48567) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6EH4-0005fi-JF for 6830@debbugs.gnu.org; Fri, 09 Mar 2012 23:51:33 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q2A4Li6S021075; Fri, 9 Mar 2012 23:21:44 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 2FEC2666F3; Fri, 9 Mar 2012 11:35:23 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#6830: widget-complete bad completions in :type 'file Message-ID: 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> <8362ee16h0.fsf@gnu.org> Date: Fri, 09 Mar 2012 11:35:23 -0500 In-Reply-To: <8362ee16h0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 09 Mar 2012 11:14:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4156=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4156> : streams <736410> : uri <1080385> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 6830 Cc: 6830@debbugs.gnu.org, cyd@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) >> 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. That's normally the case. If an application actually cares about which value of `field' shows up, it'll have to do more work. >> 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? The normal priority rules say that a smaller overlay normally takes priority, but yes, if there's a small field already defined within the completion region, then the completion code can become confused. I don't know how likely this is. >> 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. It has the same control as before: the use of the `priority' property. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 09 23:51:33 2012 Received: (at 6830-done) by debbugs.gnu.org; 10 Mar 2012 04:51:33 +0000 Received: from localhost ([127.0.0.1]:41579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6EHE-0005fx-5j for submit@debbugs.gnu.org; Fri, 09 Mar 2012 23:51:33 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:48566) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6EH1-0005fd-GF for 6830-done@debbugs.gnu.org; Fri, 09 Mar 2012 23:51:31 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q2A4LeKT021072; Fri, 9 Mar 2012 23:21:40 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 1AEA86679F; Fri, 9 Mar 2012 11:46:59 -0500 (EST) From: Stefan Monnier To: 6830-done@debbugs.gnu.org Subject: Re: bug#6830: widget-complete bad completions in :type 'file Message-ID: 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> <8362ee16h0.fsf@gnu.org> Date: Fri, 09 Mar 2012 11:46:59 -0500 In-Reply-To: <8362ee16h0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 09 Mar 2012 11:14:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV4156=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4156> : streams <736410> : uri <1080385> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 6830-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) >> 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'. Thanks, installed, Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 12 05:06:38 2012 Received: (at 6830) by debbugs.gnu.org; 12 Mar 2012 09:06:38 +0000 Received: from localhost ([127.0.0.1]:46006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S71DA-0007BV-BH for submit@debbugs.gnu.org; Mon, 12 Mar 2012 05:06:38 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:33884) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S71D7-0007BM-E6 for 6830@debbugs.gnu.org; Mon, 12 Mar 2012 05:06:35 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 2BE9B39E800B for <6830@debbugs.gnu.org>; Mon, 12 Mar 2012 01:36:43 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HN6sqqrAT5EA for <6830@debbugs.gnu.org>; Mon, 12 Mar 2012 01:36:42 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 9ADEC39E8007 for <6830@debbugs.gnu.org>; Mon, 12 Mar 2012 01:36:42 -0700 (PDT) Message-ID: <4F5DB599.8050407@cs.ucla.edu> Date: Mon, 12 Mar 2012 01:36:41 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: 6830@debbugs.gnu.org Subject: bug#6830: widget-complete bad completions in :type 'file Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 6830 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) That patch assumes that s1 != s2. This assumption about qsort is quite likely true on Windows but it's not guaranteed by the C standard, and for portability it's better to play it safe and stick with the pattern that's already in the code. I installed this further patch: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-12 06:34:32 +0000 +++ src/ChangeLog 2012-03-12 08:27:25 +0000 @@ -1,3 +1,7 @@ +2012-03-12 Paul Eggert + + * buffer.c (compare_overlays): Don't assume args differ (Bug#6830). + 2012-03-12 Chong Yidong * eval.c (inhibit_lisp_code): Rename from === modified file 'src/buffer.c' --- src/buffer.c 2012-03-09 16:46:25 +0000 +++ src/buffer.c 2012-03-12 08:27:25 +0000 @@ -2868,7 +2868,9 @@ between "equal" overlays. The result can still change between invocations of Emacs, but it won't change in the middle of `find_field' (bug#6830). */ - return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1; + if (XHASH (s1->overlay) != XHASH (s2->overlay)) + return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1; + return 0; } /* Sort an array of overlays by priority. The array is modified in place. From unknown Sat Jun 21 05:15:19 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 09 Apr 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator