Re: Recommended way to work on main without upgrading Org?

2022-12-23 Thread Richard Kim
Richard Kim  writes:

> Richard Kim  writes:
>
>> Karthik Chikmagalur  writes:
>>
>>> I can get it to work with emacs -Q as well, and this is good for testing, 
>>> thank you.
>>>
>>> But I'm looking for a way to retain the rest of my configuration and swap 
>>> out
>>> Org as required. Otherwise I can't do any interactive development. Another
>>> alternative is to set up a completely different init directory and run Emacs
>>> with a chemacs2 profile or with the new --init-directory flag, but 
>>> considering
>>> the complexity/size of my configuration this would be onerous.
>>
>> How about specifying org version of your choice on command line like this?
>>
>> emacs --eval "(add-to-list 'load-path \"/path/to/org\")"
>>
>> So long as you don't activate another org mode package within your
>> start-up files, above should work I think.
>
> If you want to better control where your org path end up in load-path,
> then you can use one of several hooks, e.g., following delays updating
> load-path till almost the very end of emacs startup process
>
> emacs --eval "(add-hook 'emacs-startup-hook (lambda () (add-to-list 
> 'load-path \"/path/to/org\")) 100)"
>
> See [[info:elisp#Startup Summary]] for emacs startup details.

An alternative is to use --init-directory with thin wrapper around your normal 
config, e.g.,
you can create arbitrary configuration which makes small tweaks to your
normal configuration with something like the following:

$ cat /tmp/e1/early-init.el
(add-to-list 'load-path "/path/to/org")
(setq user-emacs-directory "~/.emacs.d/")
(load-library (expand-file-name "early-init.el" user-emacs-directory))

$ cat /tmp/e1/init.el
(load-library (expand-file-name "init.el" user-emacs-directory))

$ emacs --init-directory /tmp/e1




Re: Recommended way to work on main without upgrading Org?

2022-12-23 Thread Richard Kim
Richard Kim  writes:

> Karthik Chikmagalur  writes:
>
>> I can get it to work with emacs -Q as well, and this is good for testing, 
>> thank you.
>>
>> But I'm looking for a way to retain the rest of my configuration and swap out
>> Org as required. Otherwise I can't do any interactive development. Another
>> alternative is to set up a completely different init directory and run Emacs
>> with a chemacs2 profile or with the new --init-directory flag, but 
>> considering
>> the complexity/size of my configuration this would be onerous.
>
> How about specifying org version of your choice on command line like this?
>
> emacs --eval "(add-to-list 'load-path \"/path/to/org\")"
>
> So long as you don't activate another org mode package within your
> start-up files, above should work I think.

If you want to better control where your org path end up in load-path,
then you can use one of several hooks, e.g., following delays updating
load-path till almost the very end of emacs startup process

emacs --eval "(add-hook 'emacs-startup-hook (lambda () (add-to-list 
'load-path \"/path/to/org\")) 100)"

See [[info:elisp#Startup Summary]] for emacs startup details.




Re: Recommended way to work on main without upgrading Org?

2022-12-23 Thread Richard Kim
Karthik Chikmagalur  writes:

> I can get it to work with emacs -Q as well, and this is good for testing, 
> thank you.
>
> But I'm looking for a way to retain the rest of my configuration and swap out
> Org as required. Otherwise I can't do any interactive development. Another
> alternative is to set up a completely different init directory and run Emacs
> with a chemacs2 profile or with the new --init-directory flag, but considering
> the complexity/size of my configuration this would be onerous.

How about specifying org version of your choice on command line like this?

emacs --eval "(add-to-list 'load-path \"/path/to/org\")"

So long as you don't activate another org mode package within your
start-up files, above should work I think.




Re: Recommended way to work on main without upgrading Org?

2022-12-22 Thread Max Nikulin

On 22/12/2022 11:52, Karthik Chikmagalur wrote:

or with the new --init-directory flag


I can not believe in it. A year ago after reading

https://debbugs.gnu.org/15539
24.3; setting user-emacs-directory at command line invocation
Date: Thu, 13 Aug 2020 13:06:33 +0200

So I think the conclusion to this long thread was that we don't want to
add a specific switch for this, and instead people can say
"XDG_CONFIG_HOME=/whatever emacs" when they want to change these paths.
So I'm closing this bug report.


I decided it would never happen. Now I have found

https://debbugs.gnu.org/16242
24.3; wish: set init directory (.emacs.d) by commandline flag for easy 
custom environments


It makes managing of independent emacs sessions much more convenient. 
Common part of configuration may be loaded from all init files.





Re: Recommended way to work on main without upgrading Org?

2022-12-21 Thread Milan Glacier

On 12/21/22 19:19, Karthik Chikmagalur wrote:

Hi,

I'm trying to work on the main branch of Org, with the intent of creating a 
patch.  However, I need to continue using Org 9.5 for everyday work in a 
separate Emacs session as I can't have things breaking.  Is there a recommended 
way to run two simultaneous instances of Emacs using two different Org versions?

I use Straight to install Org 9.5.  I've cloned the latest main branch from 
Savannah to work on, but I'm not able to test my changes cleanly since there 
are two org versions in the mix -- technically three including the built-in 
version that's been shadowed.

Karthik


Try to use emacs-29 which allows you to specify alternative init load
path if you don't want to use chemacs?



Re: Recommended way to work on main without upgrading Org?

2022-12-21 Thread Greg Minshall
i would also think it would be possible to have two different straight
recipes -- one for "org-mode", and one for "org-mode-test" -- which you
would enable or disable (by editing .emacs, if no other way) on
different invocations of emacs.  and, be careful not to have both
enabled at the same time! :)



Re: Recommended way to work on main without upgrading Org?

2022-12-21 Thread Karthik Chikmagalur
I can get it to work with emacs -Q as well, and this is good for testing, thank 
you.

But I'm looking for a way to retain the rest of my configuration and swap out 
Org as required.  Otherwise I can't do any interactive development.  Another 
alternative is to set up a completely different init directory and run Emacs 
with a chemacs2 profile or with the new --init-directory flag, but considering 
the complexity/size of my configuration this would be onerous.

Karthik



Re: Recommended way to work on main without upgrading Org?

2022-12-21 Thread Tim Cross


Karthik Chikmagalur  writes:

> Hi,
>
> I'm trying to work on the main branch of Org, with the intent of creating a 
> patch.
> However, I need to continue using Org 9.5 for everyday work in a separate 
> Emacs session as
> I can't have things breaking.  Is there a recommended way to run two 
> simultaneous
> instances of Emacs using two different Org versions?
>
> I use Straight to install Org 9.5.  I've cloned the latest main branch from 
> Savannah to
> work on, but I'm not able to test my changes cleanly since there are two org 
> versions in
> the mix -- technically three including the built-in version that's been 
> shadowed.
>
> Karthik

Have a look at the chemacs2 package
https://github.com/plexus/chemacs2.git

With this package, you can define multiple Emacs profiles, making it
easy to start Emacs with different configurations or package
versions. For example, I have a number of different profiles, including
'default', 'experiment' and 'vanilla'.

My default profile is my normal day-to-day emacs configuration.
The 'experiment' profile is where I am trying out different packages or
different configurations. When there has been a major new release of a
package I rely on (such as org), I will usually upgrade in the
'experiment' profile and try it out to verify it has no major issues
before I install it in my default profile.

The 'vanilla' profile is a very basic and as close to 'out of the box'
configuration as I can do. I use it when I've discovered a bug and want
to both verify it isn't due to any of my configuration and provide
a minimal reproducible case which works with Emacs default
configuration.

All I have to do to use the non-default profile is start Emacs with the
command argument --with-profile= where  is the profile name
I want to run.





Re: Recommended way to work on main without upgrading Org?

2022-12-21 Thread General discussions about Org-mode.


Karthik Chikmagalur  writes:

> Hi,
>
> I'm trying to work on the main branch of Org, with the intent of creating a
> patch.  However, I need to continue using Org 9.5 for everyday work in a
> separate Emacs session as I can't have things breaking.  Is there a 
> recommended
> way to run two simultaneous instances of Emacs using two different Org 
> versions?
>
> I use Straight to install Org 9.5.  I've cloned the latest main branch from
> Savannah to work on, but I'm not able to test my changes cleanly since there 
> are
> two org versions in the mix -- technically three including the built-in 
> version
> that's been shadowed.
>
> Karthik

I got curious and tried it myself.  References are the emacs manpage in
my system and this message in the mailing list
(https://lists.gnu.org/archive/html/emacs-orgmode/2022-12/msg00520.html).

$ cd $(mktemp -d)
$ git clone git://git.savannah.gnu.org/emacs/org-mode.git
$ make -C org-mode
$ emacs -Q -L org-mode/lisp -l org --batch --eval "(call-interactively 
#'org-version)"
Org mode version 9.6 (release_9.6-126-gf731d4 @ 
/tmp/tmp.1wPdM68xpD/org-mode/lisp/)

At the last step, if you remove everything after --batch, you will have
a clean-slate Emacs with nothing but org loaded.



Recommended way to work on main without upgrading Org?

2022-12-21 Thread Karthik Chikmagalur
Hi,

I'm trying to work on the main branch of Org, with the intent of creating a 
patch.  However, I need to continue using Org 9.5 for everyday work in a 
separate Emacs session as I can't have things breaking.  Is there a recommended 
way to run two simultaneous instances of Emacs using two different Org versions?

I use Straight to install Org 9.5.  I've cloned the latest main branch from 
Savannah to work on, but I'm not able to test my changes cleanly since there 
are two org versions in the mix -- technically three including the built-in 
version that's been shadowed.

Karthik