From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: "Why is emacs so square?" Date: Sat, 06 Jun 2020 09:55:25 +0300 Message-ID: <83eeqsadk2.fsf@gnu.org> References: <863691n4xl.wl-me@enzu.ru> <86blno9yle.wl-me@enzu.ru> <87d0845msg.fsf@yahoo.com> <87h7xgjasw.fsf@yahoo.com> <875zdwjais.fsf@yahoo.com> <6a198677-41b6-4dbd-39d0-2b01550d53cf@yandex.ru> <32f6a2ce-e30f-059f-dcd4-233d666a10a1@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="100078"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sb@dod.no, arthur.miller@live.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 06 08:56:47 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 1jhSl4-000Pwp-I9 for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jun 2020 08:56:46 +0200 Original-Received: from localhost ([::1]:55022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhSl3-0006gJ-LK for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jun 2020 02:56:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhSk4-0005tJ-Hd for emacs-devel@gnu.org; Sat, 06 Jun 2020 02:55:44 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57169) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhSk2-0004kt-2a; Sat, 06 Jun 2020 02:55:42 -0400 Original-Received: from [176.228.60.248] (port=1748 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jhSjs-0005br-U4; Sat, 06 Jun 2020 02:55:33 -0400 In-Reply-To: (message from Richard Stallman on Fri, 05 Jun 2020 23:56:16 -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:251934 Archived-At: > From: Richard Stallman > Date: Fri, 05 Jun 2020 23:56:16 -0400 > Cc: sb@dod.no, emacs-devel@gnu.org > > > * advice insert funcion(s) to check for current line pixel-width and > > pixel-height. If width or height exceed template width and height then > > insert ^L to denote page break and move point to next line and insert > > text in next line. If width is exceeded maybe it is just enough to > > move point to next line, but when height for a page is exceeded one > > would need a special char to visualize page break. > > If this works reliably, and isn't very slow, it could be good enough. > For this to work reliably requires understanding the width of text > as it will eventually be rendered, including different sizes and > variants (italic, bold, etc). FWIW, I don't think this is possible from Lisp, not with the currently available facilities. shr.el does something like that, and it does a decent job with the tools it has, but IMO it is nowhere near what is needed, and cannot handle complex situations with various complex scripts. It is also quite slow: I sometimes need to wait for several seconds for it to display an email message of a couple of hundreds lines. Layout in Emacs has to be done in C to be both efficient and fully capable. Some small and simple jobs, like pixel-level alignment, can be done in Lisp, but not the entire job as a whole.