help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is `(1 . width)` zero?


From: Jörg Sommer
Subject: Re: Why is `(1 . width)` zero?
Date: Mon, 18 Jan 2021 23:23:26 +0100

Robert Pluim schrieb am Mo 18. Jan, 16:06 (+0100):
> >>>>> On Mon, 18 Jan 2021 09:51:13 +0100, Jörg Sommer <joerg@jo-so.de> said:
> 
>     Jörg> Hi,
>     Jörg> I'm using GNU Emacs 27.1¹ with X and the font DejaVu Sans Mono. I 
> would like
>     Jörg> to align a text on the right side and thought I can use this:
> 
>     Jörg> ```lisp
>     Jörg> (let* ((text " abcd")
>     Jörg>        (len (length text))
>     Jörg>        )
>     Jörg>   (add-text-properties 0 1 `(display (space :align-to (- text (,len 
> . width)))) text)
>     Jörg>   (insert "\n" (format "%S" text) "\n" text "\n"))
>     Jörg> ```
> 
>     Jörg> but it doesn't work. The text is outside the visible space. Similar 
> with a
>     Jörg> text that should be indented:
> 
>     Jörg> ```lisp
>     Jörg> (let ((text " abcd"))
>     Jörg>   (add-text-properties 0 1 `(display (space :width (10 . width))) 
> text)
>     Jörg>   (insert "\n" (format "%S" text) "\n" text "\n"))
>     Jörg> ```
> 
>     Jörg> It shows up in the first column. But in the TUI it works. So, 
> what's wrong
>     Jörg> with `width` in GUI?
> 
> Both of those work fine for me in emacs-27 under X (using DejaVu Sans
> Mono Book). Does it do the same in 'emacs -Q' and in emacs compiled
> from the latest emacs-27 sources?

Thank you Robert for your feedback. I've tried the latest master and it
works fine. Hence, there was something between 27.1 and 8f4b3b812aa. I've
bisect this range and found this commit:

commit d340a979dbbd6150a3af4783cf8b3b65368bbdad (HEAD)
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Wed Oct 7 10:51:35 2020 -0400

    * lisp/doc-view.el: Fix "can't resize root window" error

    (doc-view-fit-window-to-page): Change approach to detect when the
    frame needs to be resized.

I don't see why, but it fixes the problem of width being zero when Emacs is
built with `--with-cairo`. Hence, an update of the Debian package should
bring a working version.


Kind regards Jörg

PS: Please Cc me. I'm not subscribed to the list.


-- 
„Es wurden und werden zu viele sprachlose Bücher gedruckt, nach deren
schon flüchtiger Lektüre man all die Bäume um Vergebung bitten möchte,
die für den Schund ihr Leben lassen mussten.“ (Michael Jürgs,
                      Seichtgebiete – Warum wir hemmungslos verblöden)

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]