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: org-persist files in /tmp

2022-12-21 Thread Tim Cross


Ihor Radchenko  writes:

> "Fraga, Eric"  writes:
>
>> for some reason, I am now getting many (tens) directories of the form
>> org-persist-NN in /tmp.  These seem to include an index file and a
>> cache type sub-directory structure.  Why are these there and does
>> anything clean them up?
>>
>> I have nothing related to org-persist in my configuration that I can
>> see.
>
> If you run something like make test or emacs -Q + org, it is expected.
> These are throwaway directories used by org-persist for emacs -Q.
>
> Do we need to care about cleaning up /tmp?

Probably not - at least not on most modern Linux systems as these tend
to have a systemd task which will clean up the temp directories on
reboot. You can usually tweak the settings for systemd-tempfiles if you
want to modify when and how often temporary files are cleaned up.



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: org-persist files in /tmp

2022-12-21 Thread Greg Minshall
hi, Ihor,

> Do we need to care about cleaning up /tmp?

my two cents is that maybe one should not care so much about cleaning up
/tmp, but i think it's worthwhile trying not to clutter it up too much.

cheers, Greg



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



Re: org-persist files in /tmp

2022-12-21 Thread Ihor Radchenko
William Denton  writes:

>> You should _not_ see something like
>>
>> ((:container
>>  ((index "2.7"))
>>  :persist-file "d0/5078fe-5e31-4ddb-95a0-93ceae58df0c" :associated nil 
>> :expiry never :last-access 1671637032.483552 :last-access-hr 
>> "2022-12-21T18:37:12+0300"))
>>
>> as the only contents of "index" file.
>
> I just checked my /tmp/ and I have 32 org-persist directories, and I must 
> sadly 
> report they all have index files like I shouldn't see:

Thanks for the heads-up!
Fixed on bugfix now.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e2366ac28

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org-persist files in /tmp

2022-12-21 Thread William Denton

On 21 December 2022, Ihor Radchenko wrote:


Could be. If so, it may indicate some issue with logic. The index should
not be written if the only entry inside index file is index version
itself.

You should _not_ see something like

((:container
 ((index "2.7"))
 :persist-file "d0/5078fe-5e31-4ddb-95a0-93ceae58df0c" :associated nil :expiry never 
:last-access 1671637032.483552 :last-access-hr "2022-12-21T18:37:12+0300"))

as the only contents of "index" file.


I just checked my /tmp/ and I have 32 org-persist directories, and I must sadly 
report they all have index files like I shouldn't see:


 ((:container
   ((index "2.7"))
   :persist-file "2f/859289-dcc1-4d55-8c91-e22b4ccc92dd" :associated nil :expiry never 
:last-access 1671429856.980864 :last-access-hr  "2022-12-19T01:04:16-0500"))

Nineteen of them were made on Monday ago, and I may have rebuilt Emacs and Org 
then, and maybe restarted Emacs, but not nineteen times.


Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada



ob-groovy.el must be hand-loaded?

2022-12-21 Thread Galaxy Being
Don't know why, but in my "spare time" I snoop around Babel. So I've
revisited Groovy in Babel and have found a bizarre situation where, yes,
there appears an ob-groovy.el in my ~/.emacs.d/elpa/org-9.6/ , but I have
to do a specific load-file to get it seen and functioning. And no, it's not
because of a naming issue in my

 (org-babel-do-load-languages
 (quote org-babel-load-languages)
 (quote ((emacs-lisp . t)
  (groovy . t)
   ...
  )))

form. I've renamed it apache-groovy and it errored out specifically not
finding ob-groovy.el. But again, if I don't specifically load the org-9.6
ob-groovy.el, I get "can't find program groovy" upon block C-c C-c.

-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Re: org-persist files in /tmp

2022-12-21 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> On Wednesday, 21 Dec 2022 at 15:06, Ihor Radchenko wrote:
>> If you run something like make test or emacs -Q + org, it is expected.
>> These are throwaway directories used by org-persist for emacs -Q.
>
> I am not explicitly running either of those (at the moment).
>
> I wonder if this is somehow related to native compilation or some other
> post-build processes as I have built Emacs twice from git today (and I
> always update org when I build Emacs) and these directories have
> appeared soon thereafter (I think).

Could be. If so, it may indicate some issue with logic. The index should
not be written if the only entry inside index file is index version
itself.

You should _not_ see something like

((:container
  ((index "2.7"))
  :persist-file "d0/5078fe-5e31-4ddb-95a0-93ceae58df0c" :associated nil :expiry 
never :last-access 1671637032.483552 :last-access-hr 
"2022-12-21T18:37:12+0300"))

as the only contents of "index" file.

