Subject: bug#58307: 29.0.50; Fix battery mode over TRAMP on *BSD

From: Michael Albinus <[email-masked]>
Date: Wed, 05 Oct 2022 22:24:32 +0200

Manuel Giraud <[email-masked]> writes:

> Hi,

Hi Manual,

> I'm using OpenBSD on a laptop.  I'm also using battery-mode.  Whenever,
> I'm accessing another machine over TRAMP, the string displayed by
> battery-mode become useless in this buffer.
>
> The attached patch fixes this issue.  AFAIU, shell-command-to-string is
> using the current directory of the buffer and fails to find a usable
> "/usr/sbin/apm" on a remote Linux, for instance.  So I'm using
> call-process that does call the local "/usr/sbin/apm".

The patch LGTM. There's one point: you have called your helper function
`call-process-to-string'. This looks like a general function, which
moght confuse users. Could you rename it to something like
`battery--call-process-to-string'? Also a comment might be helpful
explaining the problem.

> Best regards,

Best regards, Michael.