I'm testing out emacs today and I'm trying to sync config and packages to my dropbox.

The solution I used with vim is what I'm planning for emacs

  1. Create a .emacs.d directory on dropbox
  2. Put an init.el file within that directory
  3. Create a link from C:\Users\Simon\.emacs.d to the dropbox location
  4. Possibly push that entire thing up to github for version control

My questions

  1. Are there any problems with pushing the entire .emacs.d directory to github/dropbox?
  2. Does any personal information get stored in that directory?
  3. Where are packages typically stored for emacs? If its within the .emacs.d dir then that'd be ideal as I can ensure my entire config is in the cloud and available on all my machines
  4. On a new machine, after I create a symlink to the dropbox location, is there anything else I need to do within emacs to get the entire config back?
  • Here is a related thread regarding synchronizing packages, configurations, and entire Emacs installations to multiple machines -- Synchronize packages between different machines: emacs.stackexchange.com/questions/408/… – lawlist Dec 19 '15 at 16:53

Here is my short answer (there is a longer answer below, and since the answer as a whole is kind of long, if I forgot to address something or you have further questions let me know, and I will try to include them):

  1. I can't see any major problems with pushing your entire .emacs.d to dropbox or github, but I think there is a better solution which I will explain below.
  2. AFAIK there is no sensitive personal information that is stored in that directory by default, but it would depend on what you personally put in there. If you want to e.g., store password and other sensitive information that you need emacs to have access to, you can put it in a separate file which emacs loads explicitly from your init file, but which you do not track in github (here is an example of that).
  3. Packages are usually stored in a sub-directory within your .emacs.d, so you should be able to sync everything together, but again, see solution below for details.
  4. I will defer answering this question until below.

Here is my more involved answer:

From you questions, I assume that you are interested in 1. syncing your setup, and 2. tracking changes in your setup with version control. I had these same requirements for my setup, and my final solution (though I have used a combination over the last few months) is to use github alone, which will allow you to sync (albeit not necessarily automatically) and track changes.

My initial setup was to sync only my init.el file through dropbox and symlink it to my .emacs.d. Since I use use-package it was not necessary to sync anything else, because almost all my packages are installed from MELPA, and use-package will automatically download any missing packages automatically on any machine I sync the config to. This approach worked fine, but with dropbox there is always the risk of sync conflicts, and if your files are not under source control, it can be a pain to resolve the conflicts.

This problem is solved by simply pushing my entire .emacs.d to github. Then all I have to do is clone the repository on a new machine, push if I make changes, and pull if I made changes elsewhere. I do most of this through magit. This way, if there are any conflicts, I can easily solve them through git-related tools.

I still don't sync my packages; again, because of use-package it is not necessary. I do however sync a sub-directory ~/.emacs.d/elisp where I put any elisp code that I got from somewhere other than MELPA. If you would like to see how my setup works, you can take a look on github. Just keep in mind that I don't claim to know the best way, this is just the way that has worked best for me so far. Also, most of my actual configuration is in an org file to make it more manageable. I am currently syncing this emacs setup between two home computers and my work computer, and have never experienced any issues with it. Also, I see no problem using just dropbox, or a combination of dropbox and github similar to what you suggested, but I prefer my way for the reasons I explained above. You should experiment to find what is best for you, but I personally think it is import to have your emacs config under source control, so it is a good idea to have git as part of the equation, even if you don't push it to github. Dropbox and git together without github would also mean that you don't have to worry so much about personal information in your .emacs, but I don't think this is a major issue in general anyway.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.