From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: prettify-symbols-mode, derived modes, and compose-region Date: Fri, 05 Mar 2021 10:51:00 -0500 Message-ID: References: <83k0qmzit9.fsf@gnu.org> <587ee071-985b-450a-2df7-0b4bb0f97b48@posteo.net> <83blbyysox.fsf@gnu.org> <83ft19y6cx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22182"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: d.williams@posteo.net, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 05 16:52:35 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lICkk-0005fI-HX for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Mar 2021 16:52:34 +0100 Original-Received: from localhost ([::1]:50486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lICkj-0000mO-Cw for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Mar 2021 10:52:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lICjO-00082A-TE for emacs-devel@gnu.org; Fri, 05 Mar 2021 10:51:10 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:52937) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lICjJ-0001Pk-JJ; Fri, 05 Mar 2021 10:51:08 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7B00F80C11; Fri, 5 Mar 2021 10:51:03 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2C93580602; Fri, 5 Mar 2021 10:51:02 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1614959462; bh=qs1q9nW1dwvKnyUv1tYjmiqGzZqR208x+KIHtBbT41E=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=mbgHQXVdgnAH5Dh5k/N84i+CCaUCXU79qn369NouXNREh9zk//X3Z4lpF6AvUB9vN CYrCJXWSKwPtZm2xXlrYhmPtsgw0UMVdWViUW84oX5HtYqPZadl8+BAcQ1K7x91N6c 72By5Cs0EiForA1GcittEXXFSIQ2nDXkM6iG/5NhrNHkGAfY+sU8gHKbFoutZLFIee imHNVNzLVc8BBKk5YXvuIv3do4Hp6dmczNckqCLtiViQweSL8sGjIWMvv4cNrlqcSa Q6tfd2YB3Er3tbWNsDcHUyCgSO+7G2oj2sBrwQZoOeQw5/3Ynrd37yAuzyr8keXguM BdlylNK4upvMA== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C4A7E12047D; Fri, 5 Mar 2021 10:51:01 -0500 (EST) In-Reply-To: <83ft19y6cx.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Mar 2021 17:20:46 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266027 Archived-At: >> > If the width of the additional space is known, there's also the :width >> > display property. >> >> Indeed, there's `:width` but in the case under discussion the desired >> with of the space is something like `1 - width-of-previous-char`, IOW >> something ELisp can't know when it puts the text property. > > Yes, it can: shr.el uses these capabilities. IIRC you can query Emacs about the size the character would have if it were to be displayed right now in the currently selected window. But you don't know that it's the same size as the character will have when it will actually be displayed (and that char could have simultaneously two different sizes in two different windows, of course). I guess we could extend the "pixel specification for spaces" so you can use "the width of this char" or "the width of that string" in your computation, but it sounds pretty ugly ;-) Stefan