From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pedro Andres Aranda Gutierrez Newsgroups: gmane.emacs.bugs Subject: bug#52447: 29.0.50; New mode-line breaks calculations for last element in my mode-line Date: Sun, 12 Dec 2021 18:58:48 +0100 Message-ID: References: <83bl1mp549.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d724d705d2f6b63c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18867"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52447@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 12 19:00:12 2021 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 1mwT8t-0004jJ-83 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Dec 2021 19:00:11 +0100 Original-Received: from localhost ([::1]:36254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwT8s-0002Ww-3W for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Dec 2021 13:00:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwT8k-0002Wn-HK for bug-gnu-emacs@gnu.org; Sun, 12 Dec 2021 13:00:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41490) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwT8k-0001M0-7f for bug-gnu-emacs@gnu.org; Sun, 12 Dec 2021 13:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mwT8k-0002vd-6X for bug-gnu-emacs@gnu.org; Sun, 12 Dec 2021 13:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pedro Andres Aranda Gutierrez Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Dec 2021 18:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52447 X-GNU-PR-Package: emacs Original-Received: via spool by 52447-submit@debbugs.gnu.org id=B52447.163933196311182 (code B ref 52447); Sun, 12 Dec 2021 18:00:02 +0000 Original-Received: (at 52447) by debbugs.gnu.org; 12 Dec 2021 17:59:23 +0000 Original-Received: from localhost ([127.0.0.1]:53036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwT86-0002uH-PI for submit@debbugs.gnu.org; Sun, 12 Dec 2021 12:59:23 -0500 Original-Received: from mail-ed1-f48.google.com ([209.85.208.48]:44744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwT85-0002u5-6Q for 52447@debbugs.gnu.org; Sun, 12 Dec 2021 12:59:21 -0500 Original-Received: by mail-ed1-f48.google.com with SMTP id l25so45708918eda.11 for <52447@debbugs.gnu.org>; Sun, 12 Dec 2021 09:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vF4p9bdubFa/hJfPfAWwgYAKf2LR11ZSM9/GacG4DKQ=; b=HwNiJ2c4qxv9tl8V25Xya0I7ozj3QIQ/uu5Y9nLWLjdAYNRvdAZHUe20ODquISj1IJ fJ5ywZvAsW6gUb/irYCruJ2sdtECxSEybPLcPaOR5KJXKeshJAu5EqpNVlW41qfBtiwG Wu62x33oFTwXNC2TsnEgV/q/BLYN3SxtFMYOyI6mM9EPOWElv0/Jzbuujmzj1xcmy9a7 HMAQSKgENHu3FNnvGS8IrpxyDyRoYz1Gd5rPDF01wtllyidrZPUR5kzUfxTk9IHn/m5z J/OCFe0UKJBRciClwbr3vc1PZHWTvPU3fkOy/3lMb/zIO7JAZgTs7pG8EJBnasDaiIsp JIXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vF4p9bdubFa/hJfPfAWwgYAKf2LR11ZSM9/GacG4DKQ=; b=pj+lJnbsgIkfmQJ3HCKHiNnSVosYF4hKV9kefPP9GwXuI6nNNl4FD5AVDNtgECfO7g gM65tvbdowDWSTaGepAZdS3OGQHq3A22KTPGOLV9sYSmOps3/W1RsD7z72Cnsgum3psw RSM6FTfvMAtqxmOny8vnmyT8Rt9ZbmaTwXgVfB5a4FORd5LgBt8vVv5IIMUh4kUuinnV 9DfThmV0VWByxlaoG1v0sHqD3O1Bukp5MKeTYJc2xnYCWPKBiaL6jdIBy6JcZiqihhAS GatBEQte5KqVDEb2BicwS7e7ackYY90WROdIcjDK2q2sdw+AJOISXYhj/jWaNzWjS78u dXFA== X-Gm-Message-State: AOAM532AQrOzgMYEkIVWtv2ds4+/alneVNf9d95EWsxkH8uwK9jpasWK ljI+ife3hiYkd9qm/4FHRlimJgKMX2CHBbiGFBR3pNGC X-Google-Smtp-Source: ABdhPJwOJbADC/Dc8Q6FtuJbtTY29HG0qhLrXs8TEAPEJ3Q3CZN74OAvt7wcXl/vjCBx4ROrLXKGQTR5Z91dOsnBQ+Y= X-Received: by 2002:a17:906:5d0b:: with SMTP id g11mr39085837ejt.381.1639331954892; Sun, 12 Dec 2021 09:59:14 -0800 (PST) In-Reply-To: <83bl1mp549.fsf@gnu.org> 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" Xref: news.gmane.io gmane.emacs.bugs:222241 Archived-At: --000000000000d724d705d2f6b63c Content-Type: text/plain; charset="UTF-8" Hi Eli, Doesn't this mean that there will be a 'bug' in emacs28 ;-) Just kidding... thanks a lot for the analysis. It was code I found time ago and I had really forgotten how it worked (or didn't work). Now that I(you) have fixed it for fixed-pitch I don't think I'm prepared for a variable pitch font in the mode line yet. I still find it ugly. Best, /PA On Sun, 12 Dec 2021 at 10:03, Eli Zaretskii wrote: > > From: Pedro Andres Aranda Gutierrez > > Date: Sun, 12 Dec 2021 08:17:28 +0100 > > > > I'm using the attached code for my mode-line. It's inspired by the doom > mode-line. My last element is > > right-aligned and shows GIT information when relevant. On emacs < 29, > the calculation for the free space > > avoids overlapping with the fringe: > > emacs28-modeline.png > > > > On emacs29, with fixed font using the fix from etc/NEWS, the fringe > overlaps with the vc information. > > emacs29-broken-modeline.png > > Your code says: > > (defun fill-spaces (len) > `((space :align-to (- (+ right right-fringe right-margin) ,len)))) > > This tells Emacs to right-align the string to the place _after_ the > margin and the fringe. If I remove the addition of right-fringe and > right-margin from the :align-to expression, the effect is like you > want. > > So it sounds like Emacs 28 and before had some bug in this area which > was fixed in Emacs 29, and your code needs to adapt by removing the > "fix" you had in previous Emacs versions. > > > Not to speak variable pitch, where I only see the first 1.5 letters or > so (depending on the branch I'm in) > > For variable-pitch font, you need to calculate this in pixels, not in > columns. > -- Fragen sind nicht da um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler --000000000000d724d705d2f6b63c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Eli,

