unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32169@debbugs.gnu.org
Subject: bug#32169: 27.0.50; Wishlist: cleanup of thread-last-error
Date: Mon, 16 Jul 2018 16:49:42 +0200	[thread overview]
Message-ID: <87a7qrkzg9.fsf@gmx.de> (raw)
In-Reply-To: <83wotv8d1y.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Jul 2018 17:34:17 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> When a thread has died, `thread-last-error' reports the reason. But
>> there is no possibility to cleanup this last error, which makes it
>> inconvenient to check for errors in further threads. A function
>> `cleanup-thread-last-error' or alike would be helpful.
>
> How about having thread-last-error clear the error as a side effect,
> perhaps when called with an optional argument?

I'd be happy with either variant.

> (Btw, I'd rather we made error reporting in non-main threads much more
> solid than what we have now.)

While working on making Tramp threadsafe, I use the following instead of
`signal':

(defsubst tramp-compat-signal (error-symbol data)
  "Signal an error to the main thread."
  (when tramp-compat-main-thread
    (tramp-compat-funcall
     'thread-signal tramp-compat-main-thread error-symbol data))
  (signal error-symbol data))

Works sufficient so far. `tramp-compat-main-thread' is a defconst, which
has as value (car (all-threads)). And `tramp-compat-funcall' is a Tramp
internal macro, good for backward compatibility with Emacs 24 and 25.

Best regards, Michael.

PS: Maybe I shall push this to a git branch, giving people a chance for
early tests. `find-file-noselect' survives already in simple cases, w/o
an Emacs crash.





  reply	other threads:[~2018-07-16 14:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16  7:18 bug#32169: 27.0.50; Wishlist: cleanup of thread-last-error Michael Albinus
2018-07-16 14:34 ` Eli Zaretskii
2018-07-16 14:49   ` Michael Albinus [this message]
2018-07-16 15:28     ` Eli Zaretskii
2018-07-16 15:55       ` Michael Albinus
2018-07-16 18:03         ` Eli Zaretskii
2018-07-16 18:20           ` Michael Albinus
2018-07-17 10:05           ` Michael Albinus
2018-07-17 15:46             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a7qrkzg9.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=32169@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).