From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Operation of format-mode-line Date: Fri, 26 Jul 2024 21:40:09 +0700 Message-ID: References: <87frrxjpx8.fsf@web.de> <87ttgco01g.fsf@web.de> <875xss2siz.fsf@web.de> 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="9360"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Heerdegen , help-gnu-emacs@gnu.org To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 26 16:41:04 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 1sXM80-0002Gn-26 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Jul 2024 16:41:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXM7M-0004lh-QZ; Fri, 26 Jul 2024 10:40:24 -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 1sXM7L-0004lX-S2 for help-gnu-emacs@gnu.org; Fri, 26 Jul 2024 10:40:23 -0400 Original-Received: from mail-vs1-xe36.google.com ([2607:f8b0:4864:20::e36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sXM7K-0000D7-9u for help-gnu-emacs@gnu.org; Fri, 26 Jul 2024 10:40:23 -0400 Original-Received: by mail-vs1-xe36.google.com with SMTP id ada2fe7eead31-4929540f38dso708990137.2 for ; Fri, 26 Jul 2024 07:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722004821; x=1722609621; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dhcDQce8plmY7OeGsyVRFTxJZRF3YmRgIsDf0IslUBg=; b=ZvpJai0QPM0LD2Phqb3FbTYpOcqA0xWD/IlvjREya89PFUMm73EvgrjCMZ+E/Kllq8 O+R9V8sx2O+eJtOooS8bGpr2Br2uIoPask/OJz01GNtqODDQRTQQ+F8G4t/hCyHX38IA fdlJGTifpbG3z/Oaj+N2lPiTmw76cT/6RXNqWI6ox2A4mF7DyUHuFSLO1yvVHhsaT98E 6OcadeebD8Q8roe2mNB5Nnqm1ca0yVrEBSb+KQ/H0VEevoY65AchyTScffh/y4oC57Kk 6ty2sW8iTNUzrCVv0GgbhBbJbnL0lgumT9+fdeYYYj5rC6SBV9W541EVUyILxDjmEzQu +03w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722004821; x=1722609621; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dhcDQce8plmY7OeGsyVRFTxJZRF3YmRgIsDf0IslUBg=; b=J3nOXb4d1w45qSUtUrb4/Ky8U/m/oIi3skW30JCbC6HCZRw5l5N7OShjsTW51ZmcEF EZeXKbPrZwmArapSgXyG6qyZrSPmSa+8nbVfAK0k0eEv0AroMhEFfvYyplGVietzRzqN 4nWR1Cvbk6P4jQXA4mWFltCeRQGNKUkT/xJEPAXtL8FoGTNkii4+wAhWOS1C41feRZsX 7Bu7WasSwPj9KmQfZuTGBp4HdRoNa5wyv1gDPHElR1EpFIlVgQ/3LEYc1uibg7ip5lah kT8xlJW35uemES0yJwJ/ioUBJ4r0pAZaZZ7pTMUiULwmU+jcNug3S6BBBmp+UY85PIsU 6/aw== X-Forwarded-Encrypted: i=1; AJvYcCVg6osmTSNdbD4HW3RLpP3WxVZHMiUM8hlmOZHrZ5J+pQBFVXawgFAgmL8wwmdo7dpNtrhxwv4VDr57xxk6BVf7u0mQlPl2 X-Gm-Message-State: AOJu0YxhXlUIwCSVTtrdc/oEjLlQv8+j2kPZ3HAkVYf2fHiyhnPzIb5E SEeQ/DZVwAtxQkU9ZmKiGwtP/q/c9gzkg2DygcelFgk+4822d4L0j0yhIDcmYZSfI9ub5/42gtm m3Jpz1zXPUewX8MW3clRnHRwUmhU= X-Google-Smtp-Source: AGHT+IEcmne8LB5dDkiRcCjkXKRjHdflkMhAE7ZaEWUs/KTR+360/E48ILNh0BfLpZDx5sEZaSGJn59jiN5+DZAgU0I= X-Received: by 2002:a05:6102:33c7:b0:493:d3ec:76e5 with SMTP id ada2fe7eead31-493d6471e94mr5474061137.18.1722004820704; Fri, 26 Jul 2024 07:40:20 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e36; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:147384 Archived-At: On Fri, 26 Jul 2024 at 21:19, Heime wrote: > > | =E2=80=98(WIDTH REST...)=E2=80=99 > > | A list whose first element is an integer specifies truncation or > > | padding of the results of REST. The remaining elements REST are > > | processed recursively as mode line constructs and concatenated > > | together. When WIDTH is positive, the result is space filled on > > | the right if its width is less than WIDTH. When WIDTH is negative, > > | the result is truncated on the right to =E2=88=92WIDTH columns if its= width > > | exceeds =E2=88=92WIDTH. > > For case of (WIDTH REST...), what do I have to do exactly ? Have you read the explanation about positive and negative WIDTHs above? > Certainly not this way > > (setq-default mode-line-buffer-identification > (list 8 > (propertized-buffer-identification (format "%%%db" width)))) This seems to work for me: (setq-default mode-line-buffer-identification (list -8 (propertized-buffer-identification "%b"))) -8 specifies truncation to 8 characters. And we don=E2=80=99t need to pad i= f we=E2=80=99re going to truncate anyway. (8 is way too small for a buffer name though.)