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

From: Morgan Willcock <[email-masked]>
Date: Tue, 18 Mar 2025 16:00:57 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: Morgan Willcock <[email-masked]>
>> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
>> Date: Mon, 17 Mar 2025 22:30:03 +0000
>> 
>> Vincenzo Pupillo <[email-masked]> writes:
>> 
>> > Ciao Eli, this is the new patch.
>> 
>> Hi Vincenzo,
>> 
>> The php binaries which I use are installed with pkgsrc, which supports
>> installing multiple versions of PHP, installed as bin/php${PHP_VERSION}.
>> One of those versions would be available as bin/php.
>> 
>> If I have two remote versions installed, and one of them is found by
>> executable-find searching for "php", I cannot see how I would select the
>> other version once the patch is applied.
>
> How do you do this with the current version of php-ts-mode?

Since the value of php-ts-mode-php-executable is used locally and
remotely, I just set the buffer local value to the correct name.

  (connection-local-set-profile-variables
   'with-php84
   '((php-ts-mode-php-executable . "php84")))

  (connection-local-set-profiles
   '(:application tramp :machine "remotename")
   'with-php84)

>> Shouldn't the search name "php" be configurable to allow the name to be
>> overridden?  Something like this:
>> 
>>   (executable-find php-program t)
>> 
>> where php-program defaults to being "php".
>
> It's possible to add this, but it would be a separate feature.

The variable php-ts-mode-php-executable is effectively already providing
this feature, but the suggested change appears to remove it.

-- 
Morgan Willcock