]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow overriding read--expression-try-read bindings
authorJonas Bernoulli <jonas@bernoul.li>
Sun, 16 Aug 2020 20:24:59 +0000 (22:24 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 16 Aug 2020 20:24:59 +0000 (22:24 +0200)
* 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 (bug#42893).

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

index 1cb93c5722b8f2343a12f6bd95b1b2ddaa3035af..b45fb87887685ea59412bf0c22a95aae138f6c0d 100644 (file)
@@ -1558,6 +1558,8 @@ in *Help* buffer.  See also the command `describe-char'."
     ;; 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 @@ function `read-from-minibuffer'."
           (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