radian-software / straight.el

🍀 Next-generation, purely functional package manager for the Emacs hacker.
MIT License
2.72k stars 150 forks source link

Install latest version of orgmode #882

Closed x61 closed 2 years ago

x61 commented 2 years ago

How do we install the latest version of org-mode? The current released version is 9.5 but straight is only pulling in 9.4.4. I initially thought it was my config settings so I stripped everything off my config and used the following right after setting up straight but it only installed version 9.4.4 as shown in the attached screenshort. Is there a way to ensure that the latest org-mode version is installed?

`#+begin_src emacs-lisp :results none (use-package org :straight t) (use-package org-contrib :straight t)

+end_src``

orgmode version
progfolio commented 2 years ago

Would you mind evaluating the following test case in your *scratch* buffer and sharing the results?:

Test Case ```emacs-lisp (straight-bug-report :post-bootstrap (straight-use-package 'org) (org-version 'nil 'full 'message)) ```
Output ```emacs-lisp Bootstrapping straight.el... Bootstrapping straight.el...done Rebuilding all packages due to build cache schema change Looking for gnu-elpa-mirror recipe -> Cloning melpa... Looking for gnu-elpa-mirror recipe -> Cloning melpa...done Looking for emacsmirror-mirror recipe -> Cloning gnu-elpa-mirror... Looking for emacsmirror-mirror recipe -> Cloning gnu-elpa-mirror...done Looking for emacsmirror-mirror recipe -> Cloning el-get... Looking for emacsmirror-mirror recipe -> Cloning el-get...done Looking for straight recipe -> Cloning emacsmirror-mirror... Looking for straight recipe -> Cloning emacsmirror-mirror...done Building straight... Building straight...done Test run with version: prerelease (HEAD -> develop, origin/develop) bf5faf0 2021-11-16 Cloning org... Cloning org...done Building org... Building org...done Org mode version 9.5 (9.5-gfaf8ce @ /tmp/straight.el-test-D4Pjtb/straight/build/org/) Packages: "org-elpa" n/a n/a "melpa" n/a master db77988a 2021-11-15 "gnu-elpa-mirror" n/a master 870aae4 2021-11-12 "el-get" melpa master 960f3fb9 2021-10-31 "emacsmirror-mirror" n/a master 5bcbacb 2021-11-12 "straight" n/a develop bf5faf0 2021-11-16 "org" org-elpa main faf8ce7de 2021-11-15 ```
x61 commented 2 years ago

"Testing straight.el in directory: /var/folders/zx/1000pjgs6bj28n4zn_60rwcm0000gn/T/straight.el-test-H8dUNm"

progfolio commented 2 years ago

After the test completes a buffer with test results named "*straight-bug-report-process*" should display.

progfolio commented 2 years ago

If you can't find that buffer, it would be useful to see the output of the following:

x61 commented 2 years ago

Thanks. I did not see the straight buffer but here it is:

`

Test Case ```emacs-lisp (straight-bug-report :post-bootstrap (straight-use-package 'org) (org-version 'nil 'full 'message)) ```
Output ```emacs-lisp Bootstrapping straight.el... Bootstrapping straight.el...done Rebuilding all packages due to build cache schema change Looking for gnu-elpa-mirror recipe → Cloning melpa... Looking for gnu-elpa-mirror recipe → Cloning melpa...done Looking for emacsmirror-mirror recipe → Cloning gnu-elpa-mirror... Looking for emacsmirror-mirror recipe → Cloning gnu-elpa-mirror...done Looking for emacsmirror-mirror recipe → Cloning el-get... Looking for emacsmirror-mirror recipe → Cloning el-get...done Looking for straight recipe → Cloning emacsmirror-mirror... Looking for straight recipe → Cloning emacsmirror-mirror...done Building straight... Building straight...done Test run with version: prerelease (HEAD -> develop, origin/develop) 62b18a1 2021-11-17 Cloning org... Cloning org...done Building org... Building org...done Org mode version 9.5 (9.5-gfaf8ce @ /var/folders/zx/1000pjgs6bj28n4zn_60rwcm0000gn/T/straight.el-test-H8dUNm/straight/build/org/) Packages: "org-elpa" n/a n/a "melpa" n/a master db77988a 2021-11-15 "gnu-elpa-mirror" n/a master 870aae4 2021-11-12 "el-get" melpa master 960f3fb9 2021-10-31 "emacsmirror-mirror" n/a master 5bcbacb 2021-11-12 "straight" n/a develop 62b18a1 2021-11-17 "org" org-elpa main faf8ce7de 2021-11-15 ```

