Subject: Re: bug#78500: Tramp hard to debug

From: Michael Albinus <[email-masked]>
Date: Wed, 21 May 2025 09:20:25 +0200

Daniel Colascione <[email-masked]> writes:

Hi Daniel,

> Tramp uses condition-case extensively for cleanup on error. This
> pattern has the side effect of blocking debugging without adding the
> debug keyword to the condition list. 

Feel free to add the debug keyword where it is helpful.

Note also the comment in tramp-compat.el, section TODO:

;; * Starting with Emacs 30.1, there is `handler-bind'.  Use it
;;   instead of `condition-case' when the origin of an error shall be
;;   kept, for example when the HANDLER propagates the error with
;;   `(signal (car err) (cdr err)'.

I guess handler-bind behaves differently in case of debugging (I didn't
test yet). This should be taken into account.

Best regards, Michael.