Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use bleeding edge org-mode in spacemacs? #7071

Closed
fintelkai opened this issue Sep 9, 2016 · 21 comments
Closed

How can I use bleeding edge org-mode in spacemacs? #7071

fintelkai opened this issue Sep 9, 2016 · 21 comments

Comments

@fintelkai
Copy link
Contributor

Spacemacs (I'm on develop) installs the latest stable version of org-plus-contrib (currently version 8.3.5). There are substantial new features in the current development version of org-mode 9.0 (available through git), see http://orgmode.org/cgit.cgi/org-mode.git/tree/etc/ORG-NEWS for a summary. Is there an easy way to get Spacemacs to install and work with the latest development version of org-mode?

@TheBB
Copy link
Contributor

TheBB commented Sep 12, 2016

Add the package to your list of additional packages with a :location parameter pointing to wherever you want to get it from. See layers doc for details.

@fintelkai
Copy link
Contributor Author

How would that interact with spacemacs getting org-plus-contrib? spacemacs/layers/+spacemacs/spacemacs-org/packages.el loads (org-plus-contrib :step pre). Would spacemacs figure out that the org-mode from git is newer and load that?

@TheBB
Copy link
Contributor

TheBB commented Sep 12, 2016

It won't figure out what is newer, it'll just get it from where you tell it to get it from.

@fintelkai
Copy link
Contributor Author

It's clear that I'm not getting my point across. I will experiment but I'm pretty sure that the fact that org-mode is required so early by spacemacs means that loading a newer version via "additional packages" will be futile.

@fintelkai
Copy link
Contributor Author

I suppose it would help me figure out how org-mode is loaded if I understood the division of labor between spacemacs/layers/+spacemacs/spacemacs-org and spacemacs/layers/+emacs/org. Is that explained anywhere?

@TheBB
Copy link
Contributor

TheBB commented Sep 12, 2016

I'm pretty sure that the fact that org-mode is required so early by spacemacs means that loading a newer version via "additional packages" will be futile.

No, org-mode isn't required at any point during the loading process. What would that be for?

The spacemacs-org layer is a layer installed by default that includes the absolute minimum needed to provide a nice experience reading org files. This is necessary because Spacemacs' documentation is itself written in org, and it's critical that Spacemacs ships with a good way to read its own docs. All the config we felt was non-essential (for people who actually use org-mode as a tool rather than a glorified markdown file) is in the org layer, which is optional.

The org-plus-contrib package is owned by the spacemacs-org layer. Some packages in the org layer are actually part of org-plus-contrib (org itself, org-agenda, ob, etc.) but they are marked as :location built-in to make them work seamlessly (Spacemacs will not try to download them.)

Packages you declare in the list of additional packages in your dotfile are installed alongside all the other packages in Spacemacs as first class citizens. If it works as part of a layer then it will work in the additional packages. You have the power to override attributes as you wish in this way, including the :location parameter, which is precisely the answer to your question.

@syl20bnr
Copy link
Owner

not sure if it can work but there is a :min-version keyword available in develop branch: 2152f66
Now it would certainly require an ELPA repository with the bleeding edge org packages.

Another solution is to find a working Quelpa recipe to either point to the git repo or to a clone of the git repo locally.

@agzam
Copy link
Contributor

agzam commented Oct 20, 2016

@fintelkai skimming through the news file, I didn't see anything extremely important. I'm curious - is there something in org-mode 9 that you really need? To be honest I loooove org, I'm thinking - maybe I should try out the bleeding edge?

@fintelkai
Copy link
Contributor Author

@agzam What I was looking for is proper fontification of embedded LaTeX blocks (http://lists.gnu.org/archive/html/emacs-orgmode/2016-09/msg00124.html). This is apparently improved in v.9. Luckily, it appears that v.9 is imminent: http://lists.gnu.org/archive/html/emacs-orgmode/2016-10/msg00249.html.

@toupeira
Copy link
Contributor

toupeira commented Nov 5, 2016

I'd like to know the opposite: how can I stick to org-mode 8.x until the issues with 9 have been worked out? I just updated packages from the Spacemacs home screen and ended up with org-mode 9.

@TheBB
Copy link
Contributor

TheBB commented Nov 5, 2016

There's a rollback feature on the same home buffer.

@toupeira
Copy link
Contributor

toupeira commented Nov 5, 2016

@TheBB right, forgot to mention I know about the rollback feature ;-) But is there a way to pin the org-mode packages to a specific version, so I can still update other packages? And I assume new Spacemacs users will run into the same problem?

@TheBB
Copy link
Contributor

TheBB commented Nov 5, 2016

Not at the moment, although you can roll back only org-mode with the good ol' copy-the-folder trick (it's in ~/.emacs.d/.cache/.rollback somewhere, and should go in ~/.emacs.d/elpa somewhere—remember to remove the newer one).

There is #6575 but it won't work unless there's a package archive that provides only the older org version, which there may or may not be, I don't know.

@d12frosted
Copy link
Contributor

