From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: "Why is emacs so square?" Date: Fri, 05 Jun 2020 16:57:32 +0200 Message-ID: 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> <833679boji.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="113924"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: sb@dod.no, rms@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 05 17:09:44 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 1jhDyZ-000TVL-Qw for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Jun 2020 17:09:43 +0200 Original-Received: from localhost ([::1]:48744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhDyY-0006j7-Sa for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Jun 2020 11:09:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhDms-0006o8-8Q for emacs-devel@gnu.org; Fri, 05 Jun 2020 10:57:38 -0400 Original-Received: from mail-am7eur06olkn2019.outbound.protection.outlook.com ([40.92.16.19]:55136 helo=EUR06-AM7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhDmq-0007bw-Mi; Fri, 05 Jun 2020 10:57:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SUlimrG4/HQLs+c/B0mt0cF/xPSwIUmZwfM+HRaWB/k++SBdjlS9+U943Nd6AOl0W1Uk88zKm4xAko8uXo5kFMUwgkAPA2+xStv0/PMwj/x45PylHf84qqu9yhpeiYGEO7VGKtdUDxZMx4glyCXkKI4Qsi9TuBPKdhmrXr4arLVDDWSwMB22X6nlkYlZi+tul60nzxnUOu/N6wa+us2VncXuIGrkjYW+ShKOsh7et2a4ORpRF0ye2u67kN/s9J/sFbtsgpjgAVa0vXPtAk4MfAdjbPw6TCokMNOSKhSUkboOErwncTMU2PTNDKmD0Xrky/wod1eI7fs1H3iKSF+/DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WaKZWAMp3sZXfIbhv2/TaicvtBuoxdUCEFw53UdaWGo=; b=FTVPvA7RRmH3+TE1dvsg8M0xIzrVj9oLQwHIZU39DlyXJA0p4+0qgXzPVEt/CexF3eQNDRQbpQZtMqngYwgzEaEEWO6Ok34s0T5aa1Ecrj1a+dDXt9AbBsGrOP9m49NhdZ+QfPlEoZZ5J+GUm59kF6qIsjubJldfpSLIQInEc45Yzbk9TdUoAIJQYOQ2TDwxamyNLPoQKdVUdyrNauAr27ofFnhNx2pXQ4Wkr+6qXdOM/eyK29Qtw8HZmaUJTx4ZOD2Frm8wCGHD0hlikpVbAMM4+2qsKlt4o61kAjkEwdR8a35ZcrrMP/R3x1YNqndnBE2+SdqyGkktGg0Bv8romg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WaKZWAMp3sZXfIbhv2/TaicvtBuoxdUCEFw53UdaWGo=; b=H4mii3KQwyPWRj3OTd3BsFA2EvtawaRGgVcHa8j4EebliWtqZSwXa14gdv9V7rAafizqGkkz8AqNWluPmKph2bEkJxUdletH7pvbXDxutRXKUkBBb2IqaUm+QT9RvkTOjU1aYSvkFH2selVH7WxS2WkaJ/y2Ywn4eXgQVZ/+PmLrqpQBeL9o5+D3OwHIg5cSk4LCeXR9+KlxH2hGLoEaVVj9vGtvk3mmi9AcW7ElOIUjaoG65Zq6pEEv22X1ZvqSXGA/ZSSyNXZGtY1a56XXw3gu28o+9y82OL04JTutn20pzcH3MPfRlXXROAPzmfZPlGp5TLMfRVUbiTokV8rQFQ== Original-Received: from VI1EUR06FT041.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::4c) by VI1EUR06HT140.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::407) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Fri, 5 Jun 2020 14:57:33 +0000 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com (2a01:111:e400:fc37::46) by VI1EUR06FT041.mail.protection.outlook.com (2a01:111:e400:fc37::345) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Fri, 5 Jun 2020 14:57:33 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:DC43BD0D1BB30EC3952803C98FDB5D63AB3D0C799F1F5B3D26F75227E0B7847C; UpperCasedChecksum:764A3F38ECF3B6E16D95D2AE810F88283050FFCE2FF643D1B37EE4AF822CDF4E; SizeAsReceived:8429; Count:48 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com ([fe80::49f0:2314:a959:bec5]) by VI1PR06MB4526.eurprd06.prod.outlook.com ([fe80::49f0:2314:a959:bec5%7]) with mapi id 15.20.3066.018; Fri, 5 Jun 2020 14:57:33 +0000 In-Reply-To: <833679boji.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Jun 2020 17:00:33 +0300") X-ClientProxiedBy: AM6P193CA0110.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::15) To VI1PR06MB4526.eurprd06.prod.outlook.com (2603:10a6:803:ac::17) X-Microsoft-Original-Message-ID: <87wo4l4l2b.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM6P193CA0110.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Fri, 5 Jun 2020 14:57:32 +0000 X-Microsoft-Original-Message-ID: <87wo4l4l2b.fsf@live.com> X-TMN: [Os4MndJG3ownkqtLLm2IZh45H4e/7a3m] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 476de895-e3d4-4822-7d3c-08d80960c6d6 X-MS-TrafficTypeDiagnostic: VI1EUR06HT140: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ay0a64YDEMUeioLzGdwIQGEVxbP6oNVgW3kSlxm8FjbNF7LaSQMCM27n1tcq3B3A4rgAGivshVqiK9wgu/RjJXsK2C2cNiA0u/dK0rBrDxdF2YSPpNpH+ZB5gO+w5ssiJ68wHp6SdpQIaejWzeEwM/EyRGg7vJiz68vd0H5gTSzmzIH0J+6yVWBs4MUr0zQKVqOX7HsAHajrq0p0wuzKH1sHAfHt0ln6u0RkQLj8aU60vZksftg6UpUSB0oWmCTJ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:0; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR06MB4526.eurprd06.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:; DIR:OUT; SFP:1901; X-MS-Exchange-AntiSpam-MessageData: l48HcLI75Fd0s0a4UcxNWuD+4uKwbznWp264B1ypptMXgL++o91DBlA7db80NDPUx7WxNd/nLJpTrKiRetZ0wyGGgB7nEztEYmWWKbgH8ZUIm/84AYzfLqAO/J4vm0BxF0B7Np95a9ZYzT/i58IhxQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 476de895-e3d4-4822-7d3c-08d80960c6d6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2020 14:57:33.4608 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR06HT140 Received-SPF: pass client-ip=40.92.16.19; envelope-from=arthur.miller@live.com; helo=EUR06-AM7-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/05 10:57:34 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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:251903 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Date: Fri, 05 Jun 2020 15:01:13 +0200 >> Cc: sb@dod.no, emacs-devel@gnu.org >> >> Anyway what about if emacs had a print-page-mode as a minor mode for >> displaying some printing hints in text modes? I am not sure if I can >> write such, but here is idea: >> >> * provide a database of predefined paper sizes as specified on: >> https://www.papersizes.org/a-sizes-in-pixels.htm >> to be used as templates for width and height (in pixels) >> >> * 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. >> >> As I understand Emacs already has some support for page breaks (^L) as I >> learned myself very recently :-). There is extended page handling in >> Emacs and also a mode called PageMode: >> >> https://www.emacswiki.org/emacs/PageMode >> >> I am not sure, but what I think is missing is just to tie those things >> to paper sizes and automize page creation based on some paper template >> which is nothing but a pixel-width and pixel-height. I am not sure, I >> haven't used PageMode myself, I just learned about it. >> >> I am not sure how efficient it would be to check for pixel-width and height >> on every char insertion, maybe there is some better way? > > All of this is already available, although not all of it is exposed to > Lisp. Taking advantage of existing pixel-level capabilities is part > of the job of providing the features that Richard has in mind. When you say all of this, and not exposed to lisp, what exactly do you mean? :-) Is it possible to get a pixel offset from a point with elisp? Height, width, or whatever that could be used to calculate if current buffer region fits iin a page or not? (defvar ppi-72 '((4A0 . (4768 . 6741)) (2A0 . (3370 . 4768)) (A0 . (2384 . 3370)) (A1 . (1684 . 2384)) (A2 . (1191 . 1684)) (A3 . (842 . 1191)) (A4 . (595 . 842 )) (A5 . (420 . 595 )) (A6 . (298 . 420 )) (A7 . (210 . 298 )) (A8 . (147 . 210 )) (A9 . (105 . 147 )) (A10 . (74 . 105 )))) If I have a database of sizes like this, I would need to know a size in pixel of a buffer region between some min and max points. That could be used to either defadvice insert or to calculate and restructure text afterwards. Maybe it is to naive, no idea, just thinking. Also I am not sure how resolution/ppi relate to emacs buffers to be honest. >> It would be nice if Emacs could draw a thin line to denote edges, or a >> rectangle of page size below the text as word processors do > > We already can display such thin lines, see, for example, help-fns.el > (search for ":height"). No X-level graphics is needed. As composed of characters or as overlays with underline/overstruck or similar? What about a rectangle in some color as a background to symbolize a page. I understand it is not needed, but it would be nice.