如何让 panggu-spacing 不在 posframe 上自动加空格

我用的是 spacemacs,并且使用了 chinese layer,其中有一个 pangu-spacing 包。

layer 的默认配置如下:

(defun chinese/init-pangu-spacing ()
  (use-package pangu-spacing
    :defer t
    :init (progn (global-pangu-spacing-mode 1)
                 (spacemacs|hide-lighter pangu-spacing-mode)
                 ;; Always insert `real' space in org-mode.
                 (add-hook 'org-mode-hook
                           '(lambda ()
                              (set (make-local-variable 'pangu-spacing-real-insert-separtor) t))))))

我自己进行了部分重新配置,如下:

(defun hurricane-ui/post-init-pangu-spacing ()
  (progn
    ;; Add toggle options.
    (spacemacs|add-toggle pangu-spaceing
      :status pangu-spacing-mode
      :on (global-pangu-spacing-mode)
      :off (global-pangu-spacing-mode -1)
      :documentation "Toggle pangu spacing mode."
      :evil-leader "ots")
    (add-hook 'org-mode-hook
              '(lambda ()
                  (set (make-local-variable 'pangu-spacing-real-insert-separtor) t)
                  (spacemacs/toggle-pangu-spaceing-on)))))

并且在论坛中查找到 pangu-spacing-inhibit-mode-alist 这个变量可以设置让 pangu-spacing 不生效。

custom.el 文中将 ivy-modeivy-posframe-mode 都加入到该变量中:

(pangu-spacing-inhibit-mode-alist (quote (eshell-mode shell-mode term-mode dired-mode ivy-posframe-mode ivy-mode helm-mode)))

可是还是没有达到我想要的效果,使用 counsel-recentf,或者 find-file 函数时,如果文件名是中文和英文混合输入,pangu-spacing 会自动在 posframe 显示的文件名上加上空格,而 minibuffer 的却不会, 如下图所示:

请问该如何设置,让 posframe 上输入查找文件名时不让 pangu-spacing 自动加入空格呢?

global-pangu-spacing-mode 关了,只在 org-mode 或者 text-mode 中开启?

pangu-spacing-inhibit-mode-alist 变量中添加 fundamental-mode 即可,我自己尝试了,没有问题了。谢谢你的建议。

1 个赞