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

org-mode installed via straight.el does not appear to be latest version #168

Closed
zzamboni opened this issue Oct 19, 2017 · 6 comments
Closed

Comments

@zzamboni
Copy link

(followup from thread started at jwiegley/use-package#319)

I am trying to use straight to install the latest version of org-mode. I am using Emacs 25.3.1 on macOS installed using Nix, which comes with org-mode 8.2.10 included:

ELISP> (org-version 't 't)
"Org-mode version 8.2.10 (release_8.2.10 @ /nix/store/v28q0m3danlz200vgn096yyh0x50an9v-emacs-25.3/share/emacs/25.3/lisp/org/)"

Here's what I have tried so far, followed by the resulting org-mode version (after each step, I have removed ~/.emacs.d/straight/[build,repo]/org* to ensure it gets reinstalled):

(straight-use-package 'org)
ELISP> (org-version 't 't)
"Org-mode version 8.2.10 (release_8.2.10 @ /Users/taazadi1/.emacs.d/straight/build/org/)"
(straight-use-package '(org :type git :repo "http://orgmode.org/org-mode.git"))

(this produces a warning: Warning (straight): Package "org" has two incompatible recipes (:local-repo cannot be both "org" and "org-mode"))

(org-version 't 't)
"Org-mode version 8.2.10 (release_8.2.10 @ /Users/taazadi1/.emacs.d/straight/build/org/)"

I just started using straight today, so I'm sure I'm missing something trivial. Thanks for any help!

@raxod502
Copy link
Member

Just M-x straight-use-package RET org RET should suffice to install it; all of the other options should work the same. Something is definitely wrong. Can you tell me what commit is checked out for the Git repository ~/.emacs.d/straight/repos/org? And also, before any Org-related functions are called, what does C-h f org-version show?

@raxod502
Copy link
Member

One thing that could cause this symptom is if you have some code in your init-file which triggers an autoload for Org, and this happens before straight.el makes Org available.

@zzamboni
Copy link
Author

zzamboni commented Oct 21, 2017

Here's the test I ran:

  1. Removed all of ~/.emacs.d/ to remove any previous caches or temporary files.
  2. Reduced ~/.emacs to the following, simply to bootstrap straight.el:
;; Bootstrap straight.el, the new functional Emacs package manager
(let ((bootstrap-file (concat user-emacs-directory "straight/bootstrap.el"))
      (bootstrap-version 2))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(provide '.emacs)

I started Emacs with this configuration. Right away, org-version reports: Org-mode version 8.2.10 (release_8.2.10 @ /nix/store/v28q0m3danlz200vgn096yyh0x50an9v-emacs-25.3/share/emacs/25.3/lisp/org/).

I then interactively ran M-x straight-use-package RET org RET. After the installation, org-version reports: Org-mode version 8.2.10 (release_8.2.10 @ /Users/taazadi1/.emacs.d/straight/build/org/)

So it is installing the package (the location changes), but it's still installing an old version.

Is there a way I can add the Org ELPA (http://orgmode.org/elpa.html) repository, to ensure that the latest version is installed?

Thanks!

@raxod502
Copy link
Member

There are three things here which are actively misleading, and conspire to confound your test.

The first is that when you do your test, the first time you run M-x org-version, it causes the version of Org that is bundled with Emacs to be loaded. Then when you load Org with straight.el and run M-x org-version again, it has no effect because Org is already loaded (i.e. (featurep 'org) is non-nil).

The second misleading thing is that the implementation of org-version tells you that the version of Org from straight.el was used when in fact the version bundled with Emacs was used. This is because the path to the Org directory is generated by org-version by inspecting the load-path (via locate-library), and not by checking which file the org feature was actually loaded from.

The third misleading thing is that, even if you do a proper isolated test and load Org using straight.el before invoking M-x org-version, it will still report as being version 8.2.10, even though the latest version of Org was actually loaded. This is because the org-version works by loading the org-version feature, which contains an org-release function to return the actual version. But this file is only generated when you make Org, which straight.el does not yet do. Thus calling the org-version function loads the org-version feature that is bundled with Emacs, even though the rest of Org is loaded from straight.el. I have some hacks in my init-file to patch this over for the moment.

In summary, there are two problems:

  1. Org is not built, so the version will not be reported correctly: Support arbitrary build commands #72.
  2. Emacs bundles a version of Org, so if you accidentally cause it to be loaded first then the up-to-date version from straight.el will not be loaded. This is why Emacs should not bundle Lisp packages in the first place, but there's nothing I can do about that.

So in other words, you actually do have the latest version of Org mode, despite M-x org-version's claims to the contrary. Please check if the features you were expecting are working. Or, if you want a more direct way of verifying the exact version, just M-x find-library RET org RET and inspect what revision is checked out.

Is there a way I can add the Org ELPA (http://orgmode.org/elpa.html) repository, to ensure that the latest version is installed?

This is unnecessary since EmacsMirror always carries the latest version anyway. And in fact, cloning from Org ELPA is a bad idea since it's over HTTP(?!?). See #36.

@raxod502 raxod502 changed the title How to install latest version of org-mode? org-mode installed via straight.el does not appear to be latest version Oct 22, 2017
@zzamboni
Copy link
Author

Hi @raxod502 - thanks for your feedback! Indeed it seems to be the case that the correct version of org-mode is installed. Still, this is very confusing behavior :(

@raxod502
Copy link
Member

raxod502 commented Dec 5, 2017

Closing since the problem is tracked already by #72 and #192.

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

No branches or pull requests

2 participants