Backport: Make a more robust check in Tramp using scripts

* lisp/net/tramp-sh.el (tramp-find-inline-encoding):
Check, whether scripts in `tramp-remote-coding-commands' are
expandable.

(cherry picked from commit 1d0a60113f)
This commit is contained in:
Michael Albinus 2021-12-07 16:20:13 +01:00
parent ce5bca4913
commit 0a2507ff90

View file

@ -4585,6 +4585,8 @@ Goes through the list `tramp-local-coding-commands' and
(value (symbol-value rem-enc)))
(while (string-match "-" name)
(setq name (replace-match "_" nil t name)))
(unless (tramp-expand-script vec value)
(throw 'wont-work-remote nil))
(tramp-maybe-send-script vec value name)
(setq rem-enc name)))
(tramp-message
@ -4602,6 +4604,8 @@ Goes through the list `tramp-local-coding-commands' and
(value (symbol-value rem-dec)))
(while (string-match "-" name)
(setq name (replace-match "_" nil t name)))
(unless (tramp-expand-script vec value)
(throw 'wont-work-remote nil))
(tramp-maybe-send-script vec value name)
(setq rem-dec name)))
(tramp-message