all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 6830@debbugs.gnu.org, cyd@gnu.org
Subject: bug#6830: widget-complete bad completions in :type 'file
Date: Fri, 09 Mar 2012 11:14:35 +0200	[thread overview]
Message-ID: <8362ee16h0.fsf@gnu.org> (raw)
In-Reply-To: <jwvlinc5bg7.fsf-monnier+emacs@gnu.org>

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> 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.





  reply	other threads:[~2012-03-09  9:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-09 11:45 bug#6830: widget-complete bad completions in :type 'file Lennart Borgman
2010-09-04 17:48 ` Chong Yidong
2010-09-04 22:16   ` Lennart Borgman
2010-09-05  1:47     ` Chong Yidong
2012-02-22 21:33       ` Glenn Morris
2012-02-22 23:02         ` Drew Adams
2012-02-22 23:51           ` Drew Adams
2012-02-23  3:57           ` Glenn Morris
2012-02-23 15:27             ` Drew Adams
2012-02-24 19:38               ` Eli Zaretskii
2012-02-25 12:16                 ` Richard Stallman
2012-02-24 19:35         ` Eli Zaretskii
2012-02-24 19:47           ` Drew Adams
2012-02-25  3:30           ` Chong Yidong
2012-02-25  5:26             ` Stefan Monnier
2012-02-25  7:45               ` Eli Zaretskii
2012-02-25  6:54             ` Eli Zaretskii
2012-03-04  9:37               ` Chong Yidong
2012-03-04 17:06                 ` Eli Zaretskii
2012-03-05  3:07                   ` Chong Yidong
2012-03-05 17:28                     ` Eli Zaretskii
2012-03-05 21:28                       ` Stefan Monnier
2012-03-06  3:50                         ` Eli Zaretskii
2012-03-06 20:45                           ` Stefan Monnier
2012-03-06 21:12                             ` Eli Zaretskii
2012-03-07 22:09                               ` Stefan Monnier
2012-03-09  9:14                                 ` Eli Zaretskii [this message]
2012-03-09 16:35                                   ` Stefan Monnier
2012-03-09 16:46                                   ` Stefan Monnier
2012-03-12  8:36 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8362ee16h0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=6830@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.