Doesn't this mea= n that there will be a 'bug' in emacs28 ;-) Just kidding... thanks = a lot for the analysis.
It was code I found time ago and I h= ad really forgotten how it worked (or didn't work).
Now that = I(you) have fixed it for fixed-pitch I don't think I'm prepared for= a variable pitch font in the mode line yet. I still find it ugly.

Best, /PA

On Sun, 12 Dec 2021 at 10:03, Eli Zaret= skii <eliz@gnu.org> wrote:
> From: Pedro Andre= s Aranda Gutierrez <paaguti@gmail.com>
> Date: Sun, 12 Dec 2021 08:17:28 +0100
>
> I'm using the attached code for my mode-line. It's inspired by= the doom mode-line. My last element is
> right-aligned and shows GIT information when relevant. On emacs < 2= 9, the calculation for the free space
> avoids overlapping with the fringe:
> emacs28-modeline.png
>
> On emacs29, with fixed font using the fix from etc/NEWS, the fringe ov= erlaps with the vc information.
> emacs29-broken-modeline.png

Your code says:

=C2=A0 (defun fill-spaces (len)
=C2=A0 =C2=A0 `((space :align-to (- (+ right right-fringe right-margin) ,le= n))))

This tells Emacs to right-align the string to the place _after_ the
margin and the fringe.=C2=A0 If I remove the addition of right-fringe and right-margin from the :align-to expression, the effect is like you
want.

So it sounds like Emacs 28 and before had some bug in this area which
was fixed in Emacs 29, and your code needs to adapt by removing the
"fix" you had in previous Emacs versions.

> Not to speak variable pitch, where I only see the first 1.5 letters or= so (depending on the branch I'm in)

For variable-pitch font, you need to calculate this in pixels, not in
columns.


--
Fragen sin= d nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu= werden
Georg Kreisler
--000000000000d724d705d2f6b63c--