开发者

Loading fic-mode in emacs

开发者 https://www.devze.com 2023-03-14 03:43 出处:网络
This answer gave me the solution I needed. The only problem for me, is that I have to load it, namely fic-mode, manually. More explicitly, whenever I open a c++ file, I have to do M-x fic-mode and the

This answer gave me the solution I needed. The only problem for me, is that I have to load it, namely fic-mode, manually. More explicitly, whenever I open a c++ file, I have to do M-x fic-mode and then M-x font-lock-fontify-buffer in order to have 开发者_如何学Goit really up and running. In my .emacs I have

(require 'fic-mode)
(add-hook 'c++-mode-hook '(lambda () (fic-mode 1)))

but it doesn't do the trick.

Do you have any suggestions how to make it available automatically?


Try the following: create a new file containing the following three lines:

(setq load-path (cons "/path/to/fic-mode-directory" load-path))
(require 'fic-mode)
(add-hook 'c++-mode-hook 'turn-on-fic-mode)

Replace "/path/to/fic-mode-directory" with the absolute path to the directory in which you saved fic-mode.el.

Then from the command line, run

emacs -Q -l /path/to/file

where /path/to/file is the path to the above file.

Now type C-x C-f test.cpp.

Is fic-mode turned on in the resulting buffer?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号