gpt4 book ai didi

emacs - 为什么我以这种方式启动 iswitchb-mode?

转载 作者:行者123 更新时间:2023-12-04 17:59:31 25 4
gpt4 key购买 nike

根据 emacs 信息页面,以下是启用 iswitchb-mode 的方法:

To enable Iswitchb mode, type M-x iswitchb-mode, or customize the variable iswitchb-mode to t



所以我把以下内容放在我的 .emacs 中:
(setq iswitchb-mode t)

但是,这似乎不起作用。搜索emacs wiki后,我发现我需要使用这个:
(iswitchb-mode 1)

有人可以解释为什么我需要以这种方式启用它吗?我想更好地理解elisp,而不仅仅是从地方复制和粘贴东西。

最佳答案

通常,模式将定义同名的变量和函数。该函数将在调用时正确设置变量,但它是打开模式的函数,而不仅仅是变量(仅跟踪模式的状态)。

在您的特定情况下,您被告知自定义变量,但您只需设置它即可。不同之处在于,当变量的值发生变化时,custom 知道要做什么,而 `setq' 对此一无所知。如果您查看此变量的帮助 (C-h v iswitchb-mode),您会得到:

iswitchb-mode is a variable defined in `iswitchb.el'.
Its value is t

Documentation:
Non-nil if Iswitchb mode is enabled.
See the command `iswitchb-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `iswitchb-mode'.

You can customize this variable.

关于emacs - 为什么我以这种方式启动 iswitchb-mode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1421688/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com