私のモードのバイトコンパイル:
(defun dict-setup-expansions ()
"Add `dict-mode' specific expansions."
(set (make-local-variable 'er/try-expand-list) (list #'dict-mark-article)))
警告を出します:
Warning: assignment to free variable `er/try-expand-list'
er/try-expand-list外部で定義されているため、これは正常な状況です。図書館expand-regionにあるhttp://elpa.gnu.org
expand-regionライブラリへのモードレジスタ拡張ですが、モードなしでexpand-regionモードを実行しても問題ありません。
警告に対処する適切な方法は宣言を追加することだと思います:
(defvar er/try-expand-list)
defvar ドキュメントは言う:
The `defvar' form also declares the variable as "special",
so that it is always dynamically bound even if `lexical-binding' is t.
使用します-*- lexical-binding: t -*-。それはdefvar変数なしer/try-expand-listでレキシカルスコープにあり、私は本当のバグを持っているということですか?
@JeanPierre修正済み。
—
Givenkoa
(defvar er/try-expand-list)。