[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: How to travel into the future?
From: |
Drew Adams |
Subject: |
RE: How to travel into the future? |
Date: |
Tue, 14 Feb 2017 06:39:59 -0800 (PST) |
> I'd like to use in my code the M-n facility in history to enable the
> user to have access to a reasonable default value, as described in
> (info "(emacs) Minibuffer History").
> How should I do it? Should I use read-string? If so, do I have to put
> the default into the history variable and use the (HISTVAR . POSITION)
> argument to read-string? If so, should I then manually delete the
> default (which might have been used or not by the user) from the history
> variable afterwards?
>
> Any pointers?
Just provide a list of default values (strings) as argument
DEFAULT to `completing-read', `read-string', or similar.
`C-h f read-string':
Fourth arg DEFAULT-VALUE is the default value or the list of default values.
If non-nil, it is used for history commands, and as the value (or the first
element of the list of default values) to return if the user enters the
empty string.