all messages for Emacs-related lists mirrored at yhetil.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 10:09:02 -0400	[thread overview]
Message-ID: <jwvfv9b63h9.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <54FF0EE8.5040107@gmx.com> (Boruch Baum's message of "Tue, 10 Mar 2015 11:34:00 -0400")

>> That is indeed a problem, but it is more general than the case of
>> HIST=nil, since even if HIST is non-nil the history may contain entries
>> which are not valid according to COLLECTION.
>> So what we need to do is to filter out those entries dynamically.
> Yes, if you mean once, at the time the function is invoked;

No, I was thinking of doing it on-the-fly when navigating in the
history.

> but the benefit of this to the end-user is very limited, and has
> a downside if done simply.

If the benefit is limited, it means the problem you mention is
correspondingly minor.

> Once REQUIRE-MATCH=t, nothing but elements of COLLECTION will ever be
> accepted, so `concat'-ing the filtered elements of HIST would present
> only legitimate options, in the sequence most recently used, but with
> potentially a lot of duplicate entries.

I'm not sure exactly what you mean here, but I suspect you assume
COLLECTION to be finite and small.

> Using `add-to-list', starting with an empty list would avoid
> the duplications and present the elements in sequence
> most-recently-used.

Duplicate elements in the history are yet again orthogonal.
You probably want to set history-delete-duplicates to t.

>> Actually, IIRC a value of t for HIST
> I don't see that in the v24.4 documentation for `completing-read' or

Indeed, it's not documented.  It's basically a side effect of t holding
a non-list value, which we've tried to make work in order for
read-password to behave properly (i.e. not have history since that
would be a security problem).

>> does provide the option of "no history".
> Which brings us full-circle to line 974 of `minibuf.c'

I don't understand this, since this code checks for a nil value, not
a t value.


        Stefan





  reply	other threads:[~2015-03-11 14:09 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 [this message]
2015-03-11 15:43           ` Boruch Baum
2015-03-11 19:19             ` Stefan Monnier
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

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

  git send-email \
    --in-reply-to=jwvfv9b63h9.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 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.