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

From: Michael Albinus <[email-masked]>
Date: Wed, 19 Mar 2025 14:14:30 +0100

Eli Zaretskii <[email-masked]> writes:

Hi,

>>   (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).

The following should suffice:

--8<---------------cut here---------------start------------->8---
(or (executable-find
      (or php-ts-mode-alternative-php-program-name "php") t)
    php-ts-mode-php-default-executable)
--8<---------------cut here---------------end--------------->8---

executable-find works also on local default-directory with non-nil
REMOTE. And you don't need the let-clause.

> Thanks.