From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Newsgroups: gmane.emacs.bugs Subject: bug#26909: 25.1; A face for margins Date: Tue, 12 May 2020 13:06:00 -0400 Message-ID: References: <83lgq096iz.fsf@gnu.org> <83ftc5859u.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="75934"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: yuri.v.khan@gmail.com, 26909@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 12 19:09:09 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 1jYYOy-000JZC-PQ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 May 2020 19:09:08 +0200 Original-Received: from localhost ([::1]:50136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYYOx-0002Du-Bx for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 May 2020 13:09:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYYMx-0007aM-0s for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 13:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44871) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYYMw-00070g-MZ for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 13:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYYMw-0007mT-Hy for bug-gnu-emacs@gnu.org; Tue, 12 May 2020 13:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 May 2020 17:07:02 +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.158930317029846 (code B ref 26909); Tue, 12 May 2020 17:07:02 +0000 Original-Received: (at 26909) by debbugs.gnu.org; 12 May 2020 17:06:10 +0000 Original-Received: from localhost ([127.0.0.1]:56417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYYM6-0007lJ-Ga for submit@debbugs.gnu.org; Tue, 12 May 2020 13:06:10 -0400 Original-Received: from mail-qk1-f172.google.com ([209.85.222.172]:35401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYYM3-0007kl-6a for 26909@debbugs.gnu.org; Tue, 12 May 2020 13:06:08 -0400 Original-Received: by mail-qk1-f172.google.com with SMTP id f13so13781820qkh.2 for <26909@debbugs.gnu.org>; Tue, 12 May 2020 10:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=pd2CJUDlKoB9Np2LW6Yh77Dv84WtHsnmkoHB0FbrB54=; b=ewleW5liEs48iB1jQzN5NsNV6U2/aJXViTYFg0qyOEHp6Dzh87jGD1weFln8jDvBlk qViZUhQ1yaXNj34VkzwA6nceRCdvIXYbCGxRtBIbxugTlwXOLUkFcglqb+nlQLFsKs1w 1Pbx4Zn51yr5vuwla/iFRtXGKildYErzHyJpkunaYCnvUecZTXAQ4wFE0+Cwkcl5YDPz O+D6fhnnGS38XcynPyleBtmVI/zKwv9Q+9F97Si63S/s03OcShtKMrghl7dYNkT090QJ QUlrKSL5GRm34+xJRk3gvEMtUE2psUMTx1C87Q1MfimJ844lNjaVqyQJ0TNbQv1EHUrn uRjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pd2CJUDlKoB9Np2LW6Yh77Dv84WtHsnmkoHB0FbrB54=; b=YDvPxzU2IEHDS6+5NklL0EvtCZIrW8uEYhP2EGprVRQGliCf90p4XzdldL6p6PKhGK oH/7fPxWU8iL1hdir0Cv4Jry1YRbKhaIVY1Xz6tXEp9wAuQA493HtQ4yfMGQhBEuuGcn ziT5y/cDOxObLU++gp71OXoEAvPHEMPCkDDYBANfjZ32ySYRTgIhuK8yyeFACc3PmguD 2xk/PYN/ZAXOg6dxVGvmLte9opOcfqLS4YSSjeOsXmoXKAyDuHGohGVwDYgT+Ho2UTgd Fjg60/ZiTCX70jT0LLaTFE4JAdeS2BqPTPXYZMa3XOHMCXV5S2/rLOi2bgWMtHfSGw4g ZLKQ== X-Gm-Message-State: AGi0PubMDxCbMZ7r72CXyVEsTeUdykvJCbaAoYIwVvwHfdS1e6sqtS5V wxdWpc04l/qLQGKxu1zLbRtOeUigp3M= X-Google-Smtp-Source: APiQypL2Y69dZT0181Onzh/aD3+1For6thwUImV58/5RkxWVG9x3SIto+ftdcHKGvAqdG1LY1y167w== X-Received: by 2002:ae9:ed95:: with SMTP id c143mr17502066qkg.394.1589303161341; Tue, 12 May 2020 10:06:01 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:4d17:b25e:8d9:2188? ([2601:184:4180:66e7:4d17:b25e:8d9:2188]) by smtp.googlemail.com with ESMTPSA id w43sm4271287qtw.68.2020.05.12.10.06.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2020 10:06:00 -0700 (PDT) In-Reply-To: <83ftc5859u.fsf@gnu.org> Content-Language: en-GB 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:180108 Archived-At: On 12/05/2020 12.52, Eli Zaretskii wrote: >> 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. Got it. > 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. Where the less silly strategy would be to only run the extend_face code when the margins face isn't customized, right? > 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. Hmm, I think the code already does that? At least it seems to work with the patch I sent. >> --- 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? It's because I have no idea what a basic face is, so I just cribbed from places that use the fringe face. It does things like the following, and I have no idea what those mean: face_id = NILP (face) ? lookup_named_face (w, f, Qfringe, false) : lookup_derived_face (w, f, face, FRINGE_FACE_ID, 0); if (face_id < 0) face_id = FRINGE_FACE_ID;