all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* modeline: move battery indicator as provided by (display-battery-mode)
@ 2021-04-27  8:37 Uwe Brauer
  2021-04-27 10:45 ` Philip Kaludercic
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2021-04-27  8:37 UTC (permalink / raw)
  To: help-gnu-emacs


Hi


I have turned on display-battery-mode since the battery of Laptop is a
bit old. However in some buffers, due to the amount of minor-modes that
are turn on, I cannot see the battery indicator. 

I already tried out

(require 'diminish)
(diminish 'abbrev-mode "Abv")
(diminish 'pabbrev-mode "Pabv")
(diminish 'eldoc-mode "ElD")
(diminish 'orglink-mode "OgLk")
(diminish 'flyspell-mode "Fly")


But especially in LaTeX (auctex) mode it does not help. Because the
mayor mode itself has a rather big string.

Can I place the battery indicator say just behind the column/line
indicator?

Thanks

Uwe Brauer 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: modeline: move battery indicator as provided by (display-battery-mode)
  2021-04-27  8:37 modeline: move battery indicator as provided by (display-battery-mode) Uwe Brauer
@ 2021-04-27 10:45 ` Philip Kaludercic
  2021-04-27 11:02   ` Uwe Brauer
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Kaludercic @ 2021-04-27 10:45 UTC (permalink / raw)
  To: help-gnu-emacs

Uwe Brauer <oub@mat.ucm.es> writes:

> Can I place the battery indicator say just behind the column/line
> indicator?

You'd have to customize mode-line-format for that.

This would move all "auxiliary information" before the major mode
indicator:

(setq mode-line-format
      '("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote
	mode-line-frame-identification
	mode-line-buffer-identification "   "
	mode-line-position
	(vc-mode vc-mode) mode-line-misc-info "  "
	mode-line-modes mode-line-end-spaces))

-- 
	Philip K.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: modeline: move battery indicator as provided by (display-battery-mode)
  2021-04-27 10:45 ` Philip Kaludercic
@ 2021-04-27 11:02   ` Uwe Brauer
  2021-04-27 11:36     ` Joost Kremers
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2021-04-27 11:02 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

>>> "PK" == Philip Kaludercic <philipk@posteo.net> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:
>> Can I place the battery indicator say just behind the column/line
>> indicator?

> You'd have to customize mode-line-format for that.

> This would move all "auxiliary information" before the major mode
> indicator:

> (setq mode-line-format
>       '("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote
> 	mode-line-frame-identification
> 	mode-line-buffer-identification "   "
> 	mode-line-position
> 	(vc-mode vc-mode) mode-line-misc-info "  "
> 	mode-line-modes mode-line-end-spaces))

Thanks, I am not entirely sure I understand your setting but I just
copied in my init file and restarted emacs.

However when I open say a LaTeX file, the battery display is sill at the
end of the modeline, and therefore not visible.

I am using a freshly compiled GNU emacs from master (date 25 of April
2021).


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: modeline: move battery indicator as provided by (display-battery-mode)
  2021-04-27 11:02   ` Uwe Brauer
@ 2021-04-27 11:36     ` Joost Kremers
  2021-04-27 11:42       ` Uwe Brauer
  0 siblings, 1 reply; 5+ messages in thread
From: Joost Kremers @ 2021-04-27 11:36 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: help-gnu-emacs


On Tue, Apr 27 2021, Uwe Brauer wrote:
>> (setq mode-line-format
>>       '("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote
>> 	mode-line-frame-identification
>> 	mode-line-buffer-identification "   "
>> 	mode-line-position
>> 	(vc-mode vc-mode) mode-line-misc-info "  "
>> 	mode-line-modes mode-line-end-spaces))
>
> Thanks, I am not entirely sure I understand your setting but I just
> copied in my init file and restarted emacs.
>
> However when I open say a LaTeX file, the battery display is sill at the
> end of the modeline, and therefore not visible.

`mode-line-format` automatically becomes buffer-local when set, so using `setq`
won't set the global value. Try `setq-default`.

The battery info is contained in `mode-line-misc-info`, you can move it around
if the above setting doesn't work for you. Note, though, that
`mode-line-misc-info` may contain more information than just the battery status,
which will get moved around as well. Moving just the battery display would be a
bit more involved.

-- 
Joost Kremers
Life has its moments



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: modeline: move battery indicator as provided by (display-battery-mode)
  2021-04-27 11:36     ` Joost Kremers
@ 2021-04-27 11:42       ` Uwe Brauer
  0 siblings, 0 replies; 5+ messages in thread
From: Uwe Brauer @ 2021-04-27 11:42 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]

>>> "JK" == Joost Kremers <joostkremers@fastmail.fm> writes:

> On Tue, Apr 27 2021, Uwe Brauer wrote:
>>> (setq mode-line-format
>>> '("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote
>>> mode-line-frame-identification
>>> mode-line-buffer-identification "   "
>>> mode-line-position
>>> (vc-mode vc-mode) mode-line-misc-info "  "
>>> mode-line-modes mode-line-end-spaces))
>> 
>> Thanks, I am not entirely sure I understand your setting but I just
>> copied in my init file and restarted emacs.
>> 
>> However when I open say a LaTeX file, the battery display is sill at the
>> end of the modeline, and therefore not visible.

> `mode-line-format` automatically becomes buffer-local when set, so using `setq`
> won't set the global value. Try `setq-default`.


Ok, thanks, I should have checked before asking, sorry

> The battery info is contained in `mode-line-misc-info`, you can move it around
> if the above setting doesn't work for you. Note, though, that
> `mode-line-misc-info` may contain more information than just the battery status,
> which will get moved around as well. Moving just the battery display would be a
> bit more involved.

Well I think the configuration proposed, rather satisfies my needs.
Thanks to both of you

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-27 11:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-27  8:37 modeline: move battery indicator as provided by (display-battery-mode) Uwe Brauer
2021-04-27 10:45 ` Philip Kaludercic
2021-04-27 11:02   ` Uwe Brauer
2021-04-27 11:36     ` Joost Kremers
2021-04-27 11:42       ` Uwe Brauer

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.