From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: `read--expression' and `read-minibuffer' Date: Sat, 3 Sep 2016 11:20:52 -0700 (PDT) Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1472926884 27268 195.159.176.226 (3 Sep 2016 18:21:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Sep 2016 18:21:24 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 03 20:21:20 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgFZ1-0005ZN-0y for ged-emacs-devel@m.gmane.org; Sat, 03 Sep 2016 20:21:11 +0200 Original-Received: from localhost ([::1]:47373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgFYy-0001bZ-K7 for ged-emacs-devel@m.gmane.org; Sat, 03 Sep 2016 14:21:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgFYs-0001bC-Au for emacs-devel@gnu.org; Sat, 03 Sep 2016 14:21:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgFYo-0006ek-5C for emacs-devel@gnu.org; Sat, 03 Sep 2016 14:21:01 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:42291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgFYn-0006eW-TQ for emacs-devel@gnu.org; Sat, 03 Sep 2016 14:20:58 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u83IKt7H024114 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 3 Sep 2016 18:20:55 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u83IKsrx009838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 3 Sep 2016 18:20:55 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u83IKsXw030005 for ; Sat, 3 Sep 2016 18:20:54 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207155 Archived-At: Function `read--expression' was added in Emacs 24.4. Can someone please explain why this is an "internal" function (two hyphens in the name)? Why wouldn't users want to use this to read a Lisp expression from the minibuffer? It seems like `read--expression' should now be the usual way to read and return a Lisp expression, and that it should NOT be considered "internal". No? On the other hand, we still also have the longstanding (non-internal) function `read-minibuffer' for reading and returning a Lisp "object". It's not clear to me how a Lisp object differs from a Lisp sexp. (And the doc of `interactive' even calls what "x" reads a "Lisp expression", not a "Lisp object".) Well, sure, there are Lisp objects (e.g. byte-compiled functions) that are not readable expressions. But those are not readable anyway, AFAIK. `read-minibuffer', like `read--expression', just reads expressions, AFAICT. The difference between `read-minibuffer' and `read--expression' is this: The former uses `minibuffer-local-map', so it has no special handling of Lisp expressions and no completion. The latter uses `read-expression-map', and it provides Lisp-sexp completion. Why isn't `read--expression' treated as a user function, like `read-minibuffer', instead of being considered "internal"? And `read-minibuffer' is still used for `interactive' with spec "x". Why isn't `read--expression' used for that now? How about promoting `read--expression' to `read-expression' and using it for `(interactive "x")'? Nothing wrong with also keeping `read-minibuffer' (though it's name is not great), but why continue to use it in preference to `read--expression'? `read-minibuffer' is still used in several places, but I don't see why those places wouldn't benefit from using `read--expression' instead. Am I missing something? I ask because I read Lisp sexps from the minibuffer, and I don't (yet) see any reason to use `read-minibuffer' instead of "internal" function `read--expression'. I'd like to learn which to use and why. Thx.