3

I'm trying to use spacemacs (basically a thin layer with nice defaults around emacs) at work, but it wants to connect to elpa and melpa to download stuff - and is basically unusable without getting those packages.

If I set up spacemacs the way I like it on my linux laptop at home, and it's all in elisp and self-contained, would the directory work at work on my Windows desktop?

It should, shouldn't it?

Follow-on question: If I use version control, is there anything I should avoid tracking that's dynamically created?

Is .emacs.d portable across platforms?

  • 2
    The question is unclear - far too broad. It all depends what you put in that directory and what is in your init file. "...anything I should avoid..." If you want to know whether particular code is probably portable then show that code, and preferably cite the platforms you care about. – Drew May 27 '16 at 23:40
  • I would say "Yes!" Having personally used the same init file across multiple platforms concurrently probably the only problems you will run into will be related to the filesystem (mainly differences in paths). It is easily managed if you write your initfile to check your system type and set those sensitive config values accordingly. You can litter your init with forms like these: (setq home-dir (cond ((eq system-type 'cygwin) "/cygdrive/c/Users/John/") ((eq system-type 'gnu/linux) "/home/john/"))) – ebpa May 27 '16 at 23:46
  • Why do you not allow it to connect to elpa and melpa? – systemovich May 28 '16 at 11:57
  • Not my decision, proxy stuff and firewalls that I'm not entirely an expert in, and while I can modify some config stuff, trying to tunnel or VPN or something to work around it is likely to get me trouble. – Aaron Hall May 28 '16 at 12:14
4

Yes, if they're running the same version of Emacs.

The byte compilation format is portable across platforms (it depends neither on the processor architecture nor on the operating system). It's also mostly portable across minor versions of Emacs; see Portability of bytecode between Emacs versions for more details.

If you start mixing Emacs versions, or versions of third-party packages, then you may run into incompatibilities with bytecode not due to the bytecode format, but due to changes in macros. For example, suppose package A defines a macro m and function f, and package B uses both m and f, and version 1 and version 2 of package A have changed the way m and f work; if you compile package B against bytecode from version 1 of package A and then run it with version 2 of package A, then package B will be using m version 1 and f version A, which can break things. This is only an issue if you mix different versions of Lisp code (either with Emacs itself or from third-party packages). If you install the same version of Emacs everywhere and copy your whole .emacs.d including all the third-party packages, you'll be fine on this count.

There is occasionally Lisp code that depends on the system, but this should be determined at runtime. It's technically possible that the installation of a package does something system-dependent, or that a macro is compiled into something that is system-dependent, but for the most part that would be a sign of a badly-written package.

There are a few packages that deliberately analyze your system when you install them, but this is should be rare and should be obvious from the description of the package. For example, AUCTeX can parse locally-installed TeX files to provide package-specific assistance; but given that TeX itself should remain compatible, the files generated on one machine should work anywhere else.

As I don't know anything about Spacemacs, I can't vouch for it.

4

Is .emacs.d portable across platforms?

Yes it is, semantically speaking, assuming the same emacs version.

Is everything in it cross-platform?

Not necessarily. If any of it uses system calls that are system specific or hard-codes the location of files with absolute paths, it is likely to not work on a Windows system.

I have a very large .emacs.d (thanks to spacemacs).

Here's the directory structure of my .emacs.d:

