unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: RE: should read-file-name not respect text properties in its input string?
Date: Sat, 21 Jun 2008 20:09:10 -0700	[thread overview]
Message-ID: <005801c8d415$577953f0$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <jwvabhexna3.fsf-monnier+emacs@gnu.org>

> > http://lists.gnu.org/archive/html/emacs-devel/2007-01/msg00807.html
> 
> This lists uses of properties in completion candidates (typically when
> displayed in *Completions*).  As mentioned, this should already
> work now.  We're discussing a different issue, which is the text
> properties of the value returned by `completing-read'.
> 
> I'm not fundamentally opposed to this change, but I strongly suspect
> that any code that relies on those properties will be very 
> brittle since there is very little control over them.

No idea what that means. I've used this feature for years, and nothing has
broken.

But I don't really care. I don't want to get into a tug of war over this.

> So, if you can come up with
> actual scenarios where those properties could be 
> useful/important, maybe
> we can make sure not only that they're returned but that they are
> returned reliably.  If you can't come up with such a scenario, that
> casts doubts on the usefulness of the requested change.

I've no desire to belabor this. I'm not selling anything. If you don't want to
do it, please don't.

The general argument is that `completing-read' should be lossless; it should be
only about choosing, not losing info. Why? Why not? There is no reason that it
should lose info.

You agree that it should accept a set of rich structures, display them, and let
you choose from them. So far so good. Why should what you get back be only a
stripped down string instead of the whole structure you chose, including
properties that might not be visible? It's not only about rich display (color
etc.); it's also about choosing possibly complex objects. It's not only visible
properties that are useful.

Using properties lets an application pass along additional information about a
candidate choice, in addition to the string text - not just to *Completions* but
to the `completing-read' caller as the return value. The info can group/classify
candidates, order them, or do anything else you want.

I mentioned that I put that to advantage in Icicles in various contexts. I
associate different kinds of info with candidates, sometimes even candidates
whose appearance is the same: tag info, buffer locations, Info structure,
bookmark info, annotations, internal representations, and so on. 

Are there other ways to associate additional info with string candidates,
besides using text properties? Sure, and I use some of them too. But why not
provide this capability?

If the general rationale (don't lose info) doesn't convince you, and the
suggestions of uses don't inspire you, fuggedabowdit.






  reply	other threads:[~2008-06-22  3:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20 22:30 should read-file-name not respect text properties in its input string? Drew Adams
2008-06-21  2:06 ` Stefan Monnier
2008-06-21  4:59   ` Drew Adams
2008-06-21 18:13     ` Stefan Monnier
2008-06-21 19:46       ` Drew Adams
2008-06-21 20:34         ` should read-file-name not respect text properties in its inputstring? Drew Adams
2008-06-21 20:44         ` should read-file-name not respect text properties in its input string? Stefan Monnier
2008-06-21 23:02           ` Drew Adams
2008-06-22  1:41             ` Stefan Monnier
2008-06-22  3:09               ` Drew Adams [this message]
2008-06-22  7:17                 ` David Kastrup
2008-06-22  8:30                   ` Drew Adams

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='005801c8d415$577953f0$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@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 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).