>> Do we need to care about cleaning up /tmp?
>
> Maybe not but I do use /tmp for some things and having tens of these
> directories does clutter things up a bit.  I'm happy to ignore but was
> curious as to why they were there at all.

This has been introduced in

2944a2152d491452697cc4db538d6b2344c0e37d
Author: Ihor Radchenko 
org-persist: Use temporary index for emacs -Q

* lisp/org-persist.el (org-persist--disable-when-emacs-Q): Rename
`org-persist-disable-when-emacs-Q' to internal variable.  Update the
docstring.
(org-persist-read):
(org-persist-write):
(org-persist-gc): Do not disable persistence.  Persistence is
necessary for remote file caching to work within a single Emacs
session.  Instead, use temporary directory as index for emacs -Q.

Also, see
https://orgmode.org/list/1158097067.265983.1670026787...@mail1.libero.it

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org-persist files in /tmp

2022-12-21 Thread Fraga, Eric
On Wednesday, 21 Dec 2022 at 15:06, Ihor Radchenko wrote:
> If you run something like make test or emacs -Q + org, it is expected.
> These are throwaway directories used by org-persist for emacs -Q.

I am not explicitly running either of those (at the moment).

I wonder if this is somehow related to native compilation or some other
post-build processes as I have built Emacs twice from git today (and I
always update org when I build Emacs) and these directories have
appeared soon thereafter (I think).

> Do we need to care about cleaning up /tmp?

Maybe not but I do use /tmp for some things and having tens of these
directories does clutter things up a bit.  I'm happy to ignore but was
curious as to why they were there at all.

Thank you,
eric

-- 
: Eric S Fraga, with org release_9.6-124-g036cc0 in Emacs 30.0.50


Re: org-persist files in /tmp

2022-12-21 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> for some reason, I am now getting many (tens) directories of the form
> org-persist-NN in /tmp.  These seem to include an index file and a
> cache type sub-directory structure.  Why are these there and does
> anything clean them up?
>
> I have nothing related to org-persist in my configuration that I can
> see.

If you run something like make test or emacs -Q + org, it is expected.
These are throwaway directories used by org-persist for emacs -Q.

Do we need to care about cleaning up /tmp?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Babel (scheme): Evaluation errors are not shown

2022-12-21 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> Ihor Radchenko  writes:
>
>> Note that we currently have no maintainer for ob-scheme and hence can
>> only provide very limited support. New features are hard for us
>> without experience with scheme and geiser.
>
> I volunteer to maintain `ob-scheme'.
>
> (I use Scheme and Geiser heavily at work, albeit not via Org.)

CCing Bastien.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug? Error in HTML export of links with search options

2022-12-21 Thread Ihor Radchenko
Daniel Fleischer  writes:

> Org offers the ability to run a search inside a link, see (org) Search
> Options. E.g. [[File.c::100]] to get to line 100 in File.c. When
> exporting this to HTML I get the following error:
>
> org-export-data: Unable to resolve link: "‘recenter’ing a window that 
> does not display current-buffer."
>
> Also when having links of the form [[File.clj::defn]] where `defn' is a
> search string.
>
> Main 04d2cc59.

Confirmed.

I am unable to reproduce this exact error.
I am unable to reproduce error at all with ::defn search options.

I am, however, able to reproduce a different error with File.c::100, and
I get test.txt#MissingReference with test.txt::search-string.

This is all because `org-html-link' uses
`org-publish-resolve-external-link', which only supports limited search
options.

Patches welcome!

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



org-persist files in /tmp

2022-12-21 Thread Fraga, Eric
Dear all,

for some reason, I am now getting many (tens) directories of the form
org-persist-NN in /tmp.  These seem to include an index file and a
cache type sub-directory structure.  Why are these there and does
anything clean them up?

I have nothing related to org-persist in my configuration that I can
see.

Thank you,
eric

-- 
: Eric S Fraga, with org release_9.6-120-gd9e258 in Emacs 30.0.50


Re: [PATCH] Fix missing null check for tangle links during export

2022-12-21 Thread Ihor Radchenko
Tom Gillespie  writes:

> Hi,
>Here is a patch that fixes broken tangling during export. I don't have a
> simple reproduction, but was able to run git bisect to find the originating
> commit. The commit text explains the issue in detail. Best,
> Tom

Thanks!
Applied onto bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a8c9f1175

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] commit 7048876f broke Figure link with caption [9.6 (release_9.6 @ /Users/powellb/src/org-mode/lisp/)]

2022-12-21 Thread Ihor Radchenko
Brian Powell  writes:

> It seems that the following commit broke the ability to link to a figure
> with a caption.
>
>   commit 7048876f6fa519513763c83bc5baa791420cddab
>   Author: Ihor Radchenko 
>   Date:   Tue Dec 13 11:44:22 2022 +0300
>
>   org-export-get-ordinal: Do not ignore ELEMENT type when TYPES is 
> given
>
>   * lisp/ox.el (org-export-get-ordinal): Append ELEMENT type to TYPES,
>   when TYPES is non-nil.
>
> I have a simple file with a figure and image link. The figure has a
> #+name and #+caption. If I add a link to the figure name in the
> document, then exporting to HTML fails. Prior commits did not have any issue.

Thanks for reporting!
I was unable to reproduce the problem with the given recipe, but I do
see what is wrong looking at the backtrace.

Fixed on bugfix now.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=db34a7d83

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [FR] Add support for racket images in org-babel

2022-12-21 Thread dalanicolai
Thanks for your answer!


> You likely need to extend `org-babel-scheme--table-or-string' to
> understand Image: type.
>

