我写elisp的时候经常发现报错信息位置不对,不知道你们有没有注意?可能是什么问题?
一个例子,左flymake,右flycheck:
emacs -q
也一样。
我写elisp的时候经常发现报错信息位置不对,不知道你们有没有注意?可能是什么问题?
一个例子,左flymake,右flycheck:
emacs -q
也一样。
估计是 Byte compile 没保存每一个 Sexp 的位置,而只能精确到 top-level,比如下面三个警告位置都不对(没精确到第几行第几列):
;; -*- lexical-binding: t; -*-
(defun foo (a b)
(foo-non-existent)
(let ((c 1)
(d 2))
(+ a d)))
Compiling file /Users/xcy/foo.el at Tue Feb 25 09:17:30 2020
foo.el:2:1:Warning: Unused lexical variable `c'
foo.el:2:1:Warning: Unused lexical argument `b'
In end of data:
foo.el:7:1:Warning: the function `foo-non-existent' is not known to be
defined.
那看来不好解决了,只能等大佬改进byte compiler。