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

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: 32169@debbugs.gnu.org
> Date: Mon, 16 Jul 2018 16:49:42 +0200
> 
> > 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.

Should be easy to do, I think.

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

I was certain we had on master a function ti return the main thread,
but I guess I was dreaming.  We could easily add it, though.

In any case, I think it could be a good idea to describe this
technique in the ELisp manual.

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

SGTM, thanks.





  reply	other threads:[~2018-07-16 15:28 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
2018-07-16 15:28     ` Eli Zaretskii [this message]
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=83sh4j8ak8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=32169@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /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).