* bug#56548: 29.0.50; read-expression-map conflict with read-from-minibuffer and default-value
@ 2022-07-14 3:36 Phil Sainty
2022-07-14 14:24 ` Drew Adams
2022-07-14 17:59 ` Lars Ingebrigtsen
0 siblings, 2 replies; 4+ messages in thread
From: Phil Sainty @ 2022-07-14 3:36 UTC (permalink / raw)
To: 56548
I have the following code, where the t is the READ argument,
and the DEFAULT-VALUE of "nil" means that if the user enters
no value, we read and return nil.
(read-from-minibuffer "Context expression: "
nil read-expression-map t
'read-expression-history "nil")
That worked in Emacs 27, but in Emacs 28+ we now get a temporary
message "[End of file during parsing]" alongside the prompt, and
`read-from-minibuffer' continues waiting for input, ignoring the
default value.
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42893 is the
direct cause, as `read-expression-map' now binds RET to
`read--expression-try-read' which doesn't like the empty string.
I can stop using `read-expression-map' here; but as the purpose
of the code is to read an expression, and surely there may be
other code out there like mine, I wondered if there was a better
solution.
-Phil
In GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.15.10, Xaw scroll bars)
of 2022-06-08 built on phil-lp
Repository revision: 22d3f0e95a5602b2bde763cff185f5b4fed6e53e
Repository branch: master
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#56548: 29.0.50; read-expression-map conflict with read-from-minibuffer and default-value
2022-07-14 3:36 bug#56548: 29.0.50; read-expression-map conflict with read-from-minibuffer and default-value Phil Sainty
@ 2022-07-14 14:24 ` Drew Adams
2022-07-14 17:59 ` Lars Ingebrigtsen
1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams @ 2022-07-14 14:24 UTC (permalink / raw)
To: Phil Sainty, 56548@debbugs.gnu.org
> I have the following code, where the t is the READ argument,
> and the DEFAULT-VALUE of "nil" means that if the user enters
> no value, we read and return nil.
>
> (read-from-minibuffer "Context expression: "
> nil read-expression-map t
> 'read-expression-history "nil")
>
> That worked in Emacs 27, but in Emacs 28+ we now get a temporary
> message "[End of file during parsing]" alongside the prompt, and
> `read-from-minibuffer' continues waiting for input, ignoring the
> default value.
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42893
> is the direct cause, as `read-expression-map' now binds RET to
> `read--expression-try-read' which doesn't like the empty string.
>
> I can stop using `read-expression-map' here; but as the purpose
> of the code is to read an expression, and surely there may be
> other code out there like mine, I wondered if there was a better
> solution.
FWIW, I don't use Emacs 28 or 29, but I too have code,
in several libraries, that calls read-from-minibuffer
with read-expression-map and non-nil READ arg.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#56548: 29.0.50; read-expression-map conflict with read-from-minibuffer and default-value
2022-07-14 3:36 bug#56548: 29.0.50; read-expression-map conflict with read-from-minibuffer and default-value Phil Sainty
2022-07-14 14:24 ` Drew Adams
@ 2022-07-14 17:59 ` Lars Ingebrigtsen
2022-07-15 2:46 ` Phil Sainty
1 sibling, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-07-14 17:59 UTC (permalink / raw)
To: Phil Sainty; +Cc: 56548
Phil Sainty <psainty@orcon.net.nz> writes:
> (read-from-minibuffer "Context expression: "
> nil read-expression-map t
> 'read-expression-history "nil")
>
> That worked in Emacs 27, but in Emacs 28+ we now get a temporary
> message "[End of file during parsing]" alongside the prompt, and
> `read-from-minibuffer' continues waiting for input, ignoring the
> default value.
I've now restored how this used to work in Emacs 29 (by introducing an
intermediary map used by `read--expression'.)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#56548: 29.0.50; read-expression-map conflict with read-from-minibuffer and default-value
2022-07-14 17:59 ` Lars Ingebrigtsen
@ 2022-07-15 2:46 ` Phil Sainty
0 siblings, 0 replies; 4+ messages in thread
From: Phil Sainty @ 2022-07-15 2:46 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 56548
On 2022-07-15 05:59, Lars Ingebrigtsen wrote:
> I've now restored how this used to work in Emacs 29
Thanks Lars, that works nicely.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-07-15 2:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-14 3:36 bug#56548: 29.0.50; read-expression-map conflict with read-from-minibuffer and default-value Phil Sainty
2022-07-14 14:24 ` Drew Adams
2022-07-14 17:59 ` Lars Ingebrigtsen
2022-07-15 2:46 ` Phil Sainty
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).