From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: How properly utilize the minibuffer and inactive minibuffer startup hooks? Date: Thu, 10 Jul 2014 09:09:11 -0700 (PDT) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1405008611 14662 80.91.229.3 (10 Jul 2014 16:10:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Jul 2014 16:10:11 +0000 (UTC) Cc: Emacs Help To: Grant Rettke , jduthen@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 10 18:10:04 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X5Gv3-000579-VO for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Jul 2014 18:10:02 +0200 Original-Received: from localhost ([::1]:38907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Gv3-0001Z0-1m for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Jul 2014 12:10:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5GuU-0001Ya-BW for help-gnu-emacs@gnu.org; Thu, 10 Jul 2014 12:09:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5GuK-0005zr-OW for help-gnu-emacs@gnu.org; Thu, 10 Jul 2014 12:09:25 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:39251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5GuK-0005zf-0s for help-gnu-emacs@gnu.org; Thu, 10 Jul 2014 12:09:16 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s6AG9CYE006013 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Jul 2014 16:09:13 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6AG9CW3010389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 10 Jul 2014 16:09:12 GMT Original-Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6AG9CNP010385; Thu, 10 Jul 2014 16:09:12 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98625 Archived-At: > >> 1 My goal > >> =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90 > >> > >> My goal is to enable [smartparens] in the minibuffer > >> but only when calling `eval-expression'. > > > > If, by any chance, your goal is a subgoal of enabling smartparens > > when evaluating some lisp expressions, I would recommand to use: > > M-x ielm RET > > > > Usually, when I have to type M-: more than once > > or if the expression is complexe enough to require paren matching, > > I tend to use ielm. > > Good point as I'd been using eval-expression just like an IELM. FWIW - 1. You _can_ reasonably use the minibuffer for evaluating complex sexps. Michael H's email answers your question in this regard. And I would add the suggestion to change `M-:' from `eval-expression' to `pp-eval-expression'. It is generally more useful to examine a pretty-printed result (this should be the default behavior in Emacs, IMO, but it is not). 2. Another alternative to using ielm is to just use *scratch* or an Emacs-Lisp buffer to evaluate sexps. 3. Personally, I have `M-:' in the minibuffer bound to `icicle-pp-eval-expression-in-minibuffer', which just calls `icicle-pp-eval-expression from a recursive minibuffer. And the latter command is like `pp-eval-expression' but it respects user options `icicle-pp-eval-expression-print-length', `icicle-pp-eval-expression-print-level', and `eval-expression-debug-on-error'. (If you don't use Icicles then you can get similar behavior wrt pretty-printing from library pp+.el.) And personally I don't bother with `smartparens-mode' (but see Michael H's solution for that). I use only `show-paren-mode' (and there is no problem with that in the minibuffer).