hi. i occasionally want to switch from the org package to a git version, then back again. and, i want to avoid the dread "mixed installation". i'm wondering is there a way people do this other than simply installing/deleting the package version? cheers, Greg
Greg Minshall <minshall@umich.edu> writes:
> hi. i occasionally want to switch from the org package to a git
> version, then back again. and, i want to avoid the dread "mixed
> installation".
>
> i'm wondering is there a way people do this other than simply
> installing/deleting the package version?
>
As I understand it, the critical part is when Emacs compiles the org
files to get the *.elc versions. Provided you do not have any org
functionality loaded during that compilation process, everything should
be OK. The 'mixed' versions problem arises because you go to compile a
different version and Emacs includes definitions already loaded from
another version, generating *.elc files with mixed versions.
Once org is compiled, the critical part is having the org version you
want show up first in the load-path, so the problem becomes one of just
managing the load-path entries appropriately. You could just ensure the
version you want is higher in the load-path or you could go the
'paranoid' route and have code which removes the version you don't want
from the load-path.
In the past, what I've done is have the git version of org in a specific
directory which I build with a separate process from the command line
using the make recipes in the repository - essentially just configuring
and running make. I then have some code in my init.el file which sets
that version at the start of my load-path when I want to run it and
which I comment out when I just want to run the version installed by
package.el. I also use the use-package macro to load my org
configuration and have two different blocks for that - one loading the
git repo version and one loading the org-plus-contrib version I
normally use. I just comment out the one I don't want to use. I probably
could write some elisp to automate this, but to be honest, I switch
between org versions so rarely, commenting/uncommenting parts of my
init.el file is easy enough.
I don't do any of that at the moment as I've not needed to run from the
git repo since I switched to spacemacs and the spacemacs setup already
has the necessary workflow to ensure new versions of org are compiled in
a clean environment. Have not yet thought about how I will need to add
git based org when using spacemacs. Suspect All I'll need to do is
adjust the load-path as part of the init to reference the git sources
before any org functionality is loaded.
--
Tim Cross
> On Mar 21, 2021, at 1:46 PM, Greg Minshall <minshall@umich.edu> wrote:
>
> hi. i occasionally want to switch from the org package to a git
> version, then back again. and, i want to avoid the dread "mixed
> installation".
>
> i'm wondering is there a way people do this other than simply
> installing/deleting the package version?
>
> cheers, Greg
>
The nix package manager is outstanding for these uses. You can have two versions of emacs — each with a different version of org — side by side, or switch between them without needing to re-byte compile anything.
Anthony
[-- Attachment #1: Type: text/plain, Size: 2938 bytes --] Straight.el is worth looking into for this. Has served me well for similar use cases. BR Gustav Get Outlook for iOS<https://aka.ms/o0ukef> ________________________________ From: Emacs-orgmode <emacs-orgmode-bounces+gustav=whil.se@gnu.org> on behalf of Tim Cross <theophilusx@gmail.com> Sent: Sunday, March 21, 2021 10:35:00 PM To: emacs-orgmode@gnu.org <emacs-orgmode@gnu.org> Subject: Re: trivial software engineering'ish question: switching org's Greg Minshall <minshall@umich.edu> writes: > hi. i occasionally want to switch from the org package to a git > version, then back again. and, i want to avoid the dread "mixed > installation". > > i'm wondering is there a way people do this other than simply > installing/deleting the package version? > As I understand it, the critical part is when Emacs compiles the org files to get the *.elc versions. Provided you do not have any org functionality loaded during that compilation process, everything should be OK. The 'mixed' versions problem arises because you go to compile a different version and Emacs includes definitions already loaded from another version, generating *.elc files with mixed versions. Once org is compiled, the critical part is having the org version you want show up first in the load-path, so the problem becomes one of just managing the load-path entries appropriately. You could just ensure the version you want is higher in the load-path or you could go the 'paranoid' route and have code which removes the version you don't want from the load-path. In the past, what I've done is have the git version of org in a specific directory which I build with a separate process from the command line using the make recipes in the repository - essentially just configuring and running make. I then have some code in my init.el file which sets that version at the start of my load-path when I want to run it and which I comment out when I just want to run the version installed by package.el. I also use the use-package macro to load my org configuration and have two different blocks for that - one loading the git repo version and one loading the org-plus-contrib version I normally use. I just comment out the one I don't want to use. I probably could write some elisp to automate this, but to be honest, I switch between org versions so rarely, commenting/uncommenting parts of my init.el file is easy enough. I don't do any of that at the moment as I've not needed to run from the git repo since I switched to spacemacs and the spacemacs setup already has the necessary workflow to ensure new versions of org are compiled in a clean environment. Have not yet thought about how I will need to add git based org when using spacemacs. Suspect All I'll need to do is adjust the load-path as part of the init to reference the git sources before any org functionality is loaded. -- Tim Cross [-- Attachment #2: Type: text/html, Size: 4134 bytes --]
Tim and Gustav, thanks for your answers. in particular, straight.el does seem promising. i'll set it up, use it with Tim's "switching use-package blocks", and see how it goes. cheers, Greg
On 22/03/2021 00:44, Greg Minshall wrote:
> hi. i occasionally want to switch from the org package to a git
> version, then back again. and, i want to avoid the dread "mixed
> installation".
Do you really need to switch or just to launch it a couple of times? Is
it required to run namely compiled version?
Actually I am unsure if the following way is reliable or it has some
problems that I have not discovered yet.
emacs -q -L ~/src/org-mode/lisp -L ~/src/org-mode/contrib/lisp file.org
Unfortunately -L (--directory) options are processed after
~/.emacs.d/init.el, that is why -q (--no-init-file) is added. I had
(require 'org-protocol) in init.el file and a part of org bundled with
emacs were loaded before processing of -L. If there is no setup for
alternative org version, the file could be loaded after -L options using
-l ~/emacs.d/init.el (--load), alternatively a bit cleaned variant of
init.el from another directory could be specified.
I do not recommend to skip contrib directory. I noticed that due to
system-wide configs some files could be loaded from older org contrib.
Gustav,
> Straight.el is worth looking into for this. Has served me well for
> similar use cases.
have you (or anyone else?) had problems getting straight.el to build and
install the info pages for Org mode?
cheers, Greg
[-- Attachment #1: Type: text/plain, Size: 903 bytes --] Hmm, I've had problems getting straight.el to install org-mode itself. That was on windows though. And that issue was fixed recently (https://github.com/raxod502/straight.el/issues/707) I do recall some discussions on building docs long ago and that it wasn't possible due to some design issues. Not sure if that problem remains, or if I recall correctly even. /G Get Outlook for iOS<https://aka.ms/o0ukef> ________________________________ From: Greg Minshall <minshall@umich.edu> Sent: Wednesday, March 24, 2021 3:56:36 AM To: Gustav Wikström <gustav@whil.se> Cc: emacs-orgmode@gnu.org <emacs-orgmode@gnu.org> Subject: straight.el and org info pages? Gustav, > Straight.el is worth looking into for this. Has served me well for > similar use cases. have you (or anyone else?) had problems getting straight.el to build and install the info pages for Org mode? cheers, Greg [-- Attachment #2: Type: text/html, Size: 2122 bytes --]
Greg Minshall <minshall@umich.edu> writes:
> Gustav,
>
>> Straight.el is worth looking into for this. Has served me well for
>> similar use cases.
>
> have you (or anyone else?) had problems getting straight.el to build and
> install the info pages for Org mode?
>
> cheers, Greg
For me (info "(org)") brings up org mode info page located in
org-plus-contrib package installed by straight.el. Thus it appears that
straight.el has no problem building info pages for org mode.
I use straight.el along with spacemacs.
Maxim, also, thanks. i do use (something like) your suggestion when i just want to try once or twice. : emacs -Q -L /path/to/your/org-mode/folder/lisp -l org (from Ihor R, last December.) cheers, Greg
Richard, thanks. for ess, i see your results. for org, or org-plus-contrib, i see info pages from /usr/share/info. a mystery. (which shall be, for the moment, let be.) cheers, Greg
Gustav, thanks. installing org went very well. and, i'm pleased with straight.el. (package.el didn't seem to install the info pages, either.) cheers, Greg