[I edited the tags and title: The question is not about the prompt; it's about providing a default value when reading from the minibuffer. That the default is generally shown in the prompt is something else. If no default value has been provided then none will appear in the prompt.]
Whether there's a default value (or several), and what it is, is determined by the read function call (read-from-minibuffer
, completing-read
etc.), i.e., by the programmer who wrote that call. While reading, it's available in variable minibuffer-default
(the value is put there by read-from-minibuffer
C code).
You could conceivably advise some basic read functions to add your own chosen default value, but why?
What default value would you want to add, when there isn't one? And when: during the read? And how: interactively or with Lisp? Do you want to impose your own default value, regardless of what's being read? If so, on what basis would you pick that value? Exactly what behavior are you looking for?
If the read function call doesn't provide a default value then you should consider that to be by design (the programmer's choice). You can, however, send a suggestion to the maintainer of the code that makes that function call, suggesting provision of a default value.
On the other hand, you could add one or more values to the value of minibuffer-history-variable
using minibuffer-with-setup-hook
. Then you could use M-p
to access those values. But you'd either have to do that for an individual read function call or you'd have to advise such a read function.