It looks like org version is 9.5 but when i check the version withM-x org-version`, it shows 9.4.4

` Org mode version 9.4.4 (release_9.4.4 @ /Users/homemac/.emacs.d/straight/build/org/)

`

progfolio commented 2 years ago

You may have the pre-installed version of Org loaded. What do you get if you M-x locate-library org?

x61 commented 2 years ago

Library is file /usr/local/Cellar/emacs-plus@28/28.0.50/share/emacs/28.0.50/lisp/org/org.el.gz

looks like it. how do I uninstall it and set it up to use the version from straight?

progfolio commented 2 years ago

You don't need to uninstall it. You just need to load the version you want to use first. What's probably happening is you're unintentionally loading the built-in version in your init file prior to the use-package declaration for Org. Try adding the following toward the beginning of your init file and launching Emacs from the command line with the --debug-init option. A backtrace buffer should pop up after Org is loaded and it will tell you what loaded it.

(eval-after-load "org" '(debug))
x61 commented 2 years ago

Thank you. I moved org installation/setup to be right after straight setup and the correct version shows but I am getting the following error messages shown in the screenshot below. Strangly, if I remove org folder from straight/build directory and restart emacs, straight reinstalls org the error goes away but as soon as I restart emacs, the error comes back.

Screen Shot 2021-11-18 at 07 46 38
progfolio commented 2 years ago

That could be stale byte-code or a bug with Org. I suggest rebuilding all of those packages (you can remove their respective straight/build dirs if you want to be entirely sure that nothing is leftover) to see if that fixes the issue. If not, I would file a bug report on the Org development list. I don't think the issue is with straight here, so I'm closing this report for now. If you find more information that makes you think otherwise, feel free to comment and we can re-open if needed.

x61 commented 2 years ago

The only thing is I do not have these errors when I use use-package and only when I use straight but I hear you. Thank you very much for your time and inputs.

progfolio commented 2 years ago

When you use use-package without straight integration, e.g.

(use-package org :straight nil)

You are loading the built-in version of Org. Did you try the byte-code troubleshooting steps in my last comment?

x61 commented 2 years ago

Yeah, I deleted the files from straight/build dir and it rebuilt them but as soon as I restart emacs, the errors returned.

progfolio commented 2 years ago

If you have your init file uploaded somewhere, I can look it over to diagnose this.

x61 commented 2 years ago

Hi @progfolio,

Sorry, I am just noticing your last message. Unfortunately, I do not have my init file uploaded anywhere on the web. I will send it to you privately if that works for you.

Thank you

x61 commented 2 years ago

@progfolio, I sent the init to your email at proton. Please let me know if you got it because I am not sure if that email belongs to you or if you still have access to that account. If not, let me know how I can send the file to you.

progfolio commented 2 years ago

Instead of commenting out blocks of code (e.g. your use-package ane melpa src blocks), you can specify :tangle no for the src block.

https://orgmode.org/manual/Extracting-Source-Code.html

I recommend uncommenting this and you'll want to move it before the bootstrap snippet:

;;(setq straight-repository-branch "develop")

The develop branch is where bugs are fixed first.

This looks suspicious to me. Setting the major-mode default to org-mode may cause it to load early if an elisp program creates a buffer (which happens frequently).

(setq-default major-mode 'org-mode)
(defun my/new-buffer-frame ()
  "Create a new frame with a new empty buffer."
  (interactive)
  (let ((buffer (generate-new-buffer "untitled")))
    (set-buffer-major-mode buffer)
    (display-buffer buffer '(display-buffer-pop-up-frame . nil))))

Why not just activate Org-mode in the buffer instead of globally setting the default value of major-mode?

(defun my/new-buffer-frame ()
  "Create a new frame with a new empty buffer."
  (interactive)
  (let ((buffer (generate-new-buffer "untitled")))
    (with-current-buffer buffer
      (org-mode))
    (display-buffer buffer '(display-buffer-pop-up-frame . nil))))

How are you tangling/loading the init file?

x61 commented 2 years ago

Thank you. I wanted to use org as the default mode but I'll revise the config and remove that option. This is the code I use to toggle the init_file (org-babel-load-file "~/Dropbox/config.org") Did you get to load up the config and did you see the same error messages?

progfolio commented 2 years ago

org-babel-load-file loads Org. That's why you have the built in version loaded.

x61 commented 2 years ago

Just wanted to report that by commenting out the code below, as pointed by @progfolio , the issue disappeared. Thanks very much, @progfolio for your time.

(defun my/new-buffer-frame ()
  "Create a new frame with a new empty buffer."
  (interactive)
  (let ((buffer (generate-new-buffer "untitled")))
    (set-buffer-major-mode buffer)
    (display-buffer buffer '(display-buffer-pop-up-frame . nil))))