From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59624: Usning global-mode-string for small screens Date: Tue, 29 Nov 2022 18:52:54 +0000 Message-ID: References: <83cz98rinu.fsf@gnu.org> <3bI1k2w5XP5Y_SoTIgj8-GTCQpU_b4cANqx7wYJrpCzXP2JpApSbuCBwjZsyZ3ctxmq_aXW_HqPkDhfL7T7QpICNihlDn14NTWpQAeFK_iQ=@protonmail.com> Reply-To: Heime Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19896"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59624@debbugs.gnu.org To: Gabriel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 29 19:54:12 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 1p05kC-0004vP-8Q for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Nov 2022 19:54:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p05k4-0001VI-GF; Tue, 29 Nov 2022 13:54:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p05k2-0001Uj-O1 for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 13:54:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p05k2-0005q8-FS for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 13:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p05k2-0005cn-Bl for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 13:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Heime Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Nov 2022 18:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59624 X-GNU-PR-Package: emacs Original-Received: via spool by 59624-submit@debbugs.gnu.org id=B59624.166974800121613 (code B ref 59624); Tue, 29 Nov 2022 18:54:02 +0000 Original-Received: (at 59624) by debbugs.gnu.org; 29 Nov 2022 18:53:21 +0000 Original-Received: from localhost ([127.0.0.1]:55679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p05jM-0005cX-M9 for submit@debbugs.gnu.org; Tue, 29 Nov 2022 13:53:21 -0500 Original-Received: from mail-4319.protonmail.ch ([185.70.43.19]:27557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p05jA-0005cR-P6 for 59624@debbugs.gnu.org; Tue, 29 Nov 2022 13:53:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1669747982; x=1670007182; bh=vd3uQdQY0yMB7uPHgaN7S+ICcL4sESAuywzLtfqcrzQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Ghxr5POf9YjqEQVWB7XU7gC1ByO77U4AAbdIdAafVaq9OUdB1DDHV14daSpBcMEgI J5CRZ40M4hXcXUXZ34tyXkrg4ik7MgDwqXjkB2TEKMdVJgq8g7HP27kNhuG1X5xPXd Pw71cEqiiHRD/VyESqX3hdHccKW/iDE9npLw2zO6wJtt7PJjEJtoUUdhOwxVqtKSIF j9NT1QXGayzBrgyhW0ldRRFcJe435pzK1UB/GxSZb/lenPtXLXKMtGHjV36ai4r0jG mjP5Oeu7hUSE1diiLKvQfwz+jlRf6w1duWr/gresbjGBhrjZz5SGW6a7kbS56hrn29 yEd8JKAeYbH5g== In-Reply-To: Feedback-ID: 57735886:user:proton 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249425 Archived-At: ------- Original Message ------- On Tuesday, November 29th, 2022 at 12:34 PM, Gabriel wrote: > Heime via "Bug reports for GNU Emacs, the Swiss army knife of text > editors" bug-gnu-emacs@gnu.org writes: >=20 > > I would need some more assistance to get this to work for me. > >=20 > > When should I update mode-line-format ? > >=20 > > Call it first, followed by (push '("" act) global-mode-string). > >=20 > > Would I have to call (force-mode-line-update) ? >=20 >=20 > 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") >=20 > ;; add `act` to `global-mode-string`, so it's displayed in the mode-line > (push '("" act) global-mode-string) >=20 > ;; 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)) >=20 > ;; you can then update `act' as you want ;; the mode-line will be automat= ically ;; updated (when Emacs thinks it needs to) ;; the code below will up= date` 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=3D%s|" (current-time-string)))))) >=20 > --- > Gabriel? >