~/.emacs.d$ tree -d
.
├── assets
├── auto-save-list
├── core
│   ├── aprilfool
│   ├── banners
│   │   └── img
│   ├── info
│   │   └── release-notes
│   ├── libs
│   └── templates
├── doc
│   └── img
├── elpa
│   ├── ace-jump-helm-line-20160329.1218
│   ├── ace-link-20160326.620
│   ├── ace-window-20160225.819
│   ├── ac-ispell-20151031.1926
│   ├── adaptive-wrap-0.5
│   ├── aggressive-indent-20160404.1021
│   ├── alert-20151123.759
│   ├── anaconda-mode-20160221.1123
│   ├── anzu-20160130.1855
│   ├── archives
│   │   ├── gnu
│   │   ├── marmalade
│   │   ├── melpa
│   │   └── org
│   ├── async-20160223.146
│   ├── auto-compile-20160321.932
│   ├── auto-complete-20160329.2321
│   │   └── dict
│   ├── auto-highlight-symbol-20130313.243
│   ├── auto-yasnippet-20160223.308
│   ├── avy-20160402.1049
│   ├── bind-key-20160227.48
│   ├── bind-map-20160309.525
│   ├── bracketed-paste-20140222.1801
│   ├── buffer-move-20160108.708
│   ├── clean-aindent-mode-20150816.2029
│   ├── cmm-mode-20150224.2346
│   ├── company-20160325.1650
│   ├── company-anaconda-20160222.837
│   ├── company-cabal-20151216.720
│   ├── company-ghc-20160315.710
│   ├── company-quickhelp-20160211.718
│   ├── company-statistics-0.2.2
│   ├── ctable-20140304.1659
│   ├── cython-mode-20140705.1229
│   ├── dash-20160306.1222
│   ├── define-word-20150709.1223
│   ├── diminish-20151215.915
│   ├── elisp-slime-nav-20160128.1109
│   ├── epl-20150517.433
│   ├── ess-20160404.1414
│   │   ├── etc
│   │   │   ├── ESSR
│   │   │   │   └── R
│   │   │   ├── icons
│   │   │   ├── other
│   │   │   │   └── S-spread
│   │   │   └── pkg1
│   │   │       ├── man
│   │   │       └── R
│   │   └── lisp
│   ├── ess-R-data-view-20130509.458
│   ├── ess-R-object-popup-20130302.336
│   ├── ess-smart-equals-20150201.2201
│   ├── eval-sexp-fu-20131230.1351
│   ├── evil-20160403.2352
│   ├── evil-anzu-20150124.1609
│   ├── evil-args-20140329.1429
│   ├── evil-escape-20160313.1205
│   ├── evil-exchange-20160117.2002
│   ├── evil-iedit-state-20160313.1156
│   ├── evil-indent-plus-20151109.1106
│   ├── evil-lisp-state-20160403.1948
│   ├── evil-magit-20160324.1838
│   ├── evil-matchit-20151120.335
│   ├── evil-mc-20160331.844
│   ├── evil-nerd-commenter-20160209.49
│   ├── evil-numbers-20140606.551
│   ├── evil-search-highlight-persist-20151215.238
│   ├── evil-surround-20160331.821
│   ├── evil-tutor-20150102.2250
│   ├── evil-visualstar-20160222.1648
│   ├── exec-path-from-shell-20160112.2246
│   ├── expand-region-20150902.558
│   ├── f-20160306.447
│   ├── fancy-battery-20150101.404
│   ├── fill-column-indicator-20151030.1233
│   ├── flx-20151030.1112
│   ├── flx-ido-20151030.1112
│   ├── flycheck-20160403.803
│   ├── flycheck-haskell-20160413.131
│   ├── flycheck-pos-tip-20160323.129
│   ├── ghc-20160108.701
│   ├── gh-md-20151207.940
│   ├── gitattributes-mode-20160319.302
│   ├── git-commit-20160329.858
│   ├── gitconfig-mode-20160319.302
│   ├── gitignore-mode-20160319.302
│   ├── git-messenger-20160121.1842
│   ├── git-timemachine-20160323.1240
│   ├── gntp-20141024.1950
│   ├── gnupg
│   ├── gnuplot-20141231.1337
│   ├── golden-ratio-20150819.420
│   ├── google-translate-20160111.654
│   ├── goto-chg-20131228.659
│   ├── haskell-mode-20160419.752
│   ├── haskell-snippets-20160121.1458
│   │   └── snippets
│   │       └── haskell-mode
│   ├── helm-20160404.840
│   ├── helm-ag-20160330.0
│   ├── helm-company-20151216.9
│   ├── helm-core-20160403.2307
│   ├── helm-c-yasnippet-20151231.10
│   ├── helm-descbinds-20160108.1947
│   ├── helm-flx-20160227.1652
│   ├── helm-gitignore-20150517.2056
│   ├── helm-make-20160331.754
│   ├── helm-mode-manager-20151124.138
│   ├── helm-projectile-20160330.131
│   ├── helm-pydoc-20151008.724
│   ├── helm-swoop-20160131.533
│   ├── helm-themes-20151008.2321
│   ├── help-fns+-20151215.637
│   ├── highlight-20151231.1337
│   ├── highlight-indentation-20150307.208
│   ├── highlight-numbers-20150531.607
│   ├── highlight-parentheses-20151107.2316
│   ├── hindent-20151113.24
│   ├── hl-todo-20151025.1220
│   ├── htmlize-20130207.1202
│   ├── hungry-delete-20151203.1314
│   ├── hydra-20160415.423
│   ├── hy-mode-20151025.543
│   ├── ido-vertical-mode-20151003.1833
│   ├── iedit-20150915.2022
│   ├── indent-guide-20151119.717
│   ├── info+-20151231.1403
│   ├── julia-mode-20160327.225
│   ├── let-alist-1.0.4
│   ├── leuven-theme-20160319.819
│   ├── linum-relative-20160117.2200
│   ├── log4e-20150105.505
│   ├── lorem-ipsum-20140911.1408
│   ├── macrostep-20151213.145
│   ├── magit-20160402.2219
│   ├── magit-gitflow-20160318.700
│   ├── magit-popup-20160329.858
│   ├── markdown-mode-20160404.923
│   ├── markdown-toc-20160227.308
│   ├── mmm-mode-20150828.1716
│   ├── move-text-20160211.1847
│   ├── neotree-20160306.730
│   │   └── icons
│   ├── open-junk-file-20130130.2320
│   ├── org-20160404
│   │   └── etc
│   │       └── styles
│   ├── org-bullets-20140918.1137
│   ├── orgit-20160119.1424
│   ├── org-plus-contrib-20160404
│   │   └── etc
│   │       └── styles
│   ├── org-pomodoro-20151217.553
│   │   └── resources
│   ├── org-present-20141109.1756
│   ├── org-repo-todo-20160307.1029
│   ├── package-build-20160326.1852
│   ├── packed-20160321.36
│   ├── page-break-lines-20160109.1813
│   ├── paradox-20160323.1210
│   ├── parent-mode-20150824.1600
│   ├── pcre2el-20151213.234
│   ├── persp-mode-20151209.1949
│   ├── pip-requirements-20160131.926
│   ├── pkg-info-20150517.443
│   ├── popup-20151222.1339
│   ├── popwin-20150315.600
│   ├── pos-tip-20150318.813
│   ├── powerline-20160224.2052
│   ├── projectile-20160331.2219
│   ├── pyenv-mode-20160221.1123
│   ├── pytest-20160330.647
│   ├── python-20120402
│   ├── pythonic-20160221.1123
│   ├── pyvenv-20160108.28
│   ├── quelpa-20160325.629
│   ├── rainbow-delimiters-20150320.17
│   ├── request-20160108.33
│   ├── restart-emacs-20151203.835
│   ├── s-20160313.2240
│   ├── seq-2.15
│   │   └── tests
│   ├── shm-20160211.1154
│   ├── smartparens-20160324.1541
│   ├── smeargle-20151013.2242
│   ├── smooth-scrolling-20160227.1715
│   ├── solarized-theme-20160505.133
│   ├── spaceline-20160229.1115
│   ├── spacemacs-theme-20160310.1337
│   ├── spinner-1.7.1
│   ├── toc-org-20160308.2340
│   ├── undo-tree-20140509.522
│   ├── use-package-20160403.1129
│   ├── vi-tilde-fringe-20141027.1942
│   ├── volatile-highlights-20160221.212
│   ├── which-key-20160331.1313
│   ├── window-numbering-20150228.1247
│   ├── with-editor-20160223.1155
│   ├── ws-butler-20150126.759
│   └── yasnippet-20160403.830
│       └── snippets
│           ├── antlr-mode
│           ├── applescript-mode
│           ├── cc-mode
│           ├── chef-mode
│           ├── clojure-mode
│           ├── cmake-mode
│           ├── c-mode
│           ├── c++-mode
│           ├── conf-unix-mode
│           ├── cperl-mode
│           ├── cpp-omnet-mode
│           ├── csharp-mode
│           ├── css-mode
│           ├── dix-mode
│           ├── elixir-mode
│           ├── emacs-lisp-mode
│           ├── erc-mode
│           ├── erlang-mode
│           ├── f90-mode
│           ├── faust-mode
│           ├── fundamental-mode
│           ├── git-commit-mode
│           ├── go-mode
│           ├── groovy-mode
│           ├── haskell-mode
│           ├── html-mode
│           ├── java-mode
│           ├── js-mode
│           ├── latex-mode
│           ├── lisp-interaction-mode
│           ├── lisp-mode
│           ├── lua-mode
│           ├── m4-mode
│           ├── makefile-automake-mode
│           ├── makefile-bsdmake-mode
│           ├── makefile-gmake-mode
│           ├── makefile-mode
│           ├── malabar-mode
│           ├── markdown-mode
│           ├── ned-mode
│           ├── nesc-mode
│           ├── nix-mode
│           ├── nsis-mode
│           ├── nxml-mode
│           ├── octave-mode
│           ├── org-mode
│           ├── perl-mode
│           ├── prog-mode
│           ├── python-mode
│           ├── rst-mode
│           ├── ruby-mode
│           ├── scala-mode
│           ├── sh-mode
│           ├── snippet-mode
│           ├── sql-mode
│           ├── text-mode
│           ├── tuareg-mode
│           ├── udev-mode
│           └── yaml-mode
├── layers
│   ├── auto-completion
│   │   └── snippets
│   │       └── emacs-lisp-mode
│   ├── better-defaults
│   │   └── img
│   ├── chinese
│   │   └── img
│   ├── chrome
│   │   └── img
│   ├── colors
│   │   ├── extensions
│   │   │   └── nyan-mode
│   │   │       ├── img
│   │   │       └── mus
│   │   └── img
│   ├── +config-files
│   │   ├── ansible
│   │   │   └── img
│   │   ├── dockerfile
│   │   │   └── img
│   │   ├── puppet
│   │   │   └── img
│   │   ├── salt
│   │   │   └── img
│   │   └── terraform
│   │       └── img
│   ├── cscope
│   │   └── img
│   ├── deft
│   ├── +distribution
│   │   ├── spacemacs
│   │   │   └── local
│   │   │       ├── centered-cursor
│   │   │       ├── paradox
│   │   │       └── zoom-frm
│   │   └── spacemacs-base
│   │       └── local
│   │           ├── evil-evilified-state
│   │           ├── helm-spacemacs
│   │           ├── holy-mode
│   │           └── hybrid-mode
│   ├── +email
│   │   ├── gnus
│   │   │   └── img
│   │   └── mu4e
│   ├── finance
│   │   └── img
│   ├── floobits
│   │   └── img
│   ├── +frameworks
│   │   ├── django
│   │   │   └── img
│   │   ├── react
│   │   │   └── img
│   │   └── ruby-on-rails
│   │       └── img
│   ├── +fun
│   │   ├── emoji
│   │   │   └── img
│   │   ├── games
│   │   │   ├── extensions
│   │   │   │   └── helm-games
│   │   │   └── img
│   │   ├── selectric
│   │   │   └── img
│   │   └── xkcd
│   │       └── img
│   ├── geolocation
│   │   └── img
│   ├── gtags
│   ├── ibuffer
│   ├── +irc
│   │   ├── erc
│   │   │   └── extensions
│   │   │       ├── erc-sasl
│   │   │       ├── erc-tex
│   │   │       └── erc-yank
│   │   └── rcirc
│   │       ├── img
│   │       └── local
│   │           ├── helm-rcirc
│   │           ├── rcirc-late-fix
│   │           └── rcirc-reconnect
│   ├── jabber
│   │   └── img
│   ├── +keyboard-layouts
│   │   └── bepo
│   │       └── img
│   ├── +lang
│   │   ├── agda
│   │   ├── asciidoc
│   │   ├── autohotkey
│   │   │   └── img
│   │   ├── c-c++
│   │   │   └── img
│   │   ├── clojure
│   │   │   └── img
│   │   ├── common-lisp
│   │   │   └── img
│   │   ├── csharp
│   │   │   └── img
│   │   ├── d
│   │   │   └── img
│   │   ├── elixir
│   │   │   └── img
│   │   ├── elm
│   │   │   └── img
│   │   ├── emacs-lisp
│   │   │   └── img
│   │   ├── erlang
│   │   │   └── img
│   │   ├── ess
│   │   │   └── img
│   │   ├── extra-langs
│   │   ├── fsharp
│   │   │   └── img
│   │   ├── go
│   │   │   ├── extensions
│   │   │   │   └── go-rename
│   │   │   └── img
│   │   ├── haskell
│   │   │   └── img
│   │   ├── html
│   │   │   └── img
│   │   ├── idris
│   │   │   └── img
│   │   ├── ipython-notebook
│   │   │   └── img
│   │   ├── java
│   │   │   └── img
│   │   ├── javascript
│   │   │   └── img
│   │   ├── latex
│   │   │   └── img
│   │   ├── lua
│   │   │   └── img
│   │   ├── markdown
│   │   │   └── img
│   │   ├── nim
│   │   │   └── img
│   │   ├── ocaml
│   │   │   └── img
│   │   ├── octave
│   │   │   └── img
│   │   ├── php
│   │   │   └── img
│   │   ├── purescript
│   │   │   └── img
│   │   ├── python
│   │   │   ├── img
│   │   │   └── local
│   │   │       ├── nose
│   │   │       └── pylookup
│   │   ├── racket
│   │   │   └── img
│   │   ├── ruby
│   │   │   └── img
│   │   ├── rust
│   │   │   └── img
│   │   ├── scala
│   │   │   └── img
│   │   ├── scheme
│   │   ├── shell-scripts
│   │   │   └── img
│   │   ├── sml
│   │   │   └── img
│   │   ├── sql
│   │   │   └── img
│   │   ├── swift
│   │   │   └── img
│   │   ├── typescript
│   │   │   └── img
│   │   ├── vimscript
│   │   ├── windows-scripts
│   │   │   ├── extensions
│   │   │   │   └── dos
│   │   │   └── img
│   │   └── yaml
│   ├── nixos
│   │   └── img
│   ├── org
│   │   ├── extensions
│   │   │   ├── evil-org
│   │   │   └── ox-gfm
│   │   └── img
│   ├── osx
│   │   └── img
│   ├── prodigy
│   │   └── img
│   ├── restclient
│   ├── search-engine
│   │   └── img
│   ├── semantic
│   ├── shell
│   │   └── img
│   ├── smex
│   │   └── img
│   ├── +source-control
│   │   ├── git
│   │   │   └── img
│   │   ├── github
│   │   │   └── img
│   │   ├── perforce
│   │   │   └── img
│   │   └── version-control
│   ├── speed-reading
│   ├── spell-checking
│   ├── spotify
│   │   └── img
│   ├── syntax-checking
│   │   └── img
│   ├── themes-megapack
│   ├── theming
│   ├── +tools
│   │   ├── command-log
│   │   ├── dash
│   │   │   └── img
│   │   ├── elfeed
│   │   │   └── img
│   │   ├── evernote
│   │   │   └── img
│   │   ├── fasd
│   │   ├── pandoc
│   │   ├── ranger
│   │   ├── tmux
│   │   │   └── extensions
│   │   │       └── tmux
│   │   ├── vagrant
│   │   │   └── img
│   │   ├── wakatime
│   │   │   └── img
│   │   └── ycmd
│   ├── typography
│   ├── +vim
│   │   ├── evil-cleverparens
│   │   ├── evil-commentary
│   │   ├── evil-snipe
│   │   │   └── img
│   │   ├── unimpaired
│   │   ├── vim-empty-lines
│   │   │   └── extensions
│   │   │       └── vim-empty-lines-mode
│   │   ├── vim-powerline
│   │   │   └── local
│   │   │       └── vim-powerline
│   │   └── vinegar
│   └── +window-management
│       ├── eyebrowse
│       │   └── img
│       └── spacemacs-layouts
├── private
│   ├── local
│   └── snippets
└── tests
    ├── core
    │   └── data
    └── layers
        └── +distribution
            ├── spacemacs
            └── spacemacs-base

536 directories

After looking through it, it looks like a lot of it is written in a flexible way, using relative directory structure, and I cannot find any system-specific system calls. I think there's a good chance it will work for me.

The only practical way to tell is to test it.

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.