From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#42307: bug#42347: Feature request: Visual block attribute for overlays Date: Tue, 14 Jul 2020 15:45:01 +0000 Message-ID: References: <83k0z6n7w6.fsf@gnu.org> <83eepem9im.fsf@gnu.org> Reply-To: Gregory Heytings Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13691"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.21 (NEB 202 2017-01-01) To: 42307@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 14 17:46:12 2020 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 1jvN8G-0003TZ-EK for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Jul 2020 17:46:12 +0200 Original-Received: from localhost ([::1]:48234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvN8E-0002Qa-VZ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Jul 2020 11:46:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvN85-0002QP-UV for bug-gnu-emacs@gnu.org; Tue, 14 Jul 2020 11:46:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jvN85-0005QD-Lh for bug-gnu-emacs@gnu.org; Tue, 14 Jul 2020 11:46:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jvN85-0001xW-Ih for bug-gnu-emacs@gnu.org; Tue, 14 Jul 2020 11:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Jul 2020 15:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42307 X-GNU-PR-Package: emacs Original-Received: via spool by 42307-submit@debbugs.gnu.org id=B42307.15947415147473 (code B ref 42307); Tue, 14 Jul 2020 15:46:01 +0000 Original-Received: (at 42307) by debbugs.gnu.org; 14 Jul 2020 15:45:14 +0000 Original-Received: from localhost ([127.0.0.1]:51366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jvN7K-0001wT-2x for submit@debbugs.gnu.org; Tue, 14 Jul 2020 11:45:14 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:58365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jvN7E-0001wF-0O for 42307@debbugs.gnu.org; Tue, 14 Jul 2020 11:45:12 -0400 Original-Received: from sdf.org (IDENT:ghe@faeroes.freeshell.org [205.166.94.9]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 06EFj4sq025887 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 14 Jul 2020 15:45:05 GMT Original-Received: (from ghe@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 06EFj433025917; Tue, 14 Jul 2020 15:45:04 GMT In-Reply-To: <83eepem9im.fsf@gnu.org> 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" Xref: news.gmane.io gmane.emacs.bugs:182995 Archived-At: >>>> 2. remove all pixel columns on the right *and on the left* of the >>>> overlay which have no "content" (that is, no characters on the right, >>>> and whitespace characters on the left). >>> >>> What would be the definition of "whitespace" for this purpose? >>> >> >> I think the regexp "[ \t\r\n]*" would be appropriate. > > Are you sure? > > First, \r doesn't happen in Emacs buffers, > I wasn't sure about \r, but included it just in case. > > and \n is the newline, so it isn't on the same line. > It is, but it's the last character of the line. With the current default behavior it is displayed, there is one more blank character after each line, just type C-x = on that character. In the two pictures (visualblock.png and visualblock-2.png) I sent (see bug #42307), the \n is removed on the right. Otherwise there would be one more column on the right. > > Next, what about \f, and more generally about any other sequence of > characters that match [:blank:]? > Good question. As far as I know \f is displayed by default as '^L' by Emacs, so it's a visible character, and I'm fine with this. I think it should not count as a blank character, which means that an overlay with a '\f' in a column would extend at least to that column. > > And finally, what about stretches of whitespace generated by the 'space' > display properties? > I don't know, and I'm not sure I fully understand the question. The "algorithm" I proposed is, I think, clear and simple: draw the overlay with :extend t, and trim whitespace on the left and on the right. That being said, on a second thought I think a better name for the proposed attribute would be ":trim" (or perhaps ":trimleft" and "trimright" to give as much possible freedom to Emacs users). It could have, for example, three values: - default value = nil, gives the default behavior (with and without :extend) - value = t, gives the behavior of "visiblechars.png" - value = column, gives the behavior of "visualblock.png" and "visualblock-2.png" Gregory