[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Why is `(1 . width)` zero?
From: |
Jörg Sommer |
Subject: |
Why is `(1 . width)` zero? |
Date: |
Mon, 18 Jan 2021 09:51:13 +0100 |
Hi,
I'm using GNU Emacs 27.1¹ with X and the font DejaVu Sans Mono. I would like
to align a text on the right side and thought I can use this:
```lisp
(let* ((text " abcd")
(len (length text))
)
(add-text-properties 0 1 `(display (space :align-to (- text (,len . width))))
text)
(insert "\n" (format "%S" text) "\n" text "\n"))
```
but it doesn't work. The text is outside the visible space. Similar with a
text that should be indented:
```lisp
(let ((text " abcd"))
(add-text-properties 0 1 `(display (space :width (10 . width))) text)
(insert "\n" (format "%S" text) "\n" text "\n"))
```
It shows up in the first column. But in the TUI it works. So, what's wrong
with `width` in GUI?
My main goal is to place a text on the right side that the user might scale
down with face attributes:
```lisp
(set-face-attribute 'lsp-ui-sideline-global nil :height 0.5)
(let* ((text " abcd")
(len (length text))
)
(add-text-properties 0 len '(font-lock-face (error lsp-ui-sideline-global))
text)
(add-text-properties 0 1 `(display (space :align-to (- text (,len . width))))
text)
(insert "\n" (format "%S" text) "\n" text "\n"))
```
Are there any other ways to get this?
Kind regards
Jörg
¹ build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0
of 2020-11-08, modified by Debian
--
> Definiere ‚Demokratie‘ …
… eine Mehrheit beweist einer Minderheit, dass Widerstand zwecklos ist.
signature.asc
Description: PGP signature
- Why is `(1 . width)` zero?,
Jörg Sommer <=
Re: Why is `(1 . width)` zero?, Robert Thorpe, 2021/01/19