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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 19 Mar 2025 14:17:55 +0200

> From: Vincenzo Pupillo <[email-masked]>
> Cc: [email-masked]
> Date: Tue, 18 Mar 2025 21:25:02 +0100
> 
> (defvar-local php-ts-mode-alternative-php-program-name nil
>   "An alternative to the usual `php' program name.
> In non-nil, `php-ts-mode--executable' try to find this executable.")
> 
> (defun php-ts-mode--executable ()
>   "Return the absolute filename of the `php' executable.
> If the `default-directory' is remote, search on a remote host, otherwise
> return `php-ts-mode-php-default-executable'.  If
> `php-ts-mode-alternative-php-program-name' is non-nil, finds this program
> instead of the usual `php'."
>   (let ((php-prog
>          (if (file-remote-p default-directory)
>              (executable-find
>               (or php-ts-mode-alternative-php-program-name "php") t)
>            (if php-ts-mode-alternative-php-program-name
>                (executable-find
>                 php-ts-mode-alternative-php-program-name)
>              php-ts-mode-php-default-executable))))
>     php-prog))
> 
> WDYT?

I think this is okay, but let's also ask Michael (CC'ed).

Thanks.