[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Could eval-expression be in lisp mode?
From: |
Drew Adams |
Subject: |
RE: Could eval-expression be in lisp mode? |
Date: |
Fri, 6 Sep 2019 10:52:14 -0700 (PDT) |
> I use eval-expression (M-:) a lot for quick scripts which work on a
> buffer and it's always annoying my usual elisp abbrevs, for example,
> are not available in the minibuffer when editing an expression.
>
> Which raises the question: why isn't the minibuffer in
> lisp-interaction-mode when using M-: ?
>
> Is there a drawback?
(FWIW, I never use `lisp-interaction-mode'. Even
for scratch buffers I use `emacs-lisp-mode'.)
Vanilla `M-:' does at least give you completion
with `TAB' and `M-TAB' (aka `ESC TAB').
I typically want the result in another buffer, in
`emacs-lisp-mode', but I also want to be able to
see it instead in a tooltip. And I want the command
to respect different print options (so I can have
different values from those for `eval-expression').
I bind `M-:' to `pp-eval-expression', from `pp+.el'.
(Actually, I use `icicle-pp-eval-expression.)
`pp-eval-expression' and other commands in `pp+.el'
read a Lisp expression using `pp-read-expression-map',
not `read-expression-map' (provides indentation and
defun-eval keys).
You can bind any keys you like (in either map),
to get whatever Lisp abbrev support you want.
https://www.emacswiki.org/emacs/PpPlus