eval: Required feature ‘subr’ was not provided

今天发现 snails 更新了一个补丁,有要求 subr

Emacs -q

执行 C-u C-x C-e:

(require 'subr)               →   eval: Required feature ‘subr’ was not provided

以及 subr.el 相同目录下部分文件, 出现无法 require 的问题:

(require 'savehist)           →   savehist
(require 'saveplace)          →   saveplace
(require 'sb-image)           →   sb-image
(require 'scroll-all)         →   scroll-all
(require 'scroll-bar)         →   scroll-bar
(require 'scroll-lock)        →   scroll-lock
(require 'select)             →   select
(require 'server)             →   server
(require 'ses)                →   ses
(require 'shadowfile)         →   shadowfile
(require 'shell)              →   shell
(require 'simple)             →   simple
(require 'skeleton)           →   skeleton
(require 'sort)               →   sort
(require 'soundex)            →   soundex
(require 'speedbar)           →   speedbar
(require 'startup)            →   eval: Required feature ‘startup’ was not provided
(require 'strokes)            →   strokes
(require 'subdirs)            →   eval: Required feature ‘subdirs’ was not provided
(require 'subr-x)             →   subr-x

我的 Emacs:

GNU Emacs 26.2 (build 1, x86_64-w64-mingw32) of 2019-04-13

从来没有遇到过 require 源代码出现问题。目前打算更新 Emacs,看看怎么样。

有遇到相同问题的 Emacs User 吗?


@cireu 电邮了 emacs 开发者列表,有兴趣的话,可以看看:


C-h f when 会是什么呢?

when is a Lisp macro in ‘subr.el’.

(when COND BODY...)

If COND yields non-nil, do BODY, else return nil.
When COND yields non-nil, eval BODY forms sequentially and return
value of last one, or nil if there are none.

神奇居然能找到 when 这个 Lisp macro。

你没找到 subr 吗??????????

神奇居然能找到 when 。

可以从帮助 buffer 可以顺着 Link 找到 subr.el

但是裸启动无法 (require 'subr)

Debugger entered--Lisp error: (void-variable subr)
  (require subr)
  eval((require subr) nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)

问题主要是 snails require 了 subr,启动包报错,注释掉 (require 'subr) 是可以正常使用的。

但是 snails 新版 的功能还没测试,有无影响, 尚不明确。

subr.el里面似乎没有(provide 'subr)

我手动在 subr.el 加了(provide 'subr) 然后裸启,问题依旧存在。

先试试 snails 吧,实在不行试试更新 Emacs。

删掉require subr就行了。subr在emacs启动的时候已经准备好了


我把 (require 'subr) 删除了吧, 主要是看到 string-match-p 的依赖,最后发现是Emacs内置的 subr.el.gz 里面


你们没有发现 C-h v fea 和 C-h v load-h

@cireu 就是在等懒猫哈哈!

@manateelazycat 谢谢啦!

@zhouchongzxc 是 feature load-history,这两个变量吗?




@cireu @manateelazycat @JJPandari @zhouchongzxc

To: Zhu Zihao <[email protected]>
CC: [email protected]
Subject: Re: Why subr.el doesn't provide a feature?
From: Eli Zaretskii <[email protected]>
Date: Thu, 29 Aug 2019 10:12:08 +0300

> Date: Thu, 29 Aug 2019 11:59:30 +0800
> From: Zhu Zihao <[email protected]>
> Cc: [email protected]
> There's no form like "(provide 'subr)" in subr.el. I'm interesting in the reason
> of not doing such thing? Is it because it will cause conflict during the
> bootstrap? 

Because it's preloaded, I guess.

1 个赞

天, 教主居然出现在这个问题的 email 列表中。