variables - .emacs 中区分大小写的 setq 没有效果

标签 variables emacs case-sensitive case-insensitive dot-emacs

我的 .emacs 文件中有很多自定义内容:字体、颜色、窗口大小、键绑定(bind)等。所有这些都有效。

最后,我刚刚添加了一个:(setq case-fold-search nil)。这是一个变量,当设置为 nil 时,应该使搜索在所有 emacs 模式下区分大小写。这不适合我。

在单个缓冲区中将 case-fold-search 设置为 nil 有效,但是当我在 .emacs 中设置它时,它不起作用不工作。 .emacs 中的 setq 声明有时可能不起作用,是否有原因?我应该如何尝试调试该问题?

最佳答案

这是缓冲区局部变量的正常行为。 setq-default 可用于为它们建立默认值。

您可以通过使用 C-h v case-fold-search (或 M-x describe-variable)查看其文档来确定变量是否为本地缓冲区,其中此案例报告(注意第 4 行):

case-fold-search is a variable defined in `buffer.c'.
Its value is t

  Automatically becomes buffer-local when set in any fashion.

Documentation:
*Non-nil if searches and matches should ignore case.

You can customize this variable.

关于variables - .emacs 中区分大小写的 setq 没有效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5345051/

相关文章:

javascript - 使用变量分配函数参数?

java - 这是阴影变量的情况吗?

将变量作为参数的默认值的 PHP 函数

emacs - 更改 Emacs 中的文本外观 : overlays work, 文本属性不会

mysql - 如何使用 utf8_unicode_ci 处理区分大小写的列

c# - 将时间四舍五入到最接近的小时

linux - C 预处理器定义未被 Cedet/Semantic 考虑

emacs - Emacs Lisp 中的 GNU+Linux 构建框架?

sql-server - 如何确定 SQL Server 实例是否区分大小写

php - 发送 : How to fetch record from Database without considering case sensitive?