by j7ake · 5y ago · 0 comments
One thing I found tricky was switching computers or getting a new computer can be very disruptive to the emacs/orgmode workflow because of the amount of customizations that build over years of using a specific orgmode workflow. Apps, on the other hand, are very portable between devices (phone, table, laptop).
Are there easy solutions to make emacs and orgmode set ups more portable between machines?
(Speaking of preserved customizations, by default those are written into ~/.emacs.d/init.el. As part of setting up for a version-controlled ~/.emacs.d/, I'd strongly recommend setting 'custom-file to e.g. ~/.emacs.d/custom.el, so that those are stored separately from your init logic proper - it's not a huge issue either way, but customizations are a fertile field for merge conflicts due to the way they're written and stored, and I find this makes those conflicts significantly more comfortable to resolve.)
You could in theory also add init logic to check for the presence of needed external binaries and, if necessary, install them via Homebrew, apt, or some Windows equivalent - I've thought about doing this since I already do have some platform-specific logic in my init, but it hasn't been enough overhead to bother since I rarely need to spin up a new workstation machine.
(Also, of course, ensure that you store any secrets like passwords or other credentials in a separate file, not checked into version control.)
To ensure you reliably have a specific version of Org, you can add the orgmode.org ELPA [1] to your 'package-archives and install a given version from there, rather than relying on whatever comes with a given Emacs build. I do this myself and recommend it to others; Org changes a good deal between versions in my experience, so version pinning helps avoid unexpected behavior that has otherwise been fairly common.
In the same spirit, it can be worth building Emacs from source on a new machine. I also do this, again in order to ensure the behaviors of a specific version to which I've become accustomed; I generally upgrade only when a major new feature or bug fix makes it strongly worthwhile, and then on all my machines at once. (It's a manual process, but not a difficult one. I guess I could automate it, but for something I do a few times a decade, that hasn't seemed worth it so far.)
(use-package wordnut
:ensure t ;; install package if it doesn't exist
:config
(global-set-key (kbd "C-c w") 'wordnut-search))
If I want a package to only load on Linux or windows, I can do it so: (use-package xclip
:if (eq system-type 'gnu/linux)
:ensure t
:config
(xclip-mode 1))
(use-package w32-browser
:if (eq system-type 'windows-nt)
:ensure t)It even has nice use-package integration, so if you're already using that you likely won't have to change all your config.
That's one solution.
I've got mine under Git. It's a bit more "work" in that when I upgrade packages (which I don't do all the time) I need to commit what's been deleted/added but I can at any time go back to any past working setup.
Then I just use Git across user accounts / machines to synch my Emacs setup.
Others are using Nix.
> Each time I update all packages something new breaks...
Don't know what's the "proper" way to do it but I upgrade packages manually and never all at once. That is: I never start from an empty Emacs. There are some tradeoffs I guess but I never have to track down which package is problematic and reverting is basically checking out the last commit.
I'm not saying it's the best way to do it but it just works.
I did this for a little while, but now I just use org notes on my work computer, and the ios notes app for personal things. Org need not consume everything.
But yeah, otherwise, it's a problem. I've grown very dependent on org and emacs, but access anywhere but my two laptops is kind of painful and kludgy.
I can use BeOrg, but BeOrg seems to have been built to support an orgmode use pattern that is very different from mine.
I can also ssh into my Ubuntu vm from my iPad, and obviously THAT experience is fine, but it's also more of a production than I'd really like if I just want to briefly interact with the org files.
I do keep my ~/org in Dropbox and have a phone app I can use to make quick edits, and which I have used for longer writing on trains and such. But it's definitely not a first-class UI, and I don't try to use it as such.
(On the other hand, I'm getting ready to redo my blog in Jekyll rather than Wordpress, not least to improve the authoring workflow by being able to bring it into Emacs...)
I use an Exchange calendar for work, and I don't have appointments as part of my agenda in Org. I carry a notebook with me when I'm out and about for jotting things down. Like you, I can get to my corpus of org files via Dropbox from my phone and whatever editor I want to use there, but that's more of an "in a pinch" kind of use case than anything I'd want to do on the regular.
If I need to write something real on the go, I just do it in Notes on the iPad, and then migrate it into org if that's where it needs to go when I'm back at my computer.
I still blog, too, but I use a dedicated tool called MarsEdit on my Mac to do it. I haven't seen a reason to move that into Emacs, though I'm sure it's technically possible.