Re: trivial software engineering'ish question: switching org's

2021-03-23 Thread Greg Minshall
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



Re: trivial software engineering'ish question: switching org's

2021-03-22 Thread Maxim Nikulin

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.





Re: trivial software engineering'ish question: switching org's

2021-03-22 Thread Greg Minshall
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



Re: trivial software engineering'ish question: switching org's

2021-03-21 Thread Gustav Wikström
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  on behalf of 
Tim Cross 
Sent: Sunday, March 21, 2021 10:35:00 PM
To: emacs-orgmode@gnu.org 
Subject: Re: trivial software engineering'ish question: switching org's


Greg Minshall  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



Re: trivial software engineering'ish question: switching org's

2021-03-21 Thread Anthony Cowley



> On Mar 21, 2021, at 1:46 PM, 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".
> 
> 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




Re: trivial software engineering'ish question: switching org's

2021-03-21 Thread Tim Cross


Greg Minshall  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



trivial software engineering'ish question: switching org's

2021-03-21 Thread Greg Minshall
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