emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org code and error catching
@ 2020-10-26 18:34 Michael Heerdegen
  2023-05-12 13:28 ` Ihor Radchenko
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2020-10-26 18:34 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I had a hard time to debug some problem with the expansion of some
capture template because org catched the error even when I had set
`debug-on-error'.  Would it be possible to make some functions,
e.g. `org-eval' in my case (probably some more?), use
`condition-case-unless-debug' instead of `condition-case'?

Thanks,

Michael.


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

* Re: org code and error catching
  2020-10-26 18:34 org code and error catching Michael Heerdegen
@ 2023-05-12 13:28 ` Ihor Radchenko
  2023-05-15  0:38   ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2023-05-12 13:28 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-orgmode

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I had a hard time to debug some problem with the expansion of some
> capture template because org catched the error even when I had set
> `debug-on-error'.  Would it be possible to make some functions,
> e.g. `org-eval' in my case (probably some more?), use
> `condition-case-unless-debug' instead of `condition-case'?

This is a good idea, except that `condition-case-unless-debug' has
non-obvious side effects that interfere with ERT (Org testing system).

If someone familiar with error handling in Elisp can help with this, it
would be welcome.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: org code and error catching
  2023-05-12 13:28 ` Ihor Radchenko
@ 2023-05-15  0:38   ` Michael Heerdegen
  2023-05-15  7:28     ` Ihor Radchenko
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2023-05-15  0:38 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> This is a good idea, except that `condition-case-unless-debug' has
> non-obvious side effects that interfere with ERT (Org testing system).

What side effects are these?

Thx,
Michael.


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

* Re: org code and error catching
  2023-05-15  0:38   ` Michael Heerdegen
@ 2023-05-15  7:28     ` Ihor Radchenko
  2023-05-16  3:27       ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2023-05-15  7:28 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-orgmode

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> This is a good idea, except that `condition-case-unless-debug' has
>> non-obvious side effects that interfere with ERT (Org testing system).
>
> What side effects are these?

In my attempts, the tests started failing for no obvious reason.
Just from changing `condition-case' to `condition-case-unless-debug'.

Though I did not investigate if it happened for every atomic change.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: org code and error catching
  2023-05-15  7:28     ` Ihor Radchenko
@ 2023-05-16  3:27       ` Michael Heerdegen
  2023-05-16  9:33         ` Ihor Radchenko
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2023-05-16  3:27 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> In my attempts, the tests started failing for no obvious reason.
> Just from changing `condition-case' to `condition-case-unless-debug'.
>
> Though I did not investigate if it happened for every atomic change.

Hmm - mine gave a different result: I cloned the org-mode archive from
https://git.savannah.gnu.org/git/emacs/org-mode.git, called "make" and
ran the tests as described in the "testing/README".  That gave 6 failing
tests.

Then I blindly replaced every occurrence of `condition-case' with
`condition-case-unless-debug' (everywhere but not in the tests), ran
"git clean -xf", then "make" again, and ran the tests again.  Again 6
failing tests.

Not sure if I did something wrong.

Michael.


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

* Re: org code and error catching
  2023-05-16  3:27       ` Michael Heerdegen
@ 2023-05-16  9:33         ` Ihor Radchenko
  2023-05-16 19:55           ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2023-05-16  9:33 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-orgmode

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hmm - mine gave a different result: I cloned the org-mode archive from
> https://git.savannah.gnu.org/git/emacs/org-mode.git, called "make" and
> ran the tests as described in the "testing/README".  That gave 6 failing
> tests.

What are those?
I do not have anything failing on my side.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: org code and error catching
  2023-05-16  9:33         ` Ihor Radchenko
@ 2023-05-16 19:55           ` Michael Heerdegen
  2023-05-16 20:04             ` Ihor Radchenko
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2023-05-16 19:55 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

Ihor Radchenko <yantar92@posteo.net> writes:

> What are those?
> I do not have anything failing on my side.

See the attached file.  I had been using an up-to-date Emacs master build.

Michael.


[-- Attachment #2: org-tests-2023-05-16-with-master.txt.zip --]
[-- Type: application/zip, Size: 23191 bytes --]

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

* Re: org code and error catching
  2023-05-16 19:55           ` Michael Heerdegen
