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.devel Subject: Re: min-width display property, but with padding at the start Date: Tue, 20 Aug 2024 14:59:51 +0300 Message-ID: <86ikvvwgjs.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="541"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 20 14:01:20 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sgNY8-000AVX-Fo for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Aug 2024 14:01:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgNXP-00048P-44; Tue, 20 Aug 2024 08:00:35 -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 1sgNXI-00047b-H9 for emacs-devel@gnu.org; Tue, 20 Aug 2024 08:00:28 -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 1sgNXH-0002Ei-Gz; Tue, 20 Aug 2024 08:00:27 -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=s306zWd1ccUesdOliVgknZWZlSyEjiXnqTdsyaEbeus=; b=Ift5Y+nlgVME GhcG3NBiIL4GrvF+zFuhuqv6QiDbztsiNEoteczGO0ThvWrRPdtQy2eFjZUepPqsK82uf/y9MYkBl /j2ZTfxKMzfzZ6J0TdtAO8iZyIaYUMNFny8MMaP2ynr9jkE/xc7Op071YSD4OeLK9foU40mNf4S5z qDmNOjDiJfUflMME+YPiqbroW1q6QKzBV5CGlkdFE/cyQ0TFFY2xfn/GvN/PKCT16FovT5rpU9nGP IWx6P0x9pKecWkFQvWgGO4MyQheCfO384zZPyQYRKSPWI4luG3/7ngRWCMqA3b9NDBYFICmT3PgxA e5MsZQPCBkXPZCw4LFKAXQ==; In-Reply-To: (message from Spencer Baugh on Mon, 19 Aug 2024 16:53:58 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322958 Archived-At: > From: Spencer Baugh > Date: Mon, 19 Aug 2024 16:53:58 -0400 > > > I'm writing a mode which adds an entry to the mode-line containing a > number. This number can rapidly grow or shrink (it's a number of build > targets left to build, for a build system like Bazel) so I would like to > pad it to a specified width, to avoid the mode-line jittering around as > the number changes. > > Adding a `display' property with the value '(min-width (5.0)) works > fine. > > However, min-width pads by adding padding at the end. I'd like to add > padding at the start instead. > > Is there a way to achieve this with display properties? Why do you need display properties? What's wrong with (format "%5s" THE-STRING) ?