小编kum*_*600的帖子

如何为defcustom定义的变量设置缓冲区本地值?

在emacs中,我们可以定义可自定义的用户选项变量.

defcustom - 在Emacs中编程Lisp http://www.gnu.org/software/emacs/manual/html_node/eintr/defcustom.html

我们可以使变量具有缓冲区本地绑定.

创建Buffer-Local - GNU Emacs Lisp参考手册http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Buffer_002dLocal.html#Creating-Buffer_002dLocal

如果我想制作不可自定义的变量,我可以使用make-local-variablesetq-local.

但我找不到任何方法如何使自定义变量具有缓冲区本地绑定.

即使我调用make-local-variable了变量defcustom,也custom-set-variables设置为global-value.

如果我调用setq-local,则将value设置为local-variable.这个比较好.但我认为这不是最佳做法.

有没有任何有效的方法如何为defcustom定义的变量设置缓冲区本地值?

emacs elisp

8
推荐指数
1
解决办法
2182
查看次数

标签 统计

elisp ×1

emacs ×1