gpt4 book ai didi

emacs - 下划线作为单词的一部分以表示前向词不起作用

转载 作者:行者123 更新时间:2023-12-04 00:06:53 28 4
gpt4 key购买 nike

我试图让下划线被视为 forward/backward-word 的词的一部分功能如所述 herehere .我特别想让它为 nxhtml 工作模式,但真的希望它在所有模式下都能像这样工作。

我修改了我的 site-start.el提交了许多不同的方式,但都无济于事。但是如果我手动执行命令 M-x modify-syntax-table在缓冲区中,它工作得很好。我只是不能让它成为默认行为。

这是我尝试放入 site-start.el 的内容文件:

;; 1
;; thought this would apply it to all modes - no error, but did not work
(modify-syntax-entry ?_ "w")

;; 2
;; thought this would automatically set it on a mode change - no error, but did not work
(defun change-major-mode-hook ()
(modify-syntax-entry ?_ "w"))


;; 3
;; thought this would apply it to all modes - no error, but did not work
(modify-syntax-entry ?_ "w")

;; 4
;; this produced a symbol's value as variable is void error
(modify-syntax-entry ?_ "w" nxhtml-mode-syntax-table)

我错过了什么?

最佳答案

您是否尝试过修改 nxhtml-mode-hook直接地?像这样:

(add-hook 'nxhtml-mode-hook
(lambda () (modify-syntax-entry ?_ "w")))

关于emacs - 下划线作为单词的一部分以表示前向词不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10666178/

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