I tried the solution in #371 and it worked, but my org version is still 9.1:
GNU Emacs 27.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-08-10 [2 times]
Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /home/nanounanue/.emacs.d/straight/build/org/)
If I execute straight-rebuild-package for org I get:
Org mode version 9.2.6 (release_9.2.6-521-gf2f646 @ /home/nanounanue/.emacs.d/straight/build/org/)
But if I restart emacs, I go back to the version 9.1.9
What if you exit Emacs, delete ~/.emacs.d/straight/build/org, and then restart? Maybe the bad .elc is getting loaded and affecting byte-compilation in the future.
~That worked! Thank you so much.~
It didn't work :( after following your suggestion and restarting emacs, everything was fine. But, after working a little I exited emacs. When I started emacs again, I got the same old version ...
Same issue here
I can try to reproduce this if you provide a sample init.el which reproduces the issue from an empty user-emacs-directory.
It's weird though. org-version says 9.1.9, but if I find-library RET org, I can see that the files actually say 9.3. It's not really affecting my workflow tbh, just an observation. Perhaps wait to see if more people report on this.
That's because the wrong version of Org is being loaded, but the correct version is still added to the load-path afterwards.
Same issue here. It looks like straight.el's hack is being broken?
You might be able to reproduce the issue with the next recipe:
;;; init.el -*- lexical-binding: t; -*-
(require 'cl-lib)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(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))
;; NOTE: Enabling/disabling this, before running Emacs or downloading
;; org-plus-contrib doesn't change anything (visibly).
(setq-default straight-fix-org t)
;; Removes in-build version from the `load-path'
(when-let (orglib (locate-library "org" nil load-path))
(setq-default load-path (delete (substring (file-name-directory orglib) 0 -1)
load-path)))
(cl-assert (memq 'org-elpa straight-recipe-repositories))
(straight-use-package 'org-plus-contrib)
;; NOTE:
;;
;; If you run `org-version' right after downloading (without restarting Emacs)
;; the latest version - it will message 9.2.6 org's version.
;;
;; If you restart Emacs with enabled `load-path' clean-up thingy (line
;; 23) you will get "File is missing: Cannot open load file, No such file or
;; directory, org-version.el", even though "..straight/build/org-plus-contrib"
;; being at the head of the `load-path' and no other org path exist here.
;;
;; If you comment out the `load-path' clean-up thingy it will load the in-build
;; org-mode version (`org-version' prints 9.1.9).
;; The load path will place "/usr/share/emacs/26.1/lisp/org" close to the tail
;; and "..straight/build/org-plus-contrib" close to head of `load-path'
(require 'org)
;;; init.el ends here
Thanks for the reports everyone. The issue should now be fixed :)
Hi @raxod502, I've just tried your new update with the previously published repro.
After downloading everything and executing org-version (without restarting Emacs) it prints:
Org mode version 9.2.6 (release_9.2.6-538-g23113f @ /home/.../.emacs.clear.build/straight/build/org-plus-contrib/)
After restart it prints:
Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /home/.../.emacs.clear.build/straight/build/org-plus-contrib/)
If you attempt to remove in-build org from load-path before loading straight's org it emits the next error:
File is missing: Cannot open load file, No such file or directory, org-version.el
Is org-version just prints bogus output and it still loads the newest version? Can I verify this somehow? I'm using Emacs 26.1 (linux build), but I don't think this should cause any issues?
_Update:_ Yeah, I just confirmed my hypothesis; it loads straight's (latest) version of org-mode with broken org-version. This is because I just hit a new bug in my org config that was recently introduced in one of the latest versions of org-mode. After fetching the newest update using straight.el from the upstream it fixed the recently introduced bug that was fixed with the latest commit.
_Update#2:_ Okay, I just missed this from the manual:
Running make generates a file org-version.el which provides the functions org-git-version and org-release. Thus the version of Org provided by straight.el does not include these functions, but the obsolete version of Org provided by Emacs (see the FAQ) does. This can result in the obsolete version getting partially loaded, which is confusing.
This is indeed confusing, but everything works as intended.
everything works as intended
Does it? I believe that if straight-fix-org is non-nil, then straight.el should define its own org-version that works correctly. That previously didn't happen unless Org was rebuilt, which is what I just fixed. It sounds like you're still seeing that behavior, though?
Well, the mentioned commit makes changes in org.el file and I successfully received these changes, so here goes that.
I have only limited time to dig deeper into the rabbit hole, but it looks like what happening is straight uses builtin org-version[1] instead of the version from straight--fix-org-function. This also explains why I am getting the error when I remove the builtin org (before loading straight's one) from the load-path. Additionally, if I try manually evaluate functions from straight--fix-org-function it prints the correct version too.
Other than that, straight actually loads the latest version of org-mode as intended. Maybe you should just write an :override advice for functions from org-release for time being?
[1] this where function definition of org-release points to; additionally find-library points to builtin org-version.
@Wetlize I tested again with the following init-file:
(setq straight-repository-branch "develop")
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(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))
(straight-use-package 'org-plus-contrib)
(require 'org)
Running M-x org-version returns the correct value (9.2.6) both initially and after a restart. I suspect that either you are not running the latest straight.el or there is something else in your configuration (such as code run before (straight-use-package 'org) that causes Org to be loaded) that is causing the problem.
@Wetlize Have you tried to make sure no version of org is installed by packages.el, then update the state of straight.el itself?
straight-pull-all
straight-rebuild-all
straight-freeze-versions
With my init.el containing exactly:
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(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))
(straight-use-package 'use-package)
(straight-use-package 'org-plus-contrib)
(use-package org)
After uninstalling custom org versions and updating straight.el I got the correct behaviour I want.
@Wetlize Have you tried to make sure no version of
orgis installed bypackages.el, then update the state of straight.el itself?straight-pull-all straight-rebuild-all straight-freeze-versionsWith my
init.elcontaining exactly:(defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (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)) (straight-use-package 'use-package) (straight-use-package 'org-plus-contrib) (use-package org)After uninstalling custom org versions and updating
straight.elI got the correct behaviour I want.
I'm doing exactly the same thing. After the inital start I get org-version: 9.3. After a restart however it's back to 9.1.9....
@minikN the problem is only fixed on develop
(setq straight-repository-branch "develop")
This thread is being closed automatically by Tidier because it is labeled with "waiting on response" and has not seen any activity for 90 days. But don't worry—if you have any information that might advance the discussion, leave a comment and the thread may be reopened :)
I've the same issue with org mode and org-plus-contrib. Installed straight.el for more than a month, but hesitate to open the issue cause still don't have time to reproduce with clean env.
I've read many issue about org-mode here, and mimicking other people org-mode config with straight.el, noting works. I need to restart my emacs for 3 times every time I boot my laptop. it's quit annoying for month, otherwise org-mode doesn't work and throws lot of errors such Error running timer ‘org-indent-initialize-agent’: (void-function org-time-add) or org-archive-subtree: Symbol’s function definition is void: org-show-all.
Fortunately I try to re-search any issue about org and found this one today.
solved by adding (setq straight-repository-branch "develop") and (straight-use-package 'org-plus-contrib) in the head of my init file.
Thanks for straight.el
Most helpful comment
@Wetlize I tested again with the following init-file:
Running
M-x org-versionreturns the correct value (9.2.6) both initially and after a restart. I suspect that either you are not running the lateststraight.elor there is something else in your configuration (such as code run before(straight-use-package 'org)that causes Org to be loaded) that is causing the problem.