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: How to make Emacs popular again: Use monospaced fonts less Date: Thu, 15 Oct 2020 10:21:39 -0400 Message-ID: References: <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> <83lfg7y4ka.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="40132"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 15 16:22:35 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 1kT49L-000ALV-9r for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Oct 2020 16:22:35 +0200 Original-Received: from localhost ([::1]:47482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT49K-0002qV-Ck for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Oct 2020 10:22:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT48Z-0002AL-Ds for emacs-devel@gnu.org; Thu, 15 Oct 2020 10:21:47 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT48W-00064Q-UX; Thu, 15 Oct 2020 10:21:46 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D7A5944111B; Thu, 15 Oct 2020 10:21:42 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7061944110B; Thu, 15 Oct 2020 10:21:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1602771701; bh=d6vfMbSCjBeR/sLkc0Q5RswBfSIucaDJ7ytGLuWVatM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=lsLfBniulBDCyRrJeiXUrhpqdRXPucEKM/wnSTCoI4c/sAZ39wROsaYWsYYGFZrQS LlrLv/qcbzidCbBuQInW/HTXrt+ixQN9noEUwp8IF+fGwWZXT15UejGBTj9MNqqf+8 it8uk2WGx2pl3m8uDPlS/eMen3DfP181Uqws4KwRYlkk/LTu12Ph7hhbBPcRjgOclK K2Cggwz1s2ly2TEPIbq8zRM9HKDbIN2vCAUToak+U3woqpchXEy5vX6lgsovfDlXaP x0JHEASZp24ofjlifDXH3ZuWxKzxtTKXcPI2BNez4SoKGnyMhBIUFJ5Gapxoj6E0/7 j0vNXp/gdo8Dw== Original-Received: from alfajor (unknown [157.52.9.240]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0894912023D; Thu, 15 Oct 2020 10:21:41 -0400 (EDT) In-Reply-To: <83lfg7y4ka.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 15 Oct 2020 16:57:57 +0300") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 08:25:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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:257735 Archived-At: > 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. But the %12b approach doesn't let you specify a max/min width for other elements such as `mode-line-process`, `major-mode, `minor-mode-alist`, ... >> > 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? Oh, I see we were not talking about the same thing. Yes, we'd need somehow to walk back the glyph structure to find the pixel position of the start position of the element. What I was trying to address is the issue of text properties being potentially split, so you can't really rely on (put-text-property START END 'width 50) so I was thinking of instead doing something like (put-text-property (1- END) END 'relative-end-position (list START 50)) so when the redisplay sees this position, it would walk back the glyphs to find the nearest one corresponding to START, and then either truncate the last few glyphs to fit in a width of 50, or add some space to reach a width of 50. Of course, on the next day someone would come along and want to use it with START on another line with the intention to do relative indentation ;-) At which point we may prefer to use something like: (put-text-property START (1+ START) 'glyph-mark 'my-glyph-mark) (put-text-property (1- END) END 'relative-end-position (list 'my-glyph-mark 50)) with the redisplay keeping track somehow(!) of a set of "glyph-marks" seen in the current window. Stefan