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

From: Vincenzo Pupillo <[email-masked]>
Date: Sun, 16 Mar 2025 23:01:59 +0100

Ciao Micheal, 
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?

Vincenzo

In data domenica 16 marzo 2025 09:34:09 Ora standard dell’Europa centrale, 
Michael Albinus ha scritto:
> Morgan Willcock <[email-masked]> writes:
> 
> Hi,
> 
> > That said, I do not claim to be TRAMP expert, I just use it.  A TRAMP
> > maintainer is probably better positioned to clarify the preferable way
> > to configure paths to executables so they work locally and remotely.
> 
> Tramp recommends to use (executable-find "php" 'remote) . This requires
> to set a proper PATH on the remote side. Experience tells, that likely,
> you will run into further problems if you haven't set the remote (and
> local) PATH accordingly.
> 
> Users might apply hard-coded values, like "/exotic/path/php" or
> "php". This is what connection-local variables are good for.
> 
> But a package should offer the proper way of setting.
> 
> Best regards, Michael.