It looks to me that when `org-babel-execute:scheme` gets executed, then the
result will not get inserted as a link, as that would require the results
type 'file', right?
>From the manual , it
seems to me that using the 'file' type is required to get the result
inserted as a link.

However, I can not see how the code does the following as explained in the
manual.

The manual  states
(under Type/file):

> If ‘file’ header argument is missing, Org generates the base name of the
> output file from the name of the code block, and its extension from the ‘
> file-ext’ header argument. In that case, both the name and the extension
> are mandatory.
>
suggesting that a file gets written also when there is no :file header
argument.

But from the `and` condition here

in `org-babel-execute-src-block`, it looks to me that a file is only
written when a :file argument is provided (via the `with-temp-file` that
follows within the 'when file ...').
Anyway, this I only found when trying to find out how the result gets
formatted as a link.

I guess to get the racket `Image` file-path to formatted correctly, it
would be preferable to only touch ob-scheme for that. In which case, I
think the 'result' under 'org-babel-result-cond' at the end of
'org-babel-execute:scheme' should get (re)formatted conditionally (when the
results is a racket image (link)).

So in the end, I conclude that maybe the advice as mentioned in my
'original' mail, might be already the 'cleanest' solution (and that it does
not cause any problem concerning a file getting written to disk, as
luckily, org does not seem to write files when no :file header argument is
given). Anyway, I am struggling to find out how to come up with an
alternative clean(er) solution.

On Sun, 18 Dec 2022 at 13:38, Ihor Radchenko  wrote:

> dalanicolai  writes:
>
> > I have not asked anywhere yet, but I do not know a 'standard org-mode'
> way
> > to make org-mode show the plot images. Racket creates a temp image file
> and
> > returns a string that includes the path to the file. The actual format of
> > the string is:
> >
> > "\"#\""
> >
> > I could create a patch for it, but I am not sure how to best implement it
> > (in a clean way).
>
> You likely need to extend `org-babel-scheme--table-or-string' to
> understand Image: type.
>
> > however, it would be great if support could be added to ob-scheme itself.
> > I would be happy to do it, but as mentioned before I don't think I know
> how
> > to do it in the proper way. I would probably just add a condition around
> the
> > 'result' in 'org-babel-execute:scheme' as follows:
>
> I do not know much about scheme.
>
> Generally, ob-* libraries try their best to convert native language
> types to Elisp. If # is something that is unambiguously
> identified as image file, I do not see why we cannot support it,
> converting the # representation to file link. Especially,
> when users request :results file.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: [BUG] org-latex-src-block-backend is directly used as variable instead of querying export option (was: [Syntax discussion] Should we treat src blocks without LANG as paragraphs?)

2022-12-21 Thread Ihor Radchenko
Timothy  writes:

> I can’t find this in my personal dev branch, but I can see it at
> .
> It seems I resolved this in
> .
>
> Hmmm, the generated preamble commits seem fairly solid now from my usage, so 
> I’m
> not sure if it’s worth fixing this separately or presenting the generated
> preamble patch for review on this ML.

Considering that `org-latex-src-block-backend' cannot be modified using
in-buffer keywords or options, it is relatively safe to keep things as
they are. The only potential breakage will happen if users try to modify
options in export filters directly inside INFO.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-12-21 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> Upon confirming the FSF copyright assignment, I have applied the patch
>> onto bugfix.
>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=01c0ebee2
>
> Your patch appears to not work in some environments:
>
> https://builds.sr.ht/~bzg/job/906710
>
> Any ideas?

Note that the tests are failing only partially. The graphics file does
get created, but it has 0 size for some reason. Maybe something to do
with non-graphical CI environment.

I disabled the tests for the time being until we figure out what is
going on.

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a29103a78

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at