embark的modeline如何隐藏?

我设置了hide-mode-line如下但是在embark-act时还是会出现如下的modeline?

(require 'hide-mode-line)
(hide-mode-line-mode)
(global-hide-mode-line-mode)

embark的设置如下:

(use-package embark
  :ensure t
  :bind
  (("C-." . embark-act)         ;; pick some comfortable binding
   ("M-." . embark-dwim)        ;; good alternative: M-.
   ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings'

  :init
  ;; Optionally replace the key help with a completing-read interface
  (setq prefix-help-command 'embark-prefix-help-command)

  ;; Show the Embark target at point via Eldoc.  You may adjust the Eldoc
  ;; strategy, if you want to see the documentation from multiple providers.
  (add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
  (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly)

;;   :custom
;;  (add-hook 'embark-act-buffer-hook
;;          (lambda ()
;;            (setq mode-line-format nil)))
;;    (setq mode-line-format nil)
;;   (add-hook 'embark-act-buffer-hook #'hide-mode-line-mode)
  :config
  ;; Hide the mode line of the Embark live/completions buffers
  (add-to-list 'display-buffer-alist
               '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
                 nil
                 (window-parameters (mode-line-format . none))))

)

用emacs -Q -l init-emacs.el测试后embark-act的modeline也没有隐藏. mac, [email protected],embark-20231112

你是想要隐藏所有 buffer 的 mode-line 吗

是的! 想所有都隐藏。

不考虑在是用的时候恢复的话直接用 (setq-default mode-line-format nil)

使用你提供的命令,同时将elpy的代码注释掉,就不会再出现上面的问题了。

(use-package elpy
  :ensure t
  :init
   ;:config
  (elpy-enable)
  :config
  (add-to-list 'auto-mode-alist '("\\.py\\'" . elpy-mode))
  ;:after python
  :hook                     
  (python-ts-mode . elpy-mode)
  )

可能elpy-20230803.1455和embark有冲突。 谢谢!

1 个赞

可能 elpy 自己又设置了 mode-line?你可以加一个hook,在启动elpy的时候再设置一遍mode-line为nil