all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Andreas Schwab <schwab@suse.de>, Eli Zaretskii <eliz@gnu.org>,
	Evgeny Zajcev <lg.zevlg@gmail.com>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: [PATCH] battery.el, upower fixes
Date: Tue, 04 Feb 2020 18:10:58 -0500	[thread overview]
Message-ID: <jwveevaueyg.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ftfq3y7p.fsf@gmx.de> (Michael Albinus's message of "Tue, 04 Feb 2020 21:16:10 +0100")

>>> +(defcustom battery-upower-device
>>> +  (dbus-ignore-errors
>>> +    (battery-upower-device-autodetect :battery))
>>
>> I think there's a possibility that the set of devices changes over time
>> (e.g. on my machine (battery-upower-device-list) currently only shows
>> battery_BAT0, but I can insert a second battery and I'd expect the list
>> to then include a battery_BAT1 as well).  So maybe we should instead
>> allow a special value (e.g. nil) to mean "autodetect" and then do the
>> autodetection dynamically.  WDYT?
>
> Usually, D-Bus services send a signal when a device is added/removed. IIUC
> https://upower.freedesktop.org/docs/UPower.html,
> org.freedesktop.UPower.DeviceAdded and org.freedesktop.UPower.DeviceRemoved
> serve for that purpose. So you shall subscribe to those signals and
> handle them accordingly.

Sure, but you wouldn't want to set a `defcustom` in response to that, so
the `defcustom` should have a separate setting to mean "autodetect".


        Stefan




  reply	other threads:[~2020-02-04 23:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-26 23:04 [PATCH] battery.el, upower fixes Evgeny Zajcev
2020-01-27 14:43 ` Stefan Monnier
2020-01-27 18:23 ` Eli Zaretskii
2020-01-29  7:05   ` Evgeny Zajcev
2020-01-29  8:37     ` Andreas Schwab
2020-01-30 10:22       ` Evgeny Zajcev
2020-02-04 19:55         ` Stefan Monnier
2020-02-04 20:16           ` Michael Albinus
2020-02-04 23:10             ` Stefan Monnier [this message]
2020-06-11 16:12             ` Basil L. Contovounesios
2020-02-05  0:22           ` Evgeny Zajcev
2020-02-05  1:27             ` Stefan Monnier
2020-02-05  2:24               ` Evgeny Zajcev
2020-02-05  3:03                 ` Stefan Monnier
2020-02-06  0:55                   ` Richard Stallman
2020-02-06 18:27                     ` Eli Zaretskii
2020-02-06  7:48                   ` Evgeny Zajcev
2020-02-06 14:18                     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwveevaueyg.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lg.zevlg@gmail.com \
    --cc=michael.albinus@gmx.de \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.