Subject: bug#76955: 30.1; php-ts-mode-php-executable default path may not match remote path

From: Vincenzo Pupillo <[email-masked]>
Date: Mon, 17 Mar 2025 10:25:36 +0100

Ok, thank you Michael.

V.

In data lunedì 17 marzo 2025 09:06:40 Ora standard dell’Europa centrale, 
Michael Albinus ha scritto:
> Vincenzo Pupillo <[email-masked]> writes:
> > Ciao Micheal,
> 
> Hi Vincenzo,
> 
> > I wrote this function based on what you wrote in your last email and what
> > I
> > read in the TRAMP documentation:
> > 
> > (defun php-ts-mode--executable-find ()
> > 
> >   (let ((php-prog
> >   
> > 	 (if (file-remote-p default-directory)
> > 	 
> > 	     (let* ((remote-path (when (boundp 'tramp-remote-path)
> > 				
> > 				tramp-remote-path))
> > 				
> > 		    (own-path (when (boundp 'tramp-own-remote-path)
> > 				
> > 				tramp-own-remote-path))
> > 				
> > 		    (exec-path (delete-dups
> > 					
> > 					(append remote-path own-path exec-path))))
> > 					
> > 	       (executable-find "php" t))
> > 	       
> >            php-ts-mode-php-executable)))
> >     
> >     php-prog))
> > 
> > Does this function make any sense?
> 
> No. Tramp doesn't use exec-path when it runs executable-find
> remotely. tramp-own-remote-path is just a symbol, it doesn't carry any
> value. Changes in remote path must be applied prior establishing a
> remote connection. Etc pp ...
> 
> Pls call just (executable-find "php" t) in your package, this works
> properly also for local default directory. Arranging for a proper
> (remote) PATH is the duty of the user.
> 
> > Vincenzo
> 
> Best regards, Michael.