unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vitalie Spinu <spinuvit@gmail.com>
To: Le Wang <l26wang@gmail.com>
Cc: Leo Liu <sdl.web@gmail.com>, emacs-devel@gnu.org
Subject: Re: fix for bug 10994 breaks ido customizations in major way
Date: Tue, 07 May 2013 12:26:03 +0200	[thread overview]
Message-ID: <87vc6vulvo.fsf@gmail.com> (raw)
In-Reply-To: <CAM=K+irw4i8pHxBoiZC_wga8WSry=FyZfcWeO3d5ZHRui8HcVQ@mail.gmail.com> (Le Wang's message of "Tue, 7 May 2013 17:35:23 +0800")

 >> Le Wang <l26wang@gmail.com>
 >> on Tue, 7 May 2013 17:35:23 +0800 wrote:

 >> There are plenty of applications that might need same strings but with
 >> different meaning.

 > No there aren't.  Because this was completely broken in 24.3.1 until
 > the fix was checked in for 10994.

Yes, I was bearing the behavior before, as everyone else did, because it
wasn't happening too often. 

 >> For example ido for tag or imenu navigation, there
 >> might be several locations where a symbol is used/defined.

 > This is a good reason for including a line#, class, etc.  Why only
 > text-properties?

Because it does require quite a fair amount of prepossessing and also
post-processing. I think users are quite fine to see 2-3 strings and
they understand, depending on the context, what repeated string
signify. 

 > Your examples are contrived and not in the wild at all.  I say again,
 > only HEAD has the ability to handle repeated runs of strings.

 > BUT the cost of adding this functionality is breaking packages that
 > add text properties ... Packages that actually __exist__.

What are those packages? 

They can remove text properties, or even not collect them in the first
place, that is definitely easier than adding line-nums/files to
repetitive strings.

 >> Currently
 >> 
 >> (let ((t1 (propertize "aaa" 'aaa 12))
 >> (t2 (propertize "aaa" 'aaa 11)))
 >> (ido-completing-read "?: " (list t1 t2 "sfd")))
 >> 
 >> works as expected. And the above patch breaks that.

 > That would be a horrible UI.  Luckily AFAICT, it hasn't happened.

Not the best UI, but definitely not horrible, users can distinguish 2-3
strings on very rare occasions. It makes implementation much faster and
solves a lot of hustle for lazy programmers:)

 > That's why I say there is no actual valid use-case for repeating the
 > same string in completions.

Look at imenu-anywhere. It happens to have same imenu tag in different
files. The package never relied on text properties because IDO was
broken and it wasn't necessary. Now the issue is solved, and relying on
text properties is a one-line change to the package. It all depends on
whether your patch is accepted or not.

Instead of proposing patch to ido, can you propose a patch to the
"packages" that needlessly use text properties?

There was an ido interface for ETAG selection floating around which I
never used, but I doubt it was uniquifying strings by adding location.

In both cases above, one would need a non trivial pre-processing step to
sort it out. 

    Vitalie



  reply	other threads:[~2013-05-07 10:26 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 17:57 fix for bug 10994 breaks ido customizations in major way Le Wang
2013-05-03  4:13 ` Leo Liu
2013-05-03 12:49   ` Le Wang
2013-05-03 20:33     ` Leo Liu
2013-05-04  7:00       ` Le Wang
2013-05-04  8:58         ` Óscar Fuentes
2013-05-04 13:00           ` Le Wang
2013-05-05 10:57             ` Óscar Fuentes
2013-05-05 11:39               ` Leo Liu
2013-05-05 12:20                 ` Óscar Fuentes
2013-05-05 12:58                   ` Leo Liu
2013-05-05 13:38                     ` Óscar Fuentes
2013-05-05 14:31                       ` Stephen J. Turnbull
2013-05-05 15:26                         ` Óscar Fuentes
2013-05-06 15:11                           ` Le Wang
2013-05-06 22:49         ` Vitalie Spinu
2013-05-07  1:01           ` Óscar Fuentes
2013-05-07  9:35           ` Le Wang
2013-05-07 10:26             ` Vitalie Spinu [this message]
2013-05-07 10:35               ` Óscar Fuentes
2013-05-07 14:49                 ` Le Wang
2013-05-07 21:18                   ` Stefan Monnier
2013-05-07 14:42               ` Le Wang
2013-05-07 14:44             ` Drew Adams
2013-05-07 14:47               ` Le Wang
2013-05-07 19:00                 ` Vitalie Spinu
2013-05-07 19:53                   ` Óscar Fuentes
2013-05-08  0:04                     ` Leo Liu
2013-05-08  0:35                       ` Le Wang
2013-05-08  3:10                         ` Leo Liu
2013-05-08  3:29                           ` Leo Liu
2013-05-08  4:49                             ` Leo Liu
2013-05-08  8:14                               ` Vitalie Spinu
2013-05-08  8:42                                 ` Leo Liu
2013-05-08 12:23                                   ` Le Wang
2013-05-08 14:29                                     ` Leo Liu
2013-05-08 20:56                                   ` Juri Linkov
2013-05-10  1:52                                     ` Leo Liu
2013-05-17  2:48                                     ` Leo Liu

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87vc6vulvo.fsf@gmail.com \
    --to=spinuvit@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=l26wang@gmail.com \
    --cc=sdl.web@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).