Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get paredit mode when doing eval-expression?

I love Emacs' paredit-mode, but I miss it very sorely when doing eval-expression (M-:). How can I have paredit in the minibuffer when doing eval-expression? Thanks!

like image 460
draebek Avatar asked Apr 19 '10 05:04

draebek


2 Answers

Add a function to minibuffer-setup-hook, like so:

(add-hook 'minibuffer-setup-hook 'conditionally-enable-paredit-mode)
(defun conditionally-enable-paredit-mode ()
  "enable paredit-mode during eval-expression"
  (if (eq this-command 'eval-expression)
      (paredit-mode 1)))
like image 137
Trey Jackson Avatar answered Nov 06 '22 20:11

Trey Jackson


Add function paredit-mode to eval-expression-minibuffer-setup-hook, like so

(add-hook 'eval-expression-minibuffer-setup-hook #'paredit-mode)
like image 45
Marco Wahl Avatar answered Nov 06 '22 20:11

Marco Wahl