From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to make Emacs popular again: Use monospaced fonts less Date: Thu, 15 Oct 2020 16:57:57 +0300 Message-ID: <83lfg7y4ka.fsf@gnu.org> References: <83v9ftf6n9.fsf@gnu.org> <835z7qfp6h.fsf@gnu.org> <87ft6lgw5y.fsf_-_@gnus.org> <1F8F3522-1E6C-40A3-B61A-B9B84FC0AD18@gnu.org> <87blh9gthg.fsf@gnus.org> <87tuv1f2y9.fsf@gnus.org> <87o8l9f1dl.fsf@gnus.org> <83lfgc50gb.fsf@gnu.org> <875z7gflpl.fsf@gnus.org> <83imbf2xux.fsf@gnu.org> <87lfgbarkk.fsf@gnus.org> <83zh4q195b.fsf@gnu.org> <87sgah1mjz.fsf@gnus.org> <83r1q0zwlp.fsf@gnu.org> <837drszozo.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13469"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 15 16:07:59 2020 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 1kT3vD-0003O8-CT for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Oct 2020 16:07:59 +0200 Original-Received: from localhost ([::1]:55042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT3vC-0001oh-F3 for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Oct 2020 10:07:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT3lK-0000pK-BM for emacs-devel@gnu.org; Thu, 15 Oct 2020 09:57:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50781) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT3lJ-0002nN-DV; Thu, 15 Oct 2020 09:57:45 -0400 Original-Received: from [176.228.60.248] (port=1962 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kT3lI-0005cE-DM; Thu, 15 Oct 2020 09:57:44 -0400 In-Reply-To: (message from Stefan Monnier on Wed, 14 Oct 2020 18:53:31 -0400) 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:257731 Archived-At: > From: Stefan Monnier > Cc: larsi@gnus.org, emacs-devel@gnu.org > Date: Wed, 14 Oct 2020 18:53:31 -0400 > > >> > Yes, this can be done. But we'd need fort to decide what is the > >> > semantics of this: > >> > (setq mode-line-thing `(:propertize "%12b" :min-width 10)) > >> One solution is to not use text-properties, e.g. > > That's what I suggested: to use the "12" part for that. > > That would limit its applicability to to the few % escape sequences > (and would make it more difficult to provide things like centering, > min-width, max-width, ...). We'll need to change the mode-line spec anyway, if we decide to go this way, no matter if it's by a property or by some change in the format specs. The advantage of %12b and its ilk is that it solves 2 problems at the same time: removes the potential contradiction between the width specification in mode-line-format and this new property; and allows to get rid of the text property, which is a certain complication. > >> The downside is that this will only work for -line-format, whereas > >> this kind of functionality would also be handy within buffer text for > >> tabular modes like `proced`. > > Outside of the mode line, I don't know how to implement that easily, > > because that would need some kind of looking-back to find where the > > text property started. > > Indeed. Maybe the text-property's value should include the information > of what is the "starting position". ??? How can Lisp know that? The starting position is needed at pixel accuracy to be useful. Mode-line display knows that because it keeps the string iterator object as it goes from one mode-line element to the next one, and the iterator object needs to keep track of the current X coordinate. So we can record the X coordinate we started from when we begin to lay out each mode-line element. But that doesn't happen in normal text layout.