From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.bugs Subject: bug#58307: 29.0.50; Fix battery mode over TRAMP on *BSD Date: Thu, 06 Oct 2022 16:34:46 +0200 Message-ID: <878rlt58c9.fsf@elite.giraud> References: <87ilkyfhlo.fsf@elite.giraud> <87ilkxl62a.fsf@elite.giraud> <87k05dxgoi.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32524"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Stefan Kangas , 58307@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 06 16:35:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogRy1-0008CC-B0 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Oct 2022 16:35:17 +0200 Original-Received: from localhost ([::1]:35972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogRxz-000334-Fr for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Oct 2022 10:35:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogRxn-0002yT-5M for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 10:35:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34028) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogRxm-0007EY-QY for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 10:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogRxm-0007fJ-Ms for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 10:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Oct 2022 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58307 X-GNU-PR-Package: emacs Original-Received: via spool by 58307-submit@debbugs.gnu.org id=B58307.166506689329432 (code B ref 58307); Thu, 06 Oct 2022 14:35:02 +0000 Original-Received: (at 58307) by debbugs.gnu.org; 6 Oct 2022 14:34:53 +0000 Original-Received: from localhost ([127.0.0.1]:33103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogRxc-0007ec-JF for submit@debbugs.gnu.org; Thu, 06 Oct 2022 10:34:52 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:48733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogRxa-0007eN-8k for 58307@debbugs.gnu.org; Thu, 06 Oct 2022 10:34:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=hQ5s9CYv5rVcPheX 4FXBUtcXpOEm+d27sT3rTWxsGLI=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=sSzM1BjOlNYeRaSy4NAjw2HsbvDKGRE2lzUeX1 GSiuzWUDodWt6p0dp8958KploZsD6xm3YKiHs4OUb8cqxvIah9pmFpmxEJAKJ4Jha5CGdu CmmxfDrQZK9/4ST03e+MKz1xQ5LOhQWAth4l4BsWbw5UxQCky0hE2ADonG2B/GTAydE+53 sXsjxXr4ZY3O34exqAkXXm85+xx3cINax3RMfYMbQREfW27gX+N+9/6nPD8qHtR9+oGXFG LJcORv6RWMePtPMWWxZECNb1aaU79DMz3fnPsfh8P/WCcjmxCVDuamdFB+D/eoSskYMjUV SsObAe2/uauV95dQ5gQRmRLQ== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 69957180 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 6 Oct 2022 16:34:47 +0200 (CEST) In-Reply-To: <87k05dxgoi.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 06 Oct 2022 14:47:09 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244673 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Manuel Giraud writes: > >> Thank you Stefan and Michael! >> >> Here is an updated version. My wording in the comment might not be >> correct. Best regards. > > Thanks; pushed to Emacs 29 (with some whitespace changes to get the > line length under 80). Thanks. And here is an update on top of it with the suggestion of Stefan Monnier on the list. FWIW, it still works for me. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-battery.el-battery-bsd-apm-No-need-for-executab.patch >From dbf45fa6677dc6ac71988db39afa54f3527a48b3 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Thu, 6 Oct 2022 16:03:34 +0200 Subject: [PATCH] ; * lisp/battery.el (battery-bsd-apm): No need for `executable-find'. --- lisp/battery.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/battery.el b/lisp/battery.el index a874f0640e..8de80109c6 100644 --- a/lisp/battery.el +++ b/lisp/battery.el @@ -938,16 +938,14 @@ battery-bsd-apm %t Remaining time (to charge or discharge) in the form `h:min'" (let* ((os-name (car (split-string ;; FIXME: Can't we use something like `system-type'? - (battery--call-process-to-string - (executable-find "uname"))))) + (battery--call-process-to-string "uname")))) (apm-flag (pcase os-name ("OpenBSD" "mP") ("FreeBSD" "st") (_ "ms"))) (apm-args (concat "-abl" apm-flag)) (apm-output (split-string - (battery--call-process-to-string - (executable-find "apm") apm-args))) + (battery--call-process-to-string "apm" apm-args))) (indices (pcase os-name ;; FreeBSD's manpage documents that multiple ;; outputs are ordered by "the order in which -- 2.37.3 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--