GNU bug report logs - #45212
org-capture user-error: Abort

Previous Next

Package: org-mode;

Reported by: daniela-spit <at> gmx.it

Date: Sat, 12 Dec 2020 20:17:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> gmail.com>
To: daniela-spit <at> gmx.it
Cc: 45212 <at> debbugs.gnu.org
Subject: bug#45212: org-capture user-error: Abort
Date: Sun, 13 Dec 2020 12:37:45 +0800
daniela-spit <at> gmx.it writes:

> Can't one throw a capture abort signal instead?

Sure, that is possible. However, consider a possibility that some
external package wants to detect when capture is aborted. If I was
writing such package, I would need to do something like

(condition-case err
 <run capture>
(t <work around the "Abort" error>))

If org-capture is rewritten using catch-throw, the above code would be
broken. Also, there will be no easy way for a user to know if the
capture was completed successfully or if it was aborted.

Note that I do not oppose this change too firmly. I agree that throw (or
even just normal exit) would be cleaner. However, changing user-error to
throw may break external packages and should be considered carefully. On
the other hand, user-error is internal detail of the implementation. So,
changing it should not be a big deal. As a precaution, it can be
announced and implemented as a part of major release.

If you want this change to happen, I suggest to provide the patch. This
will encourage the maintainers to provide feedback.

> What case scenarios would rely
> on user quitting capture rather than going ahead with an entry?

For example, I have a custom capture function from email. The email is
removed from inbox upon capture. However, I would not want to proceed
with removal if capture is aborted for whatever reason.

Best,
Ihor





This bug report was last modified 4 years and 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.