From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dannym@friendly-machines.com Newsgroups: gmane.emacs.bugs Subject: bug#74178: Handle tab stops on display so they work in variable-pitch-mode Date: Sat, 02 Nov 2024 19:06:54 +0100 Message-ID: <0977f406630ca447c857de6c38a9df7e@friendly-machines.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_9104b8db68e8b3b9e0d90f4c10fd313d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23711"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Roundcube Webmail/1.5.0 To: 74178@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 02 19:08:14 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1t7IXm-00060O-03 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Nov 2024 19:08:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7IXc-00025p-At; Sat, 02 Nov 2024 14:08:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7IXa-000249-Kq for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 14:08:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7IXa-0003E5-CO for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 14:08:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:Date:MIME-Version:To:Subject; bh=6l50YC4ZvVlG+klRHcFrxTY8LQHGAGEGLZ2/6IxDV9s=; b=AU5KFFnT5aY6VX4ivX28gbHN2NXhTNaSFTiemVhqJXKNbAePUStZR6gEEHJtRP8ZR5yBa+pS76FiHifEnikPDXW5J4QsI2tZGHCH6AJ2dB1FWMFikRSa1DTd53FupVsLmkkNnYFHveYqYKwPLGxyOnU5HtYly9Q1NvQOGI/Mw6oUp6H9cufcNjAJ+8iHsUtxbEYXLxU8CVi2GZYebXp/o1fr4yC7rXdNdut6JjKGGsSSKOCUBTvx+QBXduW712FYC7aDzl27j2zaUSc5R6xYB1HW94+aNRBkdrQSJFlw9OJ1I9U9xffNoUtcJjaMjCnSHBS3eqSE/4IWK2P2v6bCNw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t7IXa-0003Pw-4v for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 14:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dannym@friendly-machines.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Nov 2024 18:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74178 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173057082313081 (code B ref -1); Sat, 02 Nov 2024 18:08:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Nov 2024 18:07:03 +0000 Original-Received: from localhost ([127.0.0.1]:54799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7IWb-0003Oe-Tn for submit@debbugs.gnu.org; Sat, 02 Nov 2024 14:07:02 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:51850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7IWa-0003OX-7v for submit@debbugs.gnu.org; Sat, 02 Nov 2024 14:07:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7IWZ-0001nN-LZ for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 14:06:59 -0400 Original-Received: from cichlid.cherry.relay.mailchannels.net ([23.83.223.36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7IWX-00038m-8R for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 14:06:59 -0400 X-Sender-Id: dreamhost|x-authsender|dannym@friendly-machines.com Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CC882841CC1 for ; Sat, 2 Nov 2024 18:06:54 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a254.dreamhost.com (trex-5.trex.outbound.svc.cluster.local [100.103.26.202]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 858F984270B for ; Sat, 2 Nov 2024 18:06:54 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1730570814; a=rsa-sha256; cv=none; b=z7YXHtWDGOAPtuqT3/sYPSC4E+QmT5hMTQ4BFWwf5wXAahdotwllrgbCWyBEY6Wg1McSnM uH/Id7Lm1/pWml12c6OTF3Y5W6yNxA2hp1ycqkxwzT8BT1Bf7wXCMIMkiSx27GSASDLpU8 nBjrkvrQn2PXR9Q4DT9AoUi8S0ZwCn2EmtF6T3B7mm0IvB0AWsWJrAVuR5IbDILjL+fSww 77LUJp4anbTRyMH+X0WqKRosvut7jOzRQ/8DzrrtKl/7qn/nen1q8KmdbMPAJJRmBbRKqX pgIeSSqhrxu9dHAVPYovBd6WJstEf5xYGMsn/gZ+1g2fk/7HWRpodDiZ/LedOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1730570814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: dkim-signature; bh=6l50YC4ZvVlG+klRHcFrxTY8LQHGAGEGLZ2/6IxDV9s=; b=8wXlBMrX1rv0S60TtN4x0riJf9wfgzyqtHoy5Vrw4fdTiSMFQWewI5dimZlKMwHT9z7cRV 8gs+uHULjGSYRorgV3OCrnV1kn6ZiVUMcy5QZIAg+cVTGtUR1eOrlY4/ngrIGVOcXZ9VuL RWRoRygs8RUVotVfKmC4MXCFKQYODFTRTRsDGIXzQd3Ro6PEUN2JsiGlAXfcvHBo0deTri kkugV9XEbL7gNG9fyVbi3lyrtdRnneDIBwZ6U91rOMnB2iBmHIg9G+L1i9fwVINlJ67YF3 oboJgRlo6iq4+fp368xSsM0QET9J4CRhgpU5Y08ltLSvuNyh4PKdzszLSmkFtQ== ARC-Authentication-Results: i=1; rspamd-5cc7c5c758-4s9vb; auth=pass smtp.auth=dreamhost smtp.mailfrom=dannym@friendly-machines.com X-Sender-Id: dreamhost|x-authsender|dannym@friendly-machines.com X-MC-Relay: Bad X-MailChannels-SenderId: dreamhost|x-authsender|dannym@friendly-machines.com X-MailChannels-Auth-Id: dreamhost X-Snatch-Macabre: 490c2a05438697d4_1730570814764_801823744 X-MC-Loop-Signature: 1730570814764:53028803 X-MC-Ingress-Time: 1730570814763 Original-Received: from pdx1-sub0-mail-a254.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.103.26.202 (trex/7.0.2); Sat, 02 Nov 2024 18:06:54 +0000 Original-Received: from webmail.friendly-machines.com (ip-66-33-200-4.dreamhost.com [66.33.200.4]) (Authenticated sender: dannym@friendly-machines.com) by pdx1-sub0-mail-a254.dreamhost.com (Postfix) with ESMTPA id 4Xglzy33C6z1L for ; Sat, 2 Nov 2024 11:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=friendly-machines.com; s=dreamhost; t=1730570814; bh=6l50YC4ZvVlG+klRHcFrxTY8LQHGAGEGLZ2/6IxDV9s=; h=Date:From:To:Subject:Content-Type; b=SGbkPO3Fz4/UipjQk26wC+z0cYasR9iAq80RCB+JzAQ0PNrgnWdPghGk4U10Y5ugx spvbWq9TmmTmZqVWGEkmL0Hq3XukKqmSNSrefjlddPvu5sLwxoxLI8t7jj+QC7h+el zyBWRZg9eXz23no+fo2Ee3mP6XX6FXYuceeDGk6kItr+yJIZPPLnzJaIdS2QJm/be0 D46pMI16Y4iNegSz99Xa/H4De6fh9nmhmlXXhz5OgJIVw/KRmvzSuSdMNSBcFIKwjy 3oxMJnMLzkLs5doOyX1X5UtGCwOrQuuue8NIunpjAi8P+Sl2tnCZMzKClfGJbOJB49 6ZlO+X2n4yGDg== X-Sender: dannym@friendly-machines.com Received-SPF: pass client-ip=23.83.223.36; envelope-from=dannym@friendly-machines.com; helo=cichlid.cherry.relay.mailchannels.net 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294767 Archived-At: --=_9104b8db68e8b3b9e0d90f4c10fd313d Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hello, Right now, when using variable-pitch-mode, there's no way for the user to make tables. This patch adds a feature to do that. This patch handles tab-stop-list in the display part of emacs so that they work as expected when using variable-pitch-mode. The unit of the values in tab-stop-list is space characters. The reasons why those values are in space characters are: - Works with HiDPI and LoDPI screens the same way with the same values inside tab-stop-list. - Works in console emacs. - Works in graphical emacs. - Is backward compatible. My assumption is that existing user files either don't have any '\t' in their buffers or they are using the (previous) high-level version of emacs tab-stop-list (which will replace all '\t' by some spaces), not both. This way, emacs without the patch is forward-compatible to emacs with the patch. This is a version that will use tabs in the order they appear in the tab-stop-list, (on purpose) regardless of whether the text on the line already exceeded the respective tab stop position (because it's still better not to use the wrong column in the table). Each respective tab stop, in order, will be used for a respective '\t', per line. If these fixed tab stops are used up, it will fall back to the automatic tab stops every tab_width that emacs also already had done before. The list of tab stops is buffer-local--as before. I successfully tested both console and graphical emacs. In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) System Description: Guix System Configured using: 'configure CONFIG_SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/bash SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/bash --prefix=/gnu/store/9q1cfyj0bk0lqvx75pg9gn4isnlz2llv-emacs-pgtk-29.4 --enable-fast-install --with-pgtk --with-cairo --with-modules --with-native-compilation=aot --disable-build-details' --=_9104b8db68e8b3b9e0d90f4c10fd313d Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=emacs-tab-stops-v2.patch Content-Disposition: attachment; filename=emacs-tab-stops-v2.patch; size=8703 ZGlmZiAtcnUgJy1GXltfYS16QS1aMC05JF1cKyAqKCcgb3JpZy9lbWFjcy0yOS40L0NoYW5nZUxv ZyBlbWFjcy0yOS40L0NoYW5nZUxvZwotLS0gb3JpZy9lbWFjcy0yOS40L0NoYW5nZUxvZwkxOTcw LTAxLTAxIDAxOjAwOjAxLjAwMDAwMDAwMCArMDEwMAorKysgZW1hY3MtMjkuNC9DaGFuZ2VMb2cJ MjAyNC0xMS0wMiAxNzo1NDowNS41NTc4NzM3NjMgKzAxMDAKQEAgLTEsMyArMSwxOSBAQAorMjAy NC0xMS0wMiAgRGFubnkgTWlsb3NhdmxqZXZpYyAgPGRhbm55bUBmcmllbmRseS1tYWNoaW5lcy5j b20+CisKKwlIYW5kbGUgdGFiIHN0b3BzIGluIGRpc3BsYXkgKGluc3RlYWQgb2YgZmFraW5nIGl0 KS4KKworCVRoaXMgbWFrZXMgaXQgcG9zc2libGUgZm9yIHRoZSB1c2VyIHRvIG1ha2UgdGFibGVz IGluCisJdmFyaWFibGUtcGl0Y2gtbW9kZSBhcyB3ZWxsLgorCisJKiBzcmMvYnVmZmVyLmggKHRh Yl9zdG9wX2xpc3QpOiBOZXcgcHVibGljIHZhcmlhYmxlLgorCSogc3JjL2J1ZmZlci5jICh0YWJf c3RvcF9saXN0KTogSW5pdGlhbGl6ZSBpdC4KKwkqIHNyYy9kaXNwZXh0ZXJuLmggKHRhYl9zdG9w X2xpc3QpOiBOZXcgdmFyaWFibGUuCisJKiBzcmMvdGVybS5jIChmaW5kX25leHRfdGFiX3N0b3Ap OiBOZXcgcHJvY2VkdXJlLgorCShwcm9kdWNlX2dseXBocyk6IFVzZSBpdC4KKwkqIHNyYy94ZGlz cC5jIChpbml0X2l0ZXJhdG9yKTogSW5pdGlhbGl6ZSB0YWJfc3RvcF9saXN0LgorC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