From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#41781: 27.0.91; [PATCH] Eldoc describes the wrong function when reading an expression from the minibuffer Date: Tue, 23 Jun 2020 00:17:27 -0400 Message-ID: References: <83h7v6w51h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="39689"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 41781@debbugs.gnu.org To: Daniel Koning Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 23 06:18:15 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 1jnaNy-000ABE-RR for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Jun 2020 06:18:14 +0200 Original-Received: from localhost ([::1]:51272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnaNx-0007Qv-Av for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Jun 2020 00:18:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnaNm-0007O7-Ol for bug-gnu-emacs@gnu.org; Tue, 23 Jun 2020 00:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnaNm-0005Rw-EB for bug-gnu-emacs@gnu.org; Tue, 23 Jun 2020 00:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jnaNm-0004Qj-9h for bug-gnu-emacs@gnu.org; Tue, 23 Jun 2020 00:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Jun 2020 04:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41781 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41781-submit@debbugs.gnu.org id=B41781.159288586417006 (code B ref 41781); Tue, 23 Jun 2020 04:18:02 +0000 Original-Received: (at 41781) by debbugs.gnu.org; 23 Jun 2020 04:17:44 +0000 Original-Received: from localhost ([127.0.0.1]:35236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jnaNU-0004QE-4P for submit@debbugs.gnu.org; Tue, 23 Jun 2020 00:17:44 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jnaNQ-0004Px-Dd for 41781@debbugs.gnu.org; Tue, 23 Jun 2020 00:17:42 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 24EEB1007CA; Tue, 23 Jun 2020 00:17:35 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A8FEA100363; Tue, 23 Jun 2020 00:17:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1592885848; bh=aonId9ExeRCElGI1vyqkG7oyYc3eQJrSihNBmpM+3QQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=OSi/WsAk9UNoITvwcBYAZ05z1jfTwzAH4cAxyqzjKTQHG5e1w8moAQJyfJK1JwyZ5 BxbIKSpQUMwUqc+2KxGQfKcB13B4FtQAu2jUDnAG/3sswNaiWUYxJQ4SIdngBTd+Eg 29RonMywmSjk2eXKvnhRoWbIsuUX7+sZ39RmhI2zvWhsYZlBLvpVr4GM3Ucp9WEuQY MZ08WkCK7XlCAtjRJEHPS50y+YioyhNhkHAyp3Yzb2+dkcnAYA+8c+RJmrkfR5gxel M7YlxYBVpnhb2uF/4UwWKVhUSfTVdjhMYSY+ggQC9YsLAVmstgB8dLuqNfsmLUKAkI Efz3kCAOr2G5Q== Original-Received: from alfajor (unknown [108.175.228.207]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 62BC0120A06; Tue, 23 Jun 2020 00:17:28 -0400 (EDT) In-Reply-To: (Daniel Koning's message of "Mon, 22 Jun 2020 19:08:57 -0500") 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:182306 Archived-At: >> Looks like a bug in the corresponding function (`read-expression` or nearby). > OK, I've attached another patch for that function. Looks good to me, thanks. > If you change `read--expression', I don't know whether you'll think it > makes sense to add the extra overhead to `elisp--current-symbol'. I'm not worried about the overhead, but I don't like the potential syntax-ppss interaction, so if it's not needed, I'd rather not go there. > I can confirm that it suffers from the fairly significant drawback of > not working at all. Since the major replaces the minibuffer-specific > keymap, nothing ends up bound to `exit-minibuffer', so you can't even > enter an expression (or do anything else, like history paging). Fun! Thanks for trying ;-) > You could bind `overriding-local-map' at the top of the function, but > with that and the syntax table you're getting close to implementing > a de facto new mode inside the de jure old one. At that point it might > as well be a real custom major mode, as you suggested. Right. It's probably worth doing something here in the longer run, tho. E.g. the `minibuffer-local-map` and friends should really be major mode maps (and the inheritance between the maps should probably be reflected as inheritance between corresponding modes). Then you'd create an `emacs-lisp-minibuffer-mode` by deriving from some "normal" `minibuffer-local-mode`. > And then there's the possibility that some people's > `emacs-lisp-mode-hook' might contain code that assumes it's in a real > buffer and misbehaves in the minibuffer. Indeed. > On the other hand, you could do what eshell does for `eshell-command' > and turn on its major mode in the minibuffer while selectively binding > C-j, C-m, M-p, etc., inside the setup hook. I don't like this design at > all: if I were to make changes to my `minibuffer-local-map' bindings, > eshell would silently ignore them. Any custom mode for minibuffer input > should inherit an existing minibuffer keymap, in my book at least. Agreed. Stefan