From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Operation of format-mode-line Date: Wed, 24 Jul 2024 16:23:05 +0300 Message-ID: <86jzha7wli.fsf@gnu.org> References: <868qxr8qzv.fsf@gnu.org> <86ttgf6mh2.fsf@gnu.org> <86plr36kbb.fsf@gnu.org> <86msm76jl1.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34437"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 24 15:23:51 2024 Return-path: Envelope-to: geh-help-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 1sWbyA-0008o3-SZ for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 24 Jul 2024 15:23:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWbxX-0006Bu-IH; Wed, 24 Jul 2024 09:23:11 -0400 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 1sWbxV-0006BM-17 for help-gnu-emacs@gnu.org; Wed, 24 Jul 2024 09:23:09 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWbxU-0002YU-NG for help-gnu-emacs@gnu.org; Wed, 24 Jul 2024 09:23:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=fSPQzwnnZkld+VjRgLXQmq+ufqIHUCGJrew+yorjpjo=; b=TMSTbhaHQ0Gb 6g3F2Ej/wDKQLZWrhtbTKeuYy6L+CozqFesv4EPvAa22jUsZ/vQoSajj4ljiOSk11nRl6zQOPLJ2Z SIlFRrLwhobBqLoLVe0IRFzDRmMIcr3ns/vzyhMElMWn4rdu7WQZ0b+9vKRNK89Vvq2IDxRIzo3lN kXvyBk1H9TNh4b/DkO8y1pOOOsPy1z8VZEg0R+/8HmkBUEhX/umkKuL2//e6aiquU9jkNVYe5YK+3 H8nPUR3yiQRHPkxu4vZ4Ktvx9a9FKu6DKiKxkYPqEB8bheO42eucblxXdFdchEr+ZpBPs01/5OxeE BfTzIj32vhd4IRmb2H8YmA==; In-Reply-To: (message from Heime on Wed, 24 Jul 2024 13:08:15 +0000) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147339 Archived-At: > Date: Wed, 24 Jul 2024 13:08:15 +0000 > From: Heime > Cc: help-gnu-emacs@gnu.org > > > I meant you don't need to do anything except change the number, > > i.e. replace "12" with "20" (or whatever number you want there). > > How can I do it with elisp code ? I am constructing my own modeline. mode-line-format is a variable, so you can use setq to modify its value. Or you could modify just the value of mode-line-buffer-identification, another variable (which is used to construct the value of mode-line-format), which is where "%12b" comes from. More generally, take a look at lisp/bindings.el, where all the parts of mode-line-format are defined and then used to produce the final value of that variable.