[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8c68a15: Allow overriding read--expression-try-read bindings

From: Lars Ingebrigtsen
Subject: master 8c68a15: Allow overriding read--expression-try-read bindings
Date: Sun, 16 Aug 2020 16:25:14 -0400 (EDT)

branch: master
commit 8c68a15f2ab484dabea4d4c2c760061d8ef440db
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Allow overriding read--expression-try-read bindings
    * 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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 1cb93c5..b45fb87 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -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)
@@ -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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]