简体   繁体   中英

Emacs 24 with prelude. .emacs conflict?

I installed emacs prelude . I use it to edit in C++ mainly. I have most of the things I would want for editing, but I am missing one.

I want to use gnu global, so I installed the package via Mx list-packages . I want to activate it by default for c++ files. I have 2 problems:

  1. Before using prelude, I would set up everything in ${HOME}/.emacs file, but it seems that prelude uses ${HOME}/.emacs.d/init.el . If I create a .emacs file, all prelude configuration will disappear. How can I preserve it? Maybe I should use a .emacs file still for my personal configuration and load from there init.el?

  2. I want to enable gnu global when I open a c++ file by default, but I don't know wether I have to set up a hook or what lisp variable/function to use for that, and in which file I should do it anymore.

For 1, you are already answering yourself :-). Just do a `(load "path-to-your-prelude-init-pile") in your .emacs. Emacs looks first for .emacs, then for ${HOME}/.emacs.d/init.el if the former is not found.

For 2, Put something like this in your config file:

(add-hook 'c-mode-common-hook
    (lambda ()
       (when (derived-mode-p 'c-mode 'c++-mode)
         (ggtags-mode 1))))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM