Emacs折叠模式错误
我希望能够使用 http://www.emacswiki 中的 Folding.el 提供的 emacs 折叠模式.org/emacs/FoldingMode
我将以下内容放入我的 .emacs 文件中:
(setq load-path (cons (concat (getenv "HOME") "/.emacs.d") load-path))
(load "folding")
(folding-mode-add-find-file-hook)
(folding-add-to-marks-list 'latex-mode "%{" "%}" nil t)
然后,当我选择一个区域并运行时,
M-x folding-fold-region
我收到错误
Wrong type argument: char-or-string-p, nil
I want to be able to use the emacs folding mode provided by folding.el from http://www.emacswiki.org/emacs/FoldingMode
I put the following in my .emacs file:
(setq load-path (cons (concat (getenv "HOME") "/.emacs.d") load-path))
(load "folding")
(folding-mode-add-find-file-hook)
(folding-add-to-marks-list 'latex-mode "%{" "%}" nil t)
Then, when I select a region and run
M-x folding-fold-region
I get the error
Wrong type argument: char-or-string-p, nil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有两个问题:
您不必重新声明乳胶模式的标记,因为这已经在 folder.el 第 4411 行。因此,您应该删除行
(folding-add-to-marks-list 'latex-mode "%{" "%}" nil t)
您收到错误
类型错误参数:char-or-string-p, nil
(当未启用folder-mode
时)。默认情况下,添加行(folding-mode-add-find-file-hook)
不足以在folder-mode
中打开文件。要以文件夹模式打开,您还应该将折叠文件局部变量放在要打开的文件的第一行,例如在 lisp 中:< /p>:这个局部变量,以及
.emacs
中的(folding-mode-add-find-file-hook)
命令,folder-mode
是启用后,在区域上调用folding-fold-region
时不再有问题。执行 Ch f
folding-mode-add-find-file-hook
RET 对此进行解释机制。There are two problems :
you don't have to re-declare marks for latex-mode as this is already done in folder.el line 4411. Thus you should remove the line
(folding-add-to-marks-list 'latex-mode "%{" "%}" nil t)
You get the error
Wrong type argument: char-or-string-p, nil
when thefolder-mode
is not enabled. Adding the line(folding-mode-add-find-file-hook)
is not enough to open a file infolder-mode
by default. To open infolder-mode
, you should also place thefolded-file
local variable in the first line of the file you want to open, for example, in lisp :With this local variable, and the
(folding-mode-add-find-file-hook)
command in your.emacs
thefolder-mode
is enabled and you don't have problem anymore when callingfolding-fold-region
on a region.Do a C-h f
folding-mode-add-find-file-hook
RET to have the explanation of this mechanism.