请教emmet-mode的报错:Lisp error: (void-function first)

Emacs版本:29.2

问题描述: 使用默认的<C-j>执行emmet-expand-line,就会弹出报错:

Debugger entered--Lisp error: (void-function first)
  (first expr)
  (if (first expr) (list (first expr) start end))
  (let* ((end (point)) (start (emmet-find-left-bound)) (line (buffer-substring-no-properties start end)) (expr (emmet-regex "\\([ \11]*\\)\\([^\n]+\\)" line 2))) (if (first expr) (list (first expr) start end)))
  emmet-expr-on-line()
  (let ((expr (emmet-expr-on-line))) (if expr (let ((markup (emmet-transform (first expr)))) (if markup (progn (delete-region (second expr) (third expr)) (emmet-insert-and-flash markup) (emmet-reposition-cursor expr))))))
  (if (and preview beg) (progn (goto-char here) (emmet-preview beg end)) (let ((expr (emmet-expr-on-line))) (if expr (let ((markup (emmet-transform (first expr)))) (if markup (progn (delete-region (second expr) (third expr)) (emmet-insert-and-flash markup) (emmet-reposition-cursor expr)))))))
  (let* ((here (point)) (preview (if emmet-preview-default (not arg) arg)) (beg (if preview (emmet-find-left-bound) (if (use-region-p) (progn (region-beginning))))) (end (if preview here (if (use-region-p) (progn (region-end)))))) (if (and preview beg) (progn (goto-char here) (emmet-preview beg end)) (let ((expr (emmet-expr-on-line))) (if expr (let ((markup (emmet-transform ...))) (if markup (progn (delete-region ... ...) (emmet-insert-and-flash markup) (emmet-reposition-cursor expr))))))))
  emmet-expand-line(nil)
  funcall-interactively(emmet-expand-line nil)
  command-execute(emmet-expand-line)

通过runemacs.exe -Q 加载emmet-mode.el,不会出现上述问题。 主要是不知道first这个函数到底为什么没有被加载。

可能是这个第三方库太久没更新了吧, cl-first (来自 cl-lib) 以前的名字就是 first (来自 cl)

自己替换没定义的函数就行

first 早就被 Emacs 删了,大概你旧版本没删

确实如此,把这类函数都加上cl-确实解决了。 但为什么Emacs -Q中却不会报错呢?是有什么配置干扰了emmet-mode.el的加载方式?

你自己的配置开了 debug on error,默认 emacs 遇到错误只会在 minibuffer 输出,你没注意看罢了