安装 smex 时候的 Warning

dotspacemacs/layers () 配置如下:

(defun dotspacemacs/layers ()
  "Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
  (setq-default
   ;; Base distribution to use. This is a layer contained in the directory
   ;; `+distribution'. For now available distributions are `spacemacs-base'
   ;; or `spacemacs'. (default 'spacemacs)
   dotspacemacs-distribution 'spacemacs
   ;; Lazy installation of layers (i.e. layers are installed only when a file
   ;; with a supported type is opened). Possible values are `all', `unused'
   ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
   ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
   ;; lazy install any layer that support lazy installation even the layers
   ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
   ;; installation feature and you have to explicitly list a layer in the
   ;; variable `dotspacemacs-configuration-layers' to install it.
   ;; (default 'unused)
   dotspacemacs-enable-lazy-installation 'nil
   ;; If non-nil then Spacemacs will ask for confirmation before installing
   ;; a layer lazily. (default t)
   dotspacemacs-ask-for-lazy-installation t
   ;; If non-nil layers with lazy install support are lazy installed.
   ;; List of additional paths where to look for configuration layers.
   ;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
   dotspacemacs-configuration-layer-path '()
   ;; List of configuration layers to load.
   dotspacemacs-configuration-layers
   '(
     ;; ----------------------------------------------------------------
     ;; Example of useful layers you may want to use right away.
     ;; Uncomment some layer names and press <SPC f e R> (Vim style) or
     ;; <M-m f e R> (Emacs style) to install them.
     ;; ----------------------------------------------------------------
     ivy
     smex
     (better-defaults :variables better-defaults-move-to-beginning-of-code-first nil)
     (auto-completion :variables auto-completion-enable-sort-by-usage t
                      auto-completion-enable-snippets-in-popup t
                      :disabled-for org markdown)
     emacs-lisp
     markdown
     org
     (shell :variables
            shell-default-height 30
            shell-default-position 'bottom)
     ;; git
     ;; version-control
     ;; spell-checking
     ;; syntax-checking
     )
   ;; List of additional packages that will be installed without being
   ;; wrapped in a layer. If you need some configuration for these
   ;; packages, then consider creating a layer. You can also put the
   ;; configuration in `dotspacemacs/user-config'.
   dotspacemacs-additional-packages '()
   ;; A list of packages that cannot be updated.
   dotspacemacs-frozen-packages '()
   ;; A list of packages that will not be installed and loaded.
   dotspacemacs-excluded-packages '(spacemacs-purpose-popwin)
   ;; Defines the behaviour of Spacemacs when installing packages.
   ;; Possible values are `used-only', `used-but-keep-unused' and `all'.
   ;; `used-only' installs only explicitly used packages and uninstall any
   ;; unused packages as well as their unused dependencies.
   ;; `used-but-keep-unused' installs only the used packages but won't uninstall
   ;; them if they become unused. `all' installs *all* packages supported by
   ;; Spacemacs and never uninstall them. (default is `used-only')
   dotspacemacs-install-packages 'used-only))

添加了 ivy, smex 重启 emacs。启动界面出现:(Spacemacs) Warning: More than one init function found for package smex. Previous owner was ivy, replacing it with layer smex.

是这两个 layer 不能共存吗?

你使用的是什么版本的Spacemacs?0.200以后的版本,Ivy 和 counsel 配合使用,counsel里面已经包括了 smex。

版本: [email protected] (spacemacs).

我从哪里可以知道 ivy 包含了 smex 以及需要配合 counsel 使用, 官方 layer list: ivy 404了。

并且我从 dotspacemacs-configuration-layers 中移除 smex 后, SPC : 也失效了。

可以在 Spacemacs 中直接查询文档: SPC h SPC

然后查询 smex 可以看到 smexivysmex 两个 layer 中都存在.

我查询 smex 只显示一个 smex install。查询 ivy, 里面也没有 smex 相关。截图如下:

search smex layer

search ivy

我没查文档,是直接看源文件发现的:joy:

SPC-h-SPC 是查看 spacemacs 所有的 layer 吗?

spacemacs/layers/+completion/ivy/package.el: 这里应该是 ivy 会加载的 layer 吧,这里面是有 smex 的了。

spacemacs/layers/+completion/ivy/layers.el: 这里的注释应该也是说明包含了 smex 吧。

;; smex is handled by the `ivy' layer and we don't want
;; to use the ownership mechanism of layers because it is dependent
;; on the order of layer declaration
(configuration-layer/remove-layer 'smex)

如果在 ivy 之前声明 smex, 就会自动移除?

移除它干什么,把你加载的smex layer去掉,只加载ivy层就成了。这有就已经能够使用smex了

不是我移除,这是 ivy 自己的代码,这一段的意思 是不是 自动移除 smex?