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
这个函数到底为什么没有被加载。