From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?SsO2cmc=?= Sommer Newsgroups: gmane.emacs.help Subject: Re: Why is `(1 . width)` zero? Date: Tue, 19 Jan 2021 10:37:24 +0100 Message-ID: <20210119093724.w3qfdrxamvlaoomh@jo-so.de> References: <20210118085113.7rz2pnm2t5sn7y3k@jo-so.de> <877doawahr.fsf@gmail.com> <20210118222326.mm24cg3bzgr4m74q@jo-so.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jroffv5xvsvog2mz" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22139"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 19 10:38:51 2021 Return-path: Envelope-to: geh-help-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 1l1nTO-0005gX-8y for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 19 Jan 2021 10:38:50 +0100 Original-Received: from localhost ([::1]:38676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1nTN-000550-BE for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 19 Jan 2021 04:38:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1nSQ-0004uR-Bt for help-gnu-emacs@gnu.org; Tue, 19 Jan 2021 04:37:50 -0500 Original-Received: from jo-so.de ([2a03:4000:8:213::1]:45075 helo=s1.jo-so.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1nSH-00076z-UD for help-gnu-emacs@gnu.org; Tue, 19 Jan 2021 04:37:47 -0500 Original-Received: from mail-relay (helo=jo-so.de) by s1.jo-so.de with local-bsmtp (Exim 4.92) (envelope-from ) id 1l1nSB-0005JS-9N for help-gnu-emacs@gnu.org; Tue, 19 Jan 2021 10:37:35 +0100 Original-Received: from joerg by zenbook.jo-so.de with local (Exim 4.94) (envelope-from ) id 1l1nS0-007JD0-Kf for help-gnu-emacs@gnu.org; Tue, 19 Jan 2021 10:37:24 +0100 Content-Disposition: inline In-Reply-To: <20210118222326.mm24cg3bzgr4m74q@jo-so.de> Received-SPF: pass client-ip=2a03:4000:8:213::1; envelope-from=joerg@jo-so.de; helo=s1.jo-so.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127298 Archived-At: --jroffv5xvsvog2mz Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: Why is `(1 . width)` zero? MIME-Version: 1.0 J=F6rg Sommer schrieb am Mo 18. Jan, 23:23 (+0100): > Robert Pluim schrieb am Mo 18. Jan, 16:06 (+0100): > > >>>>> On Mon, 18 Jan 2021 09:51:13 +0100, J=F6rg Sommer said: > >=20 > > J=F6rg> Hi, > > J=F6rg> I'm using GNU Emacs=A027.1=B9 with X and the font DejaVu Sa= ns Mono. I would like > > J=F6rg> to align a text on the right side and thought I can use thi= s: > >=20 > > J=F6rg> ```lisp > > J=F6rg> (let* ((text " abcd") > > J=F6rg> (len (length text)) > > J=F6rg> ) > > J=F6rg> (add-text-properties 0 1 `(display (space :align-to (- te= xt (,len . width)))) text) > > J=F6rg> (insert "\n" (format "%S" text) "\n" text "\n")) > > J=F6rg> ``` > >=20 > > J=F6rg> but it doesn't work. The text is outside the visible space.= Similar with a > > J=F6rg> text that should be indented: > >=20 > > J=F6rg> ```lisp > > J=F6rg> (let ((text " abcd")) > > J=F6rg> (add-text-properties 0 1 `(display (space :width (10 . wi= dth))) text) > > J=F6rg> (insert "\n" (format "%S" text) "\n" text "\n")) > > J=F6rg> ``` > >=20 > > J=F6rg> It shows up in the first column. But in the TUI it works. S= o, what's wrong > > J=F6rg> with `width` in GUI? > >=20 > > 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? >=20 > 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: >=20 Sorry, I've picked the wrong commit. This one fixes the problem and a backport to 27.1 fixes it there, too. commit c7804ac4018fb03787f291d7ef1739b34914d930 (HEAD, refs/bisect/with-spa= ce) Author: Stefan Monnier Date: Thu Oct 8 09:49:20 2020 -0400 * src/ftcrfont.c (ftcrfont_open): Initialize the `max_width` field =20 On a 32bit build, Emacs can otherwise crash with a !FIXNUM_OVERFLOW_P assertion in `Ffont_info` by simply doing `emacs -Q` and then `C-s`. =20 * src/font.c: Try and detect uninitialized `max_width` fields. (font_make_object): Set max_width to a silly value. (Ffont_info): Check the value is not silly any more. --=20 $ cat /dev/random #!/usr/bin/perl -WT print "hello world\n"; --jroffv5xvsvog2mz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJMEAREIADsWIQS1pYxd0T/67YejVyF9LJoj0a6jdQUCYAaoVB0YaHR0cHM6Ly9q by1zby5kZS9wZ3Ata2V5LnR4dAAKCRB9LJoj0a6jdWVJAQCwIQGxLfu5uqys1l88 lLFYT3xZB9Kx8z9LSIPzCZe90gEAnEWpO6zJFRmS9eH2kGMjkOKejFx0B3xkZvyQ l3jurbU= =tyKK -----END PGP SIGNATURE----- --jroffv5xvsvog2mz--