From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.bugs Subject: bug#42893: [PATCH 1/1] Allow overriding read--expression-try-read bindings Date: Sun, 16 Aug 2020 21:22:29 +0200 Message-ID: <20200816192229.16036-1-jonas@bernoul.li> References: <20200816191848.15263-1-jonas@bernoul.li> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34042"; mail-complaints-to="usenet@ciao.gmane.io" To: 42893@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 16 21:23:33 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k7OFf-0008kt-W5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Aug 2020 21:23:31 +0200 Original-Received: from localhost ([::1]:33904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7OFe-0002ND-TY for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Aug 2020 15:23:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7OFC-0002N7-Rq for bug-gnu-emacs@gnu.org; Sun, 16 Aug 2020 15:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46990) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7OFC-0004OZ-Hx for bug-gnu-emacs@gnu.org; Sun, 16 Aug 2020 15:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k7OFC-0007qR-Ea for bug-gnu-emacs@gnu.org; Sun, 16 Aug 2020 15:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonas Bernoulli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Aug 2020 19:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42893 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 42893-submit@debbugs.gnu.org id=B42893.159760575130102 (code B ref 42893); Sun, 16 Aug 2020 19:23:02 +0000 Original-Received: (at 42893) by debbugs.gnu.org; 16 Aug 2020 19:22:31 +0000 Original-Received: from localhost ([127.0.0.1]:58536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k7OEh-0007pR-BR for submit@debbugs.gnu.org; Sun, 16 Aug 2020 15:22:31 -0400 Original-Received: from mail.hostpark.net ([212.243.197.30]:50642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k7OEg-0007pK-CC for 42893@debbugs.gnu.org; Sun, 16 Aug 2020 15:22:30 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id BD106165F2; Sun, 16 Aug 2020 21:22:29 +0200 (CEST) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id Kpyki9xHd14E; Sun, 16 Aug 2020 21:22:29 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 913AF165CB; Sun, 16 Aug 2020 21:22:29 +0200 (CEST) X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200816191848.15263-1-jonas@bernoul.li> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185338 Archived-At: * 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