emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Recommended way to work on main without upgrading Org?
@ 2022-12-22  3:19 Karthik Chikmagalur
  2022-12-22  3:51 ` Ruijie Yu via General discussions about Org-mode.
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Karthik Chikmagalur @ 2022-12-22  3:19 UTC (permalink / raw)
  To: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Recommended way to work on main without upgrading Org?
  2022-12-22  3:19 Recommended way to work on main without upgrading Org? Karthik Chikmagalur
@ 2022-12-22  3:51 ` Ruijie Yu via General discussions about Org-mode.
  2022-12-22  4:52   ` Karthik Chikmagalur
  2022-12-22  4:22 ` Tim Cross
  2022-12-22  7:52 ` Milan Glacier
  2 siblings, 1 reply; 10+ messages in thread
From: Ruijie Yu via General discussions about Org-mode. @ 2022-12-22  3:51 UTC (permalink / raw)
  To: Karthik Chikmagalur; +Cc: emacs-orgmode


Karthik Chikmagalur <karthikchikmagalur@gmail.com> 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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Recommended way to work on main without upgrading Org?
  2022-12-22  3:19 Recommended way to work on main without upgrading Org? Karthik Chikmagalur
  2022-12-22  3:51 ` Ruijie Yu via General discussions about Org-mode.
@ 2022-12-22  4:22 ` Tim Cross
  2022-12-22  5:02   ` Greg Minshall
  2022-12-22  7:52 ` Milan Glacier
  2 siblings, 1 reply; 10+ messages in thread
From: Tim Cross @ 2022-12-22  4:22 UTC (permalink / raw)
  To: emacs-orgmode


Karthik Chikmagalur <karthikchikmagalur@gmail.com> 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=<name> where <name> is the profile name
I want to run.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Recommended way to work on main without upgrading Org?
  2022-12-22  3:51 ` Ruijie Yu via General discussions about Org-mode.
@ 2022-12-22  4:52   ` Karthik Chikmagalur
  2022-12-22 10:15     ` Max Nikulin
  2022-12-23 16:20     ` Richard Kim
  0 siblings, 2 replies; 10+ messages in thread
From: Karthik Chikmagalur @ 2022-12-22  4:52 UTC (permalink / raw)
  To: Ruijie Yu; +Cc: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Recommended way to work on main without upgrading Org?
  2022-12-22  4:22 ` Tim Cross
@ 2022-12-22  5:02   ` Greg Minshall
  0 siblings, 0 replies; 10+ messages in thread
From: Greg Minshall @ 2022-12-22  5:02 UTC (permalink / raw)
  To: Tim Cross; +Cc: emacs-orgmode

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! :)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Recommended way to work on main without upgrading Org?
  2022-12-22  3:19 Recommended way to work on main without upgrading Org? Karthik Chikmagalur
  2022-12-22  3:51 ` Ruijie Yu via General discussions about Org-mode.
  2022-12-22  4:22 ` Tim Cross
@ 2022-12-22  7:52 ` Milan Glacier
  2 siblings, 0 replies; 10+ messages in thread
From: Milan Glacier @ 2022-12-22  7:52 UTC (permalink / raw)
  To: Karthik Chikmagalur; +Cc: emacs-orgmode

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?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Recommended way to work on main without upgrading Org?
  2022-12-22  4:52   ` Karthik Chikmagalur
@ 2022-12-22 10:15     ` Max Nikulin
  2022-12-23 16:20     ` Richard Kim
  1 sibling, 0 replies; 10+ messages in thread
From: Max Nikulin @ 2022-12-22 10:15 UTC (permalink / raw)
  To: emacs-orgmode

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.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Recommended way to work on main without upgrading Org?
  2022-12-22  4:52   ` Karthik Chikmagalur
  2022-12-22 10:15     ` Max Nikulin
@ 2022-12-23 16:20     ` Richard Kim
  2022-12-23 16:38       ` Richard Kim
  1 sibling, 1 reply; 10+ messages in thread
From: Richard Kim @ 2022-12-23 16:20 UTC (permalink / raw)
  To: emacs-orgmode

Karthik Chikmagalur <karthikchikmagalur@gmail.com> 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.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Recommended way to work on main without upgrading Org?
  2022-12-23 16:20     ` Richard Kim
@ 2022-12-23 16:38       ` Richard Kim
  2022-12-23 17:07         ` Richard Kim
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Kim @ 2022-12-23 16:38 UTC (permalink / raw)
  To: emacs-orgmode

Richard Kim <emacs18@gmail.com> writes:

> Karthik Chikmagalur <karthikchikmagalur@gmail.com> 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.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Recommended way to work on main without upgrading Org?
  2022-12-23 16:38       ` Richard Kim
@ 2022-12-23 17:07         ` Richard Kim
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Kim @ 2022-12-23 17:07 UTC (permalink / raw)
  To: emacs-orgmode

Richard Kim <emacs18@gmail.com> writes:

> Richard Kim <emacs18@gmail.com> writes:
>
>> Karthik Chikmagalur <karthikchikmagalur@gmail.com> 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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-23 17:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22  3:19 Recommended way to work on main without upgrading Org? Karthik Chikmagalur
2022-12-22  3:51 ` Ruijie Yu via General discussions about Org-mode.
2022-12-22  4:52   ` Karthik Chikmagalur
2022-12-22 10:15     ` Max Nikulin
2022-12-23 16:20     ` Richard Kim
2022-12-23 16:38       ` Richard Kim
2022-12-23 17:07         ` Richard Kim
2022-12-22  4:22 ` Tim Cross
2022-12-22  5:02   ` Greg Minshall
2022-12-22  7:52 ` Milan Glacier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).