相关疑难解决方法(0)

Emacs Lisp中setq和setq-default之间的区别

我有一个关于Emacs Lisp的问题.setqsetq-default有什么区别?我很困惑.

教程说setq本地缓冲区生效,而setq-default影响所有缓冲区.

例如,如果我在init.el中写了(setq a-var a-vars-value),我发现在启动Emacs并打开一个新缓冲区之后,a-var也在那里,它的值是a-vars-value.我以为不应该在那里.似乎setqsetq-default之间没有区别.

我的理解有问题吗?

非常感谢你.

例如:
1)我在init.el文件中写了(setq hello 123),我在shell中运行emacs abuffer,然后我输入"hello Cx Ce",它显示"123".当我在所有新缓冲区中运行它时,会发生同样的情况.

2)我在init.el文件中写了(setq tab-width 4).当我运行tab-width Cx Ce时,它显示"8"(当前模式为'Text').但是,当我使用(setq-default tab-width 4)时,它显示"4".我无法解释这种现象.

emacs elisp

79
推荐指数
1
解决办法
1万
查看次数

XCode 4注释格式(换行)

我认为多行评论理想情况应该是这样的:

/* this is a mult-line comment, which wraps lines at some reasonable length,
 * usually approximately 80 characters. this way, comments are easy to read
 * and, with any half way capable text editor, easy to edit without having
 * to manually reshuffle lines, line breaks, and the comment leader. */

// this is a mult-line comment, which wraps lines at some reasonable length,
// usually approximately 80 characters. this way, comments are easy to read
// and, with …
Run Code Online (Sandbox Code Playgroud)

formatting comments xcode4

12
推荐指数
1
解决办法
3868
查看次数

标签 统计

comments ×1

elisp ×1

emacs ×1

formatting ×1

xcode4 ×1