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.bugs Subject: bug#26909: 25.1; A face for margins Date: Tue, 12 May 2020 19:52:29 +0300 Message-ID: <83ftc5859u.fsf@gnu.org> References: <83lgq096iz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="59411"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yuri.v.khan@gmail.com, 26909@debbugs.gnu.org To: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 12 19:05:23 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 1jYYLL-000FFj-GP for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 May 2020 19:05:23 +0200 Original-Received: from localhost ([::1]:36192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYYLJ-00047Z-Qz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 May 2020 13:05:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYY9O-0007TZ-9L for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 12:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYY9N-0001jR-VA for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 12:53:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYY9N-0007Oi-SH for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 12:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 May 2020 16:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26909 X-GNU-PR-Package: emacs Original-Received: via spool by 26909-submit@debbugs.gnu.org id=B26909.158930237928427 (code B ref 26909); Tue, 12 May 2020 16:53:01 +0000 Original-Received: (at 26909) by debbugs.gnu.org; 12 May 2020 16:52:59 +0000 Original-Received: from localhost ([127.0.0.1]:56404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYY9L-0007OR-Cg for submit@debbugs.gnu.org; Tue, 12 May 2020 12:52:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYY9J-0007OB-CR for 26909@debbugs.gnu.org; Tue, 12 May 2020 12:52:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45138) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYY9D-0001ic-Ma; Tue, 12 May 2020 12:52:51 -0400 Original-Received: from [176.228.60.248] (port=2909 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jYY9D-00052w-31; Tue, 12 May 2020 12:52:51 -0400 In-Reply-To: (message from =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel on Mon, 11 May 2020 17:01:23 -0400) 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:180107 Archived-At: > Cc: 26909@debbugs.gnu.org > From: Clément Pit-Claudel > Date: Mon, 11 May 2020 17:01:23 -0400 > > A margin face would be great to have. > How reasonable would it be to fill the margins with a stretched space? Would it be too costly? It would slow down redisplay, especially if the window is large, but maybe the slow-down will not be so awful. > The (silly) attached patch confirms that removing the short-circuits makes it possible to set a face in the margins, but besides the performance aspect it only applies to lines that have contents. > > Is this a reasonable way to go? Something like that, yes. But you will need to make sure extend_face_to_end_of_line is called also for empty lines. And of course the "silly" changes need to be made less silly. And you need to compute the pixel-width of the stretch glyph, since the code you cited only places a single SPC character there, which is not what you want if the margin is wider than one column. > --- a/src/xfaces.c > +++ b/src/xfaces.c > @@ -4768,6 +4768,7 @@ lookup_basic_face (struct window *w, struct frame *f, int face_id) > case TAB_BAR_FACE_ID: name = Qtab_bar; break; > case TOOL_BAR_FACE_ID: name = Qtool_bar; break; > case FRINGE_FACE_ID: name = Qfringe; break; > + case MARGIN_FACE_ID: name = Qmargin; break; If this is going to be an additional basic face, then why do you call lookup_named_face and not lookup_basic_face? Also, this face should have a defface definition in faces.el. (And NEWS, and update for the manuals...) Thanks.