@ 2023-05-16 20:04             ` Ihor Radchenko
  2023-05-16 23:50               ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2023-05-16 20:04 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-orgmode

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> What are those?
>> I do not have anything failing on my side.
>
> See the attached file.  I had been using an up-to-date Emacs master build.

Ah. Different locale (LANG). It is
https://list.orgmode.org/orgmode/D140FA73-9995-4467-963E-00D5964485C0@axelkielhorn.de/

As for condition-case-unless-debug, may you create a patch?
But please do not replace everything blindly - I know for sure that at
least some `condition-case' clauses are there on purpose.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: org code and error catching
  2023-05-16 20:04             ` Ihor Radchenko
@ 2023-05-16 23:50               ` Michael Heerdegen
  2023-06-01 12:12                 ` Ihor Radchenko
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2023-05-16 23:50 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> As for condition-case-unless-debug, may you create a patch?
> But please do not replace everything blindly - I know for sure that at
> least some `condition-case' clauses are there on purpose.

I nearly never had a closer look at the org-mode code (other than
blindly).  I would prefer to help differently (like reviewing a patch),
honestly, unless there is really no one more appropriate to find.

Michael.


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

* Re: org code and error catching
  2023-05-16 23:50               ` Michael Heerdegen
@ 2023-06-01 12:12                 ` Ihor Radchenko
  2023-06-02  0:41                   ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2023-06-01 12:12 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-orgmode

Michael Heerdegen <michael_heerdegen@web.de> writes:

>> As for condition-case-unless-debug, may you create a patch?
>> But please do not replace everything blindly - I know for sure that at
>> least some `condition-case' clauses are there on purpose.
>
> I nearly never had a closer look at the org-mode code (other than
> blindly).  I would prefer to help differently (like reviewing a patch),
> honestly, unless there is really no one more appropriate to find.

I changed instances that appear to be safe.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5b4eebfab

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: org code and error catching
  2023-06-01 12:12                 ` Ihor Radchenko
@ 2023-06-02  0:41                   ` Michael Heerdegen
  2023-06-02  1:12                     ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2023-06-02  0:41 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> I changed instances that appear to be safe.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5b4eebfab

I reviewed it shortly - looks appropriate.

Thank you very much!

Michael.


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

* Re: org code and error catching
  2023-06-02  0:41                   ` Michael Heerdegen
@ 2023-06-02  1:12                     ` Michael Heerdegen
  2023-06-02  7:54                       ` Ihor Radchenko
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2023-06-02  1:12 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I reviewed it shortly - looks appropriate.

Though, I think you didn't change the occurrence that this thread
started with - `org-eval'.  Does changing this one cause problems?

Michael.


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

* Re: org code and error catching
  2023-06-02  1:12                     ` Michael Heerdegen
@ 2023-06-02  7:54                       ` Ihor Radchenko
  2023-06-02 22:44                         ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2023-06-02  7:54 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-orgmode

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
>> I reviewed it shortly - looks appropriate.
>
> Though, I think you didn't change the occurrence that this thread
> started with - `org-eval'.  Does changing this one cause problems?

Tests are passing.
I originally skipped it because it did not look useful from a brief
glance to have full backtraces there, and I was unsure if it is truly
safe.

I see no obvious downsides though.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1cb5de621

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: org code and error catching
  2023-06-02  7:54                       ` Ihor Radchenko
@ 2023-06-02 22:44                         ` Michael Heerdegen
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Heerdegen @ 2023-06-02 22:44 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> > Though, I think you didn't change the occurrence that this thread
> > started with - `org-eval'.  Does changing this one cause problems?
>
> Tests are passing.
> I originally skipped it because it did not look useful from a brief
> glance to have full backtraces there, and I was unsure if it is truly
> safe.

I don't recall either why I originally needed backtraces for it.  There
was a reason, but I don't remember.

> I see no obvious downsides though.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1cb5de621

Thanks, Ihor.


Michael.


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

end of thread, other threads:[~2023-06-02 22:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 18:34 org code and error catching Michael Heerdegen
2023-05-12 13:28 ` Ihor Radchenko
2023-05-15  0:38   ` Michael Heerdegen
2023-05-15  7:28     ` Ihor Radchenko
2023-05-16  3:27       ` Michael Heerdegen
2023-05-16  9:33         ` Ihor Radchenko
2023-05-16 19:55           ` Michael Heerdegen
2023-05-16 20:04             ` Ihor Radchenko
2023-05-16 23:50               ` Michael Heerdegen
2023-06-01 12:12                 ` Ihor Radchenko
2023-06-02  0:41                   ` Michael Heerdegen
2023-06-02  1:12                     ` Michael Heerdegen
2023-06-02  7:54                       ` Ihor Radchenko
2023-06-02 22:44                         ` Michael Heerdegen

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).