all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Heime via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Gabriel <gabriel376@hotmail.com>
Cc: 59624@debbugs.gnu.org
Subject: bug#59624: Usning global-mode-string for small screens
Date: Tue, 29 Nov 2022 18:52:54 +0000	[thread overview]
Message-ID: <KsVmnS3vLoInlCsV_22lTJV-A8GXE_rJ7kyuRddFKOOM0yjamszEl-J4APAaoFFW9WVfbLSA5LZNKU1INm2We8pvm4ZfdsdrTPiXeoxeADY=@protonmail.com> (raw)
In-Reply-To: <SJ0PR06MB8609CD6CBBB381BEFDA39F338B129@SJ0PR06MB8609.namprd06.prod.outlook.com>


------- Original Message -------
On Tuesday, November 29th, 2022 at 12:34 PM, Gabriel <gabriel376@hotmail.com> wrote:


> Heime via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" bug-gnu-emacs@gnu.org writes:
> 
> > I would need some more assistance to get this to work for me.
> > 
> > When should I update mode-line-format ?
> > 
> > Call it first, followed by (push '("" act) global-mode-string).
> > 
> > Would I have to call (force-mode-line-update) ?
> 
> 
> Emacs is smart enough to know when to update the mode-line. What is
> the exactly problem you are facing? Does the following code do not work
> for you?

Wanted to knew the exoct calling sequence, as you described.

What if a package or made changes the mode-line?  Changing
mode-line-format would not be an option then.  I want to add
a small list to whatever there is.  A suggestion has been to
add a list at the beginning of mode-line-format.

(push '("" act) mode-line-format)

> (progn
> ;; create the `act` variable
> (setq act "Indic")
> 
> ;; add `act` to `global-mode-string`, so it's displayed in the mode-line
> (push '("" act) global-mode-string)
> 
> ;; change position of `global-mode-string` in the mode-line
> (setq-default mode-line-format
> '("%e" mode-line-front-space
> (:propertize ("" mode-line-mule-info mode-line-client
> mode-line-modified mode-line-remote)
> display (min-width (5.0)))
> mode-line-frame-identification mode-line-buffer-identification
> mode-line-misc-info ;; <-- TO HERE
> " " mode-line-position
> (vc-mode vc-mode)
> " " mode-line-modes mode-line-end-spaces))
> 
> ;; you can then update `act' as you want ;; the mode-line will be automatically ;; updated (when Emacs thinks it needs to) ;; the code below will update` act' every 3s
> (run-with-timer 3
> 3
> (lambda ()
> ;; not really needed, but you can force it
> ;;(force-mode-line-update)
> (setq act
> (format"|act=%s|" (current-time-string))))))
> 
> ---
> Gabriel?
>





      reply	other threads:[~2022-11-29 18:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-27  2:51 bug#59624: Usning global-mode-string for small screens Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-27  5:32 ` Gabriel
2022-11-27  6:55   ` Eli Zaretskii
2022-11-27  8:08     ` Gabriel
2022-11-27  8:21       ` Eli Zaretskii
     [not found]       ` <trinity-b12dd0f4-5576-4927-8a9e-9060206c5d28-1669568279229@3c-app-mailcom-bs09>
2022-11-27 17:04         ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-29 12:34           ` Gabriel
2022-11-29 18:52             ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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='KsVmnS3vLoInlCsV_22lTJV-A8GXE_rJ7kyuRddFKOOM0yjamszEl-J4APAaoFFW9WVfbLSA5LZNKU1INm2We8pvm4ZfdsdrTPiXeoxeADY=@protonmail.com' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59624@debbugs.gnu.org \
    --cc=gabriel376@hotmail.com \
    --cc=heimeborgia@protonmail.com \
    /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.