0

Im just starting to look into Emacs as a IDE. There are lots of articles about how to setup Emacs as an IDE for languages XYZ. Most of these articles talk about how to switch content in your emacs.d. However this would only work if you use Emacs for one language?

Say for example I want to use Emacs with Clojue, Javascript and Python. For Clojure i want to use LiveMode and for Javascript i want to use some other mode and the same for Python. All highly specialized with a background repl running. How would I go about setting emacs up for this and what if I would like to use for example EVIL mode on all the IDE:s? Would it be possible to switch IDE setup at runtime depending on file ending or do i have to restart Emacs loading different settings each time?

Alex Miller
  • 69,183
  • 25
  • 122
  • 167
user3748315
  • 149
  • 3
  • 11

1 Answers1

2

Emacs allows to use so-called modes with files, e.g. python-mode for Python files etc. Automated enabling of modes for a specific file is either happening through file-local special variables or via associations of file-types via auto-mode-alist. Modes actually provide these "special" settings you are talking about. If you want to add a special additional behavior in some mode, you typically add the required setup functions in the so-called mode-hook. It might happen you run into incompatibilities between various extensions or modes, but this is a pretty rare case.

schaueho
  • 3,419
  • 1
  • 21
  • 32
  • But how do you actually store the different modes? For example Clojure LiveMode requires me to totally swap out my emacs.d folder so i loose all my other modes? – user3139545 Sep 01 '14 at 17:11
  • 2
    Swapping your entire `.emacs.d` is *highly* unusual for Emacs. I've never heard of something telling you to do that. It can a useful thing to do while testing, but usually you would integrate any necessary config into your normal `.emacs.d`. – phils Sep 01 '14 at 21:17
  • If you genuinely need to run multiple configurations, you may find http://stackoverflow.com/questions/21568042/how-to-start-up-emacs-with-different-configurations useful. – phils Sep 01 '14 at 21:26
  • You can also add a `site-start.el` file to the `site-lisp` directory on your system (see http://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Search.html), and Emacs will evaluate it by default. So you could potentially have all of the Evil files loaded from site-lisp, regardless of which `.emacs.d` you were using. – phils Sep 01 '14 at 21:34
  • @user3139545 I never heard of this EmacsLive mode before, but now had a brief look at it. I don't like this approach of recommending to move an existing .emacs.d aside at all. You could just as well clone the repository somewhere without following the recommended process and take a look at the configuration in detail and copy over what you need. This way you obviously don't get the direct benefit of just using what they provide, but you don't have to throw your existing other configuration out of the window. – schaueho Sep 02 '14 at 07:18