all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Thorpe <rt@robertthorpeconsulting.com>
To: "Jörg Sommer" <joerg@jo-so.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Why is `(1 . width)` zero?
Date: Tue, 19 Jan 2021 06:53:57 +0000	[thread overview]
Message-ID: <87v9btwh6i.fsf@robertthorpeconsulting.com> (raw)
In-Reply-To: <20210118085113.7rz2pnm2t5sn7y3k@jo-so.de> (message from Jörg Sommer on Mon, 18 Jan 2021 09:51:13 +0100)

Jörg Sommer <joerg@jo-so.de> writes:

> [1:text/plain Hide]
>
> 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"))
> ```

I don't understand your problem.  But I this snippet looks wrong:

>   (- text (,len . width))

You can't do arithmetic on a pair.

BR,
Robert Thorpe



  parent reply	other threads:[~2021-01-19  6:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18  8:51 Why is `(1 . width)` zero? Jörg Sommer
2021-01-18 15:06 ` Robert Pluim
2021-01-18 20:49   ` Michael Heerdegen
2021-01-18 22:23   ` Jörg Sommer
2021-01-19  9:37     ` Jörg Sommer
2021-01-19 10:32       ` Robert Pluim
2021-01-24 10:45       ` Robert Pluim
2021-01-24 14:54         ` Eli Zaretskii
2021-01-19  6:53 ` Robert Thorpe [this message]
2021-01-19  7:59   ` tomas
2021-01-19  9:37     ` Robert Thorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v9btwh6i.fsf@robertthorpeconsulting.com \
    --to=rt@robertthorpeconsulting.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=joerg@jo-so.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.