如何从迷你缓冲区启动一个新的迷你缓冲区(非递归)

时间:2014-08-12 06:43:25

标签: emacs

有时,我按下错误的键组合并得到错误的迷你缓冲区。我想杀死我当前的迷你缓冲区,只需按下所需迷你缓冲区选项的组合键就可以打开一个迷你缓冲区。我该怎么做?

1 个答案:

答案 0 :(得分:1)

不确定这是不是一个好主意。

(setq enable-recursive-minibuffers t)

(add-hook 'minibuffer-setup-hook 'my-minibuffer-unrecursion)

(defun my-minibuffer-unrecursion ()
  (when (> (minibuffer-depth) 1)
    (run-with-timer 0 nil 'my-interactive-command
                    this-command current-prefix-arg)
    (abort-recursive-edit)))

(defun my-interactive-command (cmd arg)
  (let ((current-prefix-arg arg))
    (call-interactively cmd)))