Indeed it's possible with #6575 and spacemacs-elpa-mirror. Since I update it without removing old commits - we have a good history of packages there. So what you need to do, @toupeira, is to find the latest commit containing desired version of org-mode under org archive and then add it to configuration-layer--elpa-archives with some fancy name like org-8 or whatever. For example, use following snipped to add archive at commit 5a956158a28b0655c5ab5b1195a0b3c51977d589. Note t at the end.

(add-to-list 'configuration-layer--elpa-archives ("org-8"   . "https://raw.githubusercontent.com/syl20bnr/spacemacs-elpa-mirror/5a956158a28b0655c5ab5b1195a0b3c51977d589/org/") t)

Then pin org using #6575 to org-8.

P. S. I haven't tested this myself, but should work 😸

P. P. S. But actually you can achieve it without #6575. Just add that org-8 archive to the beginning of that list of elpa archives and org will be downloaded from that instead of org. Don't forget to remove org from elpa directory in .emacs.d before restarting Emacs.

@diadochos
Copy link

@d12frosted Would you kindly take the trouble to explain how that snippet works? Because I couldn't make it work.

I added that snippet to dotspacemacs/user-init in my .spacemacs, but it installed the latest org as well as org-plus-contrib. Of course I've deleted the files in the elpa directory beforehand.

(What I may be missing is something like a cached file of the package? Or should the configuration be placed in a different place?)

Here's my system info if this helps.

Best regards

System Info 💻

  • OS: darwin
  • Emacs: 25.1.1
  • Spacemacs: 0.200.7
  • Spacemacs branch: master (rev. c2774bc)
  • Graphic display: nil
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(nginx csv bibtex pdf-tools
       (auto-completion :variables auto-completion-enable-sort-by-usage t auto-completion-enable-snippets-in-popup t auto-completion-enable-help-tooltip t auto-completion-private-snippets-directory "~/.emacs.d.bak/snippets/")
       better-defaults ipython-notebook emacs-lisp markdown
       (org :variables org-enable-github-support t)
       osx spell-checking syntax-checking
       (ruby :variables ruby-enable-enh-ruby-mode t)
       python javascript latex yaml php gtags ess version-control git html clojure extra-langs dash docker my-keybindings my-config-from-spacemacs-base realgud)
  • System configuration features: NOTIFY ACL LIBXML2 ZLIB

@d12frosted
Copy link
Contributor

@diadochos

That commit was just an example.

So what you need to do, ..., is to find the latest commit containing desired version of org-mode under org archive ... For example, use following snipped to add archive at commit 5a956158a28b0655c5ab5b1195a0b3c51977d589.

So I just wanted to show how to add that commit once you find it 😸

@diadochos
Copy link

diadochos commented Jan 6, 2017

@d12frosted Thanks for the reply :)
Sorry I wasn't clear.
The question is, if I want to use the commit 5a956158a28b0655c5ab5b1195a0b3c51977d589 from the mirror,
where should I write

(add-to-list 'configuration-layer--elpa-archives ("org-8"   . "https://raw.githubusercontent.com/syl20bnr/spacemacs-elpa-mirror/5a956158a28b0655c5ab5b1195a0b3c51977d589/org/") t)

this ?

Will dotspacemacs/user-init in my .spacemacs do?

@mjkramer
Copy link
Contributor

I was able to override org-plus-contrib with a Quelpa recipe. The following went into my dotspacemacs-additional-packages (credit to lurdan on SE for the recipe):

(org-plus-contrib
  :location
  (recipe :fetcher git
          :upgrade t
          :url "https://code.orgmode.org/bzg/org-mode.git"
          :files ("lisp/*.el" "contrib/lisp/*.el" "doc/dir" "doc/*.texi"))

The only inconvenience was that the :upgrade t option didn't seem to have the expected effect. I had to manually delete the "stock" org-plus-contrib from my elpa folder. On the next Spacemacs restart, Quelpa did its thing.

@duianto duianto added the Org label Mar 12, 2020
@jia-j-chen
Copy link

@diadochos Have you fiound the answer to your question above "Will dotspacemacs/user-init in my .spacemacs do?"

@diadochos
Copy link

@jia-j-chen It's 2 years ago and it seems I'm not using the trick any longer, so I can't be sure. Sorry.

But in case you are curious, the following is an excerpt from a comment-out region in my .spacemacs, and I think I used this one for a while:

(defun dotspacemacs/user-init ()
  (remove '("org" . "orgmode.org/elpa/") configuration-layer--elpa-archives)
  (add-to-list 'configuration-layer--elpa-archives '("org-8" . "https://raw.githubusercontent.com/syl20bnr/spacemacs-elpa-mirror/5a956158a28b0655c5ab5b1195a0b3c51977d589/org/") t)
)

@jia-j-chen
Copy link

jia-j-chen commented Sep 1, 2020

@diadochos , Thanks! I appreciate it.

I actually find that the solution provided by @mjkramer above works for me. It is easy to set up in .spacemacs. I try to pin the ESS package to a previous version. In the end, I add the following into the dotspacemacs-additional-packages of .spacemacs.
(ess :location (recipe :fetcher git :url "https://github.com/emacs-ess/ESS.git" :commit "14b9a3091916a1cb74dec7336e8461590dfc6a7d" :files ("lisp/*.el" "contrib/lisp/*.el" "doc/dir" "doc/*.texi" "etc")))

It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests