[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: How properly utilize the minibuffer and inactive minibuffer startup
RE: How properly utilize the minibuffer and inactive minibuffer startup hooks?
Thu, 10 Jul 2014 09:09:11 -0700 (PDT)
> >> 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.
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',
`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).