GNU bug report logs -
#32169
27.0.50; Wishlist: cleanup of thread-last-error
Previous Next
Reported by: Michael Albinus <michael.albinus <at> gmx.de>
Date: Mon, 16 Jul 2018 07:20:01 UTC
Severity: wishlist
Tags: fixed
Found in version 27.0.50
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32169 in the body.
You can then email your comments to 32169 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#32169
; Package
emacs
.
(Mon, 16 Jul 2018 07:20:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Michael Albinus <michael.albinus <at> gmx.de>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 16 Jul 2018 07:20:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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.
Or this functionality exist already, and I haven't been able to discover.
In GNU Emacs 27.0.50 (build 13, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
of 2018-07-14 built on detlef
Repository revision: 155d7303808345dd73427302d9a352ec5461c11a
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04 LTS
Recent messages:
Mark set
Mark saved where search started
Mark set
Mark saved where search started [2 times]
Quit [3 times]
Grep finished with 5 matches found
Current locus from *grep*
Grep finished with 40 matches found
Mark set [2 times]
Current locus from *grep*
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LCMS2
Important settings:
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=none
locale-coding-system: utf-8
Major mode: C/*l
Minor modes in effect:
diff-auto-refine-mode: t
erc-notify-mode: t
erc-notifications-mode: t
display-time-mode: t
shell-dirtrack-mode: t
icomplete-mode: t
show-paren-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
abbrev-mode: t
Load-path shadows:
/home/albinus/src/elpa/packages/debbugs/debbugs-org hides /home/albinus/.emacs.d/elpa/debbugs-0.15/debbugs-org
/home/albinus/src/elpa/packages/debbugs/debbugs-gnu hides /home/albinus/.emacs.d/elpa/debbugs-0.15/debbugs-gnu
/home/albinus/src/elpa/packages/debbugs/debbugs hides /home/albinus/.emacs.d/elpa/debbugs-0.15/debbugs
/home/albinus/src/elpa/packages/debbugs/debbugs-autoloads hides /home/albinus/.emacs.d/elpa/debbugs-0.15/debbugs-autoloads
/home/albinus/src/elpa/packages/debbugs/debbugs-pkg hides /home/albinus/.emacs.d/elpa/debbugs-0.15/debbugs-pkg
/home/albinus/src/elpa/packages/debbugs/debbugs-browse hides /home/albinus/.emacs.d/elpa/debbugs-0.15/debbugs-browse
~/lisp/telepathy hides /home/albinus/.emacs.d/elpa/telepathy-20131209.458/telepathy
/home/albinus/src/elpa/packages/tramp-theme/tramp-theme hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme
/home/albinus/src/elpa/packages/tramp-theme/tramp-theme-autoloads hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme-autoloads
/home/albinus/src/elpa/packages/tramp-theme/tramp-theme-pkg hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme-pkg
~/src/tramp/lisp/tramp-smb hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-smb
~/src/tramp/lisp/tramp-uu hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-uu
~/src/tramp/lisp/tramp-adb hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-adb
~/src/tramp/lisp/tramp-compat hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-compat
~/src/tramp/lisp/tramp-archive hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-archive
~/src/tramp/lisp/tramp hides /usr/local/share/emacs/27.0.50/lisp/net/tramp
~/src/tramp/lisp/trampver hides /usr/local/share/emacs/27.0.50/lisp/net/trampver
~/src/tramp/lisp/tramp-ftp hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-ftp
~/src/tramp/lisp/tramp-cmds hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-cmds
~/src/tramp/lisp/tramp-gvfs hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-gvfs
~/src/tramp/lisp/tramp-loaddefs hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-loaddefs
~/lisp/dbus hides /usr/local/share/emacs/27.0.50/lisp/net/dbus
~/src/tramp/lisp/tramp-sh hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-sh
~/src/tramp/lisp/tramp-cache hides /usr/local/share/emacs/27.0.50/lisp/net/tramp-cache
Features:
(shadow sort mail-extr warnings emacsbug message rmc puny rfc822 mml
mml-sec epa gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils find-dired grep compile
macrostep-c cmacexp macrostep cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs time-stamp misearch
multi-isearch noutline outline tramp-tests tramp-cmds files-x vc-hg
vc-bzr ert-x ert find-func ewoc debug vc-git diff-mode easy-mmode
bug-reference elec-pair erc-notify erc-networks
erc-desktop-notifications erc-match notifications dbus xml erc-goodies
erc erc-backend erc-compat thingatpt pp erc-loaddefs cperl-mode time
tramp-sh kubernetes-tramp lxc-tramp docker-tramp tramp-cache
vagrant-tramp dash term disp-table ehelp tramp trampver tramp-compat
tramp-loaddefs ucs-normalize shell pcomplete comint ansi-color ring
parse-time format-spec advice ido jka-compr icomplete paren vc
vc-dispatcher dired dired-loaddefs time-date mule-util rx edmacro kmacro
slime-autoloads info finder-inf package let-alist derived pcase cl-extra
help-mode easymenu url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq
byte-opt gv bytecomp byte-compile cconv epg epg-config subr-x
cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)
Memory information:
((conses 16 565273 73857)
(symbols 48 40363 1)
(miscs 40 117 479)
(strings 32 79903 4696)
(string-bytes 1 2431472)
(vectors 16 59168)
(vector-slots 8 1758716 193976)
(floats 8 102 461)
(intervals 56 3007 99)
(buffers 992 19))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#32169
; Package
emacs
.
(Mon, 16 Jul 2018 14:35:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 32169 <at> debbugs.gnu.org (full text, mbox):
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Date: Mon, 16 Jul 2018 09:18:48 +0200
>
>
> 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?
(Btw, I'd rather we made error reporting in non-main threads much more
solid than what we have now.)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#32169
; Package
emacs
.
(Mon, 16 Jul 2018 14:50:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 32169 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> 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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#32169
; Package
emacs
.
(Mon, 16 Jul 2018 15:29:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 32169 <at> debbugs.gnu.org (full text, mbox):
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: 32169 <at> 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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#32169
; Package
emacs
.
(Mon, 16 Jul 2018 15:56:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 32169 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
Hi Eli,
>> > How about having thread-last-error clear the error as a side effect,
>> > perhaps when called with an optional argument?
>
> Should be easy to do, I think.
[...]
> 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.
Do you want to do it, or shall I? I know, you are overloaded ...
master or emacs-26 branch? I believe threads are not used widely, so we
won't break any code with Emacs 26.
> In any case, I think it could be a good idea to describe this
> technique in the ELisp manual.
Will do, once the changes above have arrived.
>> 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.
Later this week. Tomorrow, or on Wednesday, I'll be busy with merging
shadowfile.el.
Best regards, Michael.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#32169
; Package
emacs
.
(Mon, 16 Jul 2018 18:04:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 32169 <at> debbugs.gnu.org (full text, mbox):
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: 32169 <at> debbugs.gnu.org
> Date: Mon, 16 Jul 2018 17:55:31 +0200
>
> >> > How about having thread-last-error clear the error as a side effect,
> >> > perhaps when called with an optional argument?
> >
> > Should be easy to do, I think.
>
> [...]
>
> > 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.
>
> Do you want to do it, or shall I? I know, you are overloaded ...
Feel free.
> master or emacs-26 branch? I believe threads are not used widely, so we
> won't break any code with Emacs 26.
That's true, but then no one really waits for those new features, so
maybe master after all.
> > In any case, I think it could be a good idea to describe this
> > technique in the ELisp manual.
>
> Will do, once the changes above have arrived.
>
> >> 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.
>
> Later this week. Tomorrow, or on Wednesday, I'll be busy with merging
> shadowfile.el.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#32169
; Package
emacs
.
(Mon, 16 Jul 2018 18:21:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 32169 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Do you want to do it, or shall I? I know, you are overloaded ...
>
> Feel free.
Will do tomorrow.
>> master or emacs-26 branch? I believe threads are not used widely, so we
>> won't break any code with Emacs 26.
>
> That's true, but then no one really waits for those new features, so
> maybe master after all.
OK. Btw, the changes in Tramp were not intended for Emacs 26. Too heavy.
> Thanks.
Best regards, Michael.
Reply sent
to
Michael Albinus <michael.albinus <at> gmx.de>
:
You have taken responsibility.
(Tue, 17 Jul 2018 10:06:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Michael Albinus <michael.albinus <at> gmx.de>
:
bug acknowledged by developer.
(Tue, 17 Jul 2018 10:06:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 32169-done <at> debbugs.gnu.org (full text, mbox):
Version 27.1
Eli Zaretskii <eliz <at> gnu.org> writes:
>> >> > How about having thread-last-error clear the error as a side effect,
>> >> > perhaps when called with an optional argument?
>> >
>> > Should be easy to do, I think.
>>
>> [...]
>>
>> > 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.
>>
>> Do you want to do it, or shall I? I know, you are overloaded ...
>
> Feel free.
Done.
Best regards, Michael.
Added tag(s) fixed.
Request was from
Michael Albinus <michael.albinus <at> gmx.de>
to
control <at> debbugs.gnu.org
.
(Tue, 17 Jul 2018 11:05:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#32169
; Package
emacs
.
(Tue, 17 Jul 2018 15:47:02 GMT)
Full text and
rfc822 format available.
Message #33 received at 32169 <at> debbugs.gnu.org (full text, mbox):
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: 32169-done <at> debbugs.gnu.org
> Date: Tue, 17 Jul 2018 12:05:47 +0200
>
> >> > 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.
> >>
> >> Do you want to do it, or shall I? I know, you are overloaded ...
> >
> > Feel free.
>
> Done.
Thanks.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 15 Aug 2018 11:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 6 years and 312 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.