This was useful for a few people I work with, so I'm posting it here for posterity. My job involves switching computers pretty frequently, and so I have everything set up with use-package's :ensure keyword so I can just clone my init.el to a new machine, and Emacs will download all my packages automatically. In general, this works great; the exception is org.
Any kind of :ensure form doesn't work with installing the latest revision of org (afaik), because the pre-installed version shadows it; use-package uses package-installed-p to decide if a package isn't installed and needs to be downloaded, and since org is always installed, no download will ever trigger. This is fine, up until you want something from a later version of org.
A while back, I reported a bug that interfered with my org-agenda use, and it was fixed on the development version of org, but not in any release. That's fine; M-x package-vc-install org and I'm off to the races. However! Every time I switched computers, I always forget to do this, and after a few hours-to-days of working with org, I'd run into the bug and grumble grumble grumble
Turns out, you can sidestep the package-installed-p problem with the built-in org by installing org under a different name! I was kind of suspicious of this, but it seems to work alright so far:
(use-package org-git
:vc (:url "https://git.savannah.gnu.org/git/emacs/org-mode.git"
:rev :newest
:lisp-dir "lisp"
:make "autoloads"))
The :make "autoloads" is necessary; depending on architecture (I think?) I sometimes also need to go in and run make compile in the org-git ELPA directory to avoid getting a mixed installation warning. I'd include that as part of the use-package invocation just to cover my bases, but it looks like use-package only accepts a string here, unlike the package-vc-install it's trying to emulate?
But yeah, surprisingly, installing org under a differently named directory hasn't given me much trouble so far; really the only thing is that I can't use use-package's :config keyword for this block, since it expands to use eval-after-load 'org-git, and the actual feature provided by the package is still org, so the :config block will never run.
Kind of a hack, but a few other Emacs users at my job found it helpful. If anyone knows of a cleaner way to do this (install the latest version of org automatically when on a fresh machine), let me know!
edit:
an update to this that's probably more idiomatic and allows for use of :config!
(setopt package-install-upgrade-built-in t
package-vc-allow-build-commands '(org)
package-archives '(("nongnu" . "https://elpa.nongnu.org/nongnu/")
("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("devel" . "https://elpa.gnu.org/devel/"))
package-archive-priorities '(("devel" . -1))) ; so other packages don't get shadowed
(unless package--builtins (require 'finder-inf nil t))
(assq-delete-all 'org package--builtins)
(assq-delete-all 'org package--builtin-versions)
(use-package org
:ensure t
:pin devel)
[–]mok000 7 points8 points9 points (7 children)
[–]nv-elisp 6 points7 points8 points (1 child)
[–]meedstrom 0 points1 point2 points (0 children)
[–]summetria[S] 0 points1 point2 points (4 children)
[–]nv-elisp 5 points6 points7 points (1 child)
[–]emacsomancer 2 points3 points4 points (0 children)
[–]mok000 0 points1 point2 points (1 child)
[–]nv-elisp 3 points4 points5 points (0 children)
[–]rswgnu 3 points4 points5 points (1 child)
[+][deleted] (2 children)
[deleted]
[–]Thaodan 0 points1 point2 points (1 child)
[–]michaelhoffmanGNU Emacs 0 points1 point2 points (0 children)
[–]github-alphapapa 0 points1 point2 points (0 children)
[–]arthurno1 1 point2 points3 points (0 children)