unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Boruch Baum <boruch_baum@gmx.com>
Cc: 20063@debbugs.gnu.org
Subject: bug#20063: 24.4: read-from-minibuffer improperly setting hist parameter
Date: Wed, 11 Mar 2015 15:19:22 -0400	[thread overview]
Message-ID: <jwvlhj3uzfh.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <5500628F.3020405@gmx.com> (Boruch Baum's message of "Wed, 11 Mar 2015 11:43:11 -0400")

>> If the benefit is limited, it means the problem you mention is
>> correspondingly minor.
> I was referring to the benefit of your idea to filter out !COLLECTION
> elements dynamically, not the bug that offers the user nonsense or
> unacceptable HIST elements in the mini-buffer.

One of the benefits of filtering out elements not in COLLECTION is to
avoid providing "offer[ing] the user nonsense or unacceptable HIST
elements in the mini-buffer".  So if you think the benefit is limited,
it necessarily means that "the bug" is correspondingly minor.

FWIW, I do think it's indeed minor (which is why I haven't written this
filtering yet, even though I've had it in my "wishlist" for quite a while).

> - how could one REQUIRE-MATCH=t against a COLLECTION of infinite size?

Theoretical answer: let COLLECTION be the set of strings that represent
a natural number.  It's infinite, and it makes sense (for example in
read-number) to use REQUIRE-MATCH=t with it.

Practical answer: read a file name in order to delete it.
The corresponding COLLECTION is as good as infinite (especially if you
include remote hosts via Tramp), and you do want to use REQUIRE-MATCH=t
since you don't need to let the user delete a non-existing file.

> A user may normally want to retain duplicates in her general command
> history as a record of past activity, but not have those duplicates
> appear in mini-buffer selections that have REQUIRE-MATCH=t.

I'm not sure I understand.  What do you mean by "command history" and by
"mini-buffer selections"?  In my mind, the history stored in the hist
variable is only ever exposed to the user via things like M-p, M-n, so
there's not much difference between "that which is saved in the command
history", and "that which is shown in the minibuffer" (tho dynamic
filtering out of elements not in COLLECTION would change this state of
affair).

> To illustrate, imagine yourself, as a user, scrolling back through a
> minbuffer history in order to see what your legitimate REQUIRE-MATCH=t
> options are.

Right now, scrolling back like that does not show you those legitimate
choices, and after filtering out the !COLLECTION elements, it still
wouldn't show you all the legitimate choices (only those you happen to
have used in the (recorded) past), so if you want to see those
legitimate choices, the user would be expected to use completion instead
of history navigation.

> When would you ever want duplicates to appear in your scrolling?

And I don't understand why this desire (or not) to see duplicates in
this scenario would be different from what it is in those cases where
REQUIRE-MATCH is not t.

> It would only delay your ability to see all your options.

Agreed, which is why I'd expect the user to use completion instead.

> The documentation does provide for HIST=nil, which -IS- a central
> element of the bug report.

It's unlikely this can be changed since it's been documented for ever
and is used by a lot of code.  Hence the need to use another special
value (i.e. `t') to mean "no history".


        Stefan





  reply	other threads:[~2015-03-11 19:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-08 22:25 bug#20063: 24.4: read-from-minibuffer improperly setting hist parameter Boruch Baum
2015-03-09  1:08 ` Glenn Morris
2015-03-09 12:05   ` Boruch Baum
2015-03-09 18:14     ` Stefan Monnier
2015-03-10 15:34       ` Boruch Baum
2015-03-11 14:09         ` Stefan Monnier
2015-03-11 15:43           ` Boruch Baum
2015-03-11 19:19             ` Stefan Monnier [this message]
2022-02-13  9:13   ` Lars Ingebrigtsen

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=jwvlhj3uzfh.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=20063@debbugs.gnu.org \
    --cc=boruch_baum@gmx.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).