Subject: Re: bug#61926: 29.0.60; [PATCH] Make tramp-remote-path behave like exec-path

From: Eli Zaretskii <[email-masked]>
Date: Fri, 03 Mar 2023 09:23:58 +0200

> Cc: [email-masked]
> From: João Távora <[email-masked]>
> Date: Fri, 03 Mar 2023 00:19:50 +0000
> 
> Very few Emacs variables, if any, require a separate command (here M-x
> tramp-cleanup-all-connections) to be issued after the variables value is
> set.  This variable needn't belong to that group.  
> 
> There is a discussion about this caching somewhat deep in the Tramp
> manual.  But I think it would be much nicer if simple things like this
> worked out of the box, allowing users to experiment with value for
> `tramp-remote-path' via M-: (setq ... ) or some other variable-setting
> method, until they get it right.
> 
> Changing this variable's value doesn't alter the remote value of the
> PATH environment variable, much like changing exec-path locally doesn't
> change the local PATH environment variable.

We nowadays have variable-watching feature in Emacs, see
add-variable-watcher.  Could that facility be used in this case to
allow a more elegant solution?