unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Grant Rettke <gcr@wisdomandwonder.com>, jduthen@gmail.com
Cc: Emacs Help <help-gnu-emacs@gnu.org>
Subject: RE: How properly utilize the minibuffer and inactive minibuffer startup hooks?
Date: Thu, 10 Jul 2014 09:09:11 -0700 (PDT)	[thread overview]
Message-ID: <cc40b12c-47ca-4a0b-a38c-6cfffa686785@default> (raw)
In-Reply-To: <CAAjq1mfgjW_=F4p84jk6xAak+3GUjEaFksMHS=xnq=FZtF7Eew@mail.gmail.com>

> >> 1 My goal
> >> ═════════
> >>
> >>   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).



  reply	other threads:[~2014-07-10 16:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.5105.1404869933.1147.help-gnu-emacs@gnu.org>
2014-07-10 12:46 ` How properly utilize the minibuffer and inactive minibuffer startup hooks? jduthen
2014-07-10 15:08   ` Grant Rettke
2014-07-10 16:09     ` Drew Adams [this message]
2014-07-08 20:07 Grant Rettke
2014-07-09 22:08 ` Michael Heerdegen
2014-07-11  0:51   ` Grant Rettke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc40b12c-47ca-4a0b-a38c-6cfffa686785@default \
    --to=drew.adams@oracle.com \
    --cc=gcr@wisdomandwonder.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=jduthen@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).