unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42893: [PATCH 0/1] Allow overriding read--expression-try-read bindings
@ 2020-08-16 19:18 Jonas Bernoulli
  2020-08-16 19:22 ` bug#42893: [PATCH 1/1] " Jonas Bernoulli
  0 siblings, 1 reply; 3+ messages in thread
From: Jonas Bernoulli @ 2020-08-16 19:18 UTC (permalink / raw)
  To: 42893

[This was sent using git-send-email.
 The email subject line, sans prefix, is the commit message subject.
 I am the author of the commit.]

Jonas Bernoulli (1):
  Allow overriding read--expression-try-read bindings

 lisp/simple.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.28.0






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#42893: [PATCH 1/1] Allow overriding read--expression-try-read bindings
  2020-08-16 19:18 bug#42893: [PATCH 0/1] Allow overriding read--expression-try-read bindings Jonas Bernoulli
@ 2020-08-16 19:22 ` Jonas Bernoulli
  2020-08-16 20:25   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Jonas Bernoulli @ 2020-08-16 19:22 UTC (permalink / raw)
  To: 42893

* lisp/simple.el (read--expression): No longer bind
read--expression-try-read here.
* lisp/simple.el (read-expression-map): Bind
read--expression-try-read here.

This new specialized command was recently added in [1: 4a6dd13fa4].
It reestablishes the bindings every time `read--expression' is
invoked, which is wrong because it makes it impossible for users
to remove these bindings.

1: 4a6dd13fa42c87175ac72e1980f31cac56582db3
   Change 'M-:' to not error out on incomplete expressions
---
 lisp/simple.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 1cb93c5722..b45fb87887 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1558,6 +1558,8 @@ read-expression-map
     ;; Might as well bind TAB to completion, since inserting a TAB char is
     ;; much too rarely useful.
     (define-key m "\t" 'completion-at-point)
+    (define-key m "\r" 'read--expression-try-read)
+    (define-key m "\n" 'read--expression-try-read)
     (set-keymap-parent m minibuffer-local-map)
     m))
 
@@ -1654,8 +1656,6 @@ read--expression
           (set-syntax-table emacs-lisp-mode-syntax-table)
           (add-hook 'completion-at-point-functions
                     #'elisp-completion-at-point nil t)
-          (local-set-key "\r" 'read--expression-try-read)
-          (local-set-key "\n" 'read--expression-try-read)
           (run-hooks 'eval-expression-minibuffer-setup-hook))
       (read-from-minibuffer prompt initial-contents
                             read-expression-map t
-- 
2.28.0






^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#42893: [PATCH 1/1] Allow overriding read--expression-try-read bindings
  2020-08-16 19:22 ` bug#42893: [PATCH 1/1] " Jonas Bernoulli
@ 2020-08-16 20:25   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-16 20:25 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: 42893

Jonas Bernoulli <jonas@bernoul.li> writes:

> This new specialized command was recently added in [1: 4a6dd13fa4].
> It reestablishes the bindings every time `read--expression' is
> invoked, which is wrong because it makes it impossible for users
> to remove these bindings.
>
> 1: 4a6dd13fa42c87175ac72e1980f31cac56582db3
>    Change 'M-:' to not error out on incomplete expressions

Thanks; applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-16 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-16 19:18 bug#42893: [PATCH 0/1] Allow overriding read--expression-try-read bindings Jonas Bernoulli
2020-08-16 19:22 ` bug#42893: [PATCH 1/1] " Jonas Bernoulli
2020-08-16 20:25   ` Lars Ingebrigtsen

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).