From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Allen Li Newsgroups: gmane.emacs.bugs Subject: bug#30056: 25.3; battery-mode-line-string missing leading space Date: Tue, 11 Aug 2020 01:40:40 -0700 Message-ID: <80ft8t8tiv.fsf@felesatra.moe> References: <83fu7d68bf.fsf@gnu.org> <834lnt5ybx.fsf@gnu.org> <83mv1k4cd1.fsf@gnu.org> <87tuxa39c7.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15377"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Glenn Morris , 30056@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 11 10:41:08 2020 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 1k5PqG-0003vb-Kp for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Aug 2020 10:41:08 +0200 Original-Received: from localhost ([::1]:56018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5PqF-0004MY-Nu for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Aug 2020 04:41:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5PqA-0004MN-C3 for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2020 04:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55290) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5PqA-0003UF-2t for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2020 04:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k5PqA-000204-0V for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2020 04:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Aug 2020 08:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30056 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 30056-submit@debbugs.gnu.org id=B30056.15971352497663 (code B ref 30056); Tue, 11 Aug 2020 08:41:01 +0000 Original-Received: (at 30056) by debbugs.gnu.org; 11 Aug 2020 08:40:49 +0000 Original-Received: from localhost ([127.0.0.1]:38603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5Ppx-0001zX-EL for submit@debbugs.gnu.org; Tue, 11 Aug 2020 04:40:49 -0400 Original-Received: from mail-pj1-f43.google.com ([209.85.216.43]:40287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5Ppw-0001zL-Ii for 30056@debbugs.gnu.org; Tue, 11 Aug 2020 04:40:49 -0400 Original-Received: by mail-pj1-f43.google.com with SMTP id d4so1492550pjx.5 for <30056@debbugs.gnu.org>; Tue, 11 Aug 2020 01:40:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2xpaSZ5DfYoIl9xsbqRsHcdn9OJY3iRVfFnrZWR4WCQ=; b=VuWX8Ql9SWx4xuZAMXV9lpk4V36hIUY53KHpwxoa2nm6dfigsMW7j8gQJysXGR/j6+ VjmVNEjmaUR5lJilvbZ5HenGkTesvBze5bV460hZa1dEcF/BJCYDVag7WloOoh4IpoBj gX73C7EQZEARGjLUrb36lcGzveVUcRQEtbMiA8dxiI3kH7f5GTMgV9AvtJx/J6CgjVzl YM3wNrJb3G5cOzqKzAwDNaxnC+cn50uNkLe4LL3nlUZS4DcwhFI2xJfSRqlqMhSCW2vl zbuuaiO002pDeP2HQD4gUzZMi4BItTfPNAb9PJ5iF5b9Ffdurk9JRRoLFUxVfAW3GMil XWHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=2xpaSZ5DfYoIl9xsbqRsHcdn9OJY3iRVfFnrZWR4WCQ=; b=V0TS8OH6YtDicpEsu46wLkzdg+MIaL45hJFpHEKF6Uu14Livj5xwGwVtklP0+GfnTV 9t8nlfMkAgXOxYHg9RKh7yl//V3vh6c0+ksF8A1WTm+/gCXvX1Lm7YFkWrgRntcnNm/H WdTLVaKWKZl7+O2HhFWSkDvhV9fF1bQ+MyG8qTaDsOr6LTFVtrYUG6hhU8Jvxri3klqS pgic1rsqs0sTyEvhixV1IyTsKERMMrlEAYKPk8QYe6Lk+lEyanGhgE9KGZDBmzk99iol SHEeKlFupur7yzQJ50Ey/qaiXSmPNAVZtCHilSo01X4I+4kVl4o6iNAvFvBdmc8TnJSX vSig== X-Gm-Message-State: AOAM530m4iLcD63Fw4UZUCojYEveHSZNcOd1I52JdrfigYqM1km2OA9o m92K/nRKLV6rB/N1yO6MELZmZg== X-Google-Smtp-Source: ABdhPJyBf4DjXD2RqQBd0+qG+V5LNsETfSNWGiD3pNV4ws1H5d3/4dqKckiAwnB70Y98AP0Ma5NZtw== X-Received: by 2002:a17:902:b681:: with SMTP id c1mr28412334pls.214.1597135242372; Tue, 11 Aug 2020 01:40:42 -0700 (PDT) Original-Received: from localhost ([2600:1700:7270:7d1f:fa59:71ff:fe00:10cc]) by smtp.gmail.com with ESMTPSA id y4sm24657088pff.44.2020.08.11.01.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2020 01:40:41 -0700 (PDT) In-Reply-To: <87tuxa39c7.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 10 Aug 2020 15:43:20 +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:184630 Archived-At: Lars Ingebrigtsen writes: > Allen Li writes: > >> The cause of this odd behavior is that display-battery-mode appends >> and removes its symbol in global-mode-string when it is toggled on or >> off, while display-time-mode only appends its symbol and does not >> remove it when it is toggled off. The reason display-battery-mode >> comes first after Emacs starts is because of how the custom file >> works; user options are sorted alphabetically and display-battery-mode >> comes first, so it is appended first. >> >> Naturally, this has some implications for whether each display uses >> leading, trailing, or no space. > > Indeed. Just a random idea: Would it make sense to add a mode line > construct like "%S" to mode-line-format that means "put a space here if > there isn't one already"? Then battery could put "%S into the list? > > Would that work? I find that idea intriguing. It would work, and it's a useful feature to have as an Emacs Lisp developer, because it provide a robust solution to the problem of "I want to have a space separation in the mode line, but I don't know what comes before/after me". Although personally, I feel a little dirty adding a new %-construct just for this.