From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38485: Customizing glyph widths Date: Wed, 04 Dec 2019 20:45:27 +0200 Message-ID: <83r21khquw.fsf@gnu.org> References: <3183ba6c-6aea-fa25-bb32-7e5ff7c04ad6@gmail.com> <83y2vshyvn.fsf@gnu.org> <478afae1-0080-c825-5a53-1bc8e897a1cc@gmail.com> <83sgm0hvhx.fsf@gnu.org> <4e6c87d3-21c0-1820-96f2-62bb0dd7c925@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="140710"; mail-complaints-to="usenet@blaine.gmane.org" Cc: casouri@gmail.com, 38485@debbugs.gnu.org To: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 04 19:46:25 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1icZfL-000aQz-5y for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2019 19:46:23 +0100 Original-Received: from localhost ([::1]:45902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icZfJ-000559-Ma for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2019 13:46:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47918) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icZf7-00050y-Pb for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 13:46:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icZf5-00013I-PB for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 13:46:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icZf0-0000k5-4U for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 13:46:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1icZf0-0008TJ-2Y for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 13:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Dec 2019 18:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38485 X-GNU-PR-Package: emacs Original-Received: via spool by 38485-submit@debbugs.gnu.org id=B38485.157548514332533 (code B ref 38485); Wed, 04 Dec 2019 18:46:02 +0000 Original-Received: (at 38485) by debbugs.gnu.org; 4 Dec 2019 18:45:43 +0000 Original-Received: from localhost ([127.0.0.1]:42680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icZeh-0008Se-6h for submit@debbugs.gnu.org; Wed, 04 Dec 2019 13:45:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38789) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icZef-0008SF-9L for 38485@debbugs.gnu.org; Wed, 04 Dec 2019 13:45:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1icZeY-0007g9-Dj; Wed, 04 Dec 2019 13:45:35 -0500 Original-Received: from [176.228.60.248] (port=1429 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1icZeX-0003ch-Sh; Wed, 04 Dec 2019 13:45:34 -0500 In-reply-to: <4e6c87d3-21c0-1820-96f2-62bb0dd7c925@gmail.com> (message from =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel on Wed, 4 Dec 2019 13:14:19 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172845 Archived-At: > Cc: casouri@gmail.com, 38485@debbugs.gnu.org > From: Clément Pit-Claudel > Date: Wed, 4 Dec 2019 13:14:19 -0500 > > >> I'm thinking something like `:display-width 3' or maybe `display-width "~~>"' (the former would mean "as wide as three spaces in the default font"; the later, "as wide as `~~>' in the default font"). > >> These properties would be applied by prettify-symbols-mode in addition to composition. > > > > I don't understand why would prettify-symbols-mode want to do this via > > a text property, instead of via a buffer-local variable. > > Would this buffer-local variable be an alist mapping each character to the desired width? No, it will simply make each prettified symbol take up the same width as the original characters of the symbol that were composed. Isn't that what everyone would want, and want for _all_ prettified symbols? > However, consider this instead: > > (fun x ⇒ 1 + > x + x) > > In this example the user worte an actual '⇒' in the buffer. In that case, it shouldn't be widened to two characters, otherwise indentation will look broken. I was talking about a variable that affects only results of character compositions, so it won't affect a literal ⇒. And another variable will affect characters whose glyphs' width is different from an integral multiple of the frame's default character's width. > >> An interesting related feature is the ability to move the cursor inside composed characters. For example, when composing -> into →, assuming a font such as Fira code with a two-characters wide → symbol, it would be nice to be able to position the point in the middle of the composed symbol. I often have this problem in Emacs with ||; I compose it into ‖, but I sometimes want to type |a|, and in those cases I tend to type || then press left and type a, but this doesn't work when || has been composed into ‖. > >> Other editors have this feature, but I'm not sure how they handle the distinction between a composition that shouldn't be "separable" (such as é = e + ') and one that should be (such as ↝ = ~ + >). > > > > This is an unrelated feature. We currently allow DEL to delete one > > characters even if it's composed with adjacent characters, but we > > don't allow moving inside the composition. (You can always > > toggle-auto-composition, though.) > > Should I open a separate request? Feel free.