From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Fill column indicator functionality Date: Sun, 17 Mar 2019 19:03:10 +0100 Message-ID: <3A8B034F-4D85-4136-AF2C-F87266D7FB73@aol.com> References: <20190312192017.fkfd4h5gsbdue5q3@Ergus> <83imwm3fxf.fsf@gnu.org> <20190313200225.dpqrw7xthkj47fqw@Ergus> <83bm2e35a1.fsf@gnu.org> <20190314030224.l5zseslncw3xc5ox@Ergus> <835zsm2c2s.fsf@gnu.org> <20190314165147.gmtwgzqaibwbzhbm@Ergus> <83r2b91flg.fsf@gnu.org> <20190314211313.giyz7p6jtmquabea@Ergus> <83bm2c1smi.fsf@gnu.org> <20190315205626.4ulamwcaojxnhfu6@Ergus> <83y35fxawz.fsf@gnu.org> <23c888a1-66ba-5f98-cd32-567457af84d8@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----W24HE6ME8X2N4BL44JUE943RAY80AB" Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="180176"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: K-9 Mail for Android To: emacs-devel@gnu.org,Alp Aker Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 17 19:24:25 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5aSO-000kor-En for ged-emacs-devel@m.gmane.org; Sun, 17 Mar 2019 19:24:24 +0100 Original-Received: from localhost ([127.0.0.1]:58614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5aSN-0005oi-CX for ged-emacs-devel@m.gmane.org; Sun, 17 Mar 2019 14:24:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5aS6-0005eL-6k for emacs-devel@gnu.org; Sun, 17 Mar 2019 14:24:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5aHc-0000nT-0s for emacs-devel@gnu.org; Sun, 17 Mar 2019 14:13:17 -0400 Original-Received: from sonic309-25.consmr.mail.ir2.yahoo.com ([77.238.179.83]:43676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5aHb-0000mS-51 for emacs-devel@gnu.org; Sun, 17 Mar 2019 14:13:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1552846392; bh=rvUb3TgPm/nwerd2463rFHtRNncInxhZM1I6VoKQO/s=; h=Date:In-Reply-To:References:Subject:To:From:From:Subject; b=AAaoSXG8ImMCMczZddiz6C3MkvEVubmLlVRkmq5/19W0g8D61oul4MYMLc8Aflvei3+3xo7PzManWr/1mhV22tzLzzwGvnkPou2AB1pqdk09Ln8CtZhIld7b1w+tAcwlAKOK53P7pMu0ppGmLkCWbR9vF+V7OWgGE/Tq11HnXGI7+hC0Ws1KpS1pMD9ErV7vqF/27o4ODem4H2U59dzdMJXJ+JbLloXSrCKmQqu9wlvX2UnZWFNlh0pu/P/q8WZ5IbsKkbiopPcUR1KhZJ/pJCl9l37POl+jCKb10EoQ7Zbujw8l9y91AhbPo/aomnW926nrAhfpN68s/GsMPUcAkQ== X-YMail-OSG: Ent4rK8VM1lCldqj70xYrr_LV.Yr6QAi69X1v3F5Oq9TaQEU_uJJhtPShtr85Ii dpz4vebyae9pJbaVk09JJX6gyRuU_SzPyduk22LfPMNfqandqB_ttVBvXUE3ShLB18b8lteyYRvO JIPsGFevcMiLHOV240br7XyYmdJiFtOXsLjxqA_NWdoemZQMBIoZfvOpodvbdQ3Yl0xbWkFyzxz. heeDKuy.g7c6Vaw7Ncs3209or8Q3PpIFUT_hGI5NRHGzp6BEshL7AHXctmXYFc0d0or5pwmdw40D bB7oTfEHf7s9KLH3FGbNYrYdbre4RVvJ.LLjxL3AvLooS6jB9eVLiASt4i5Vu7dWkfOCGGz5Fvnu Bpy0Q4j1r4I6f_apWuj3JPEr7BwIyMSGqvE6PhA_GAzpfBTNfKgNrK.xirSwPshzPRfSCdjHgoIz 3AQr0pGcEEsMoQb2KkvBFztFQEwe.BOTrvq7IQ4tP7ETdrVO8pprr51JWqCB9DWNf7XagXHfLEf8 F4LvOOM_DZEdE2_DvvOWQFMfCBhTOkqOJzNYW9IvAUpi4.HmgHucKocs3EsOMi6XJ1ukS1Ulvs8i HTw3H2JDng_lvoCT42QC.EkbuiWJc5Z61vMjDZdvfrLpGf.tmlCxdPvb.u5CDvwpfjTJRCRAZXqm rLUr5_fQ0MkPROUCCAc2FBikRcGH2fZlYmOvOJlAa71zc.kwbcBX_7jQkeRWMS3IAxycmD0HIynQ oQHcq6ZurJq0wnoY4YLgYBDnkcMt_x1JnI1TanoDK47upiB9onx0VcqYs_6KBAs_qO4haf_S7ksF GeMwf8V1NgCWYiJb27uDXLPIYVyf8fYl.JcSOROZy3 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ir2.yahoo.com with HTTP; Sun, 17 Mar 2019 18:13:12 +0000 Original-Received: from 31.177.96.121 (EHLO [10.161.125.252]) ([31.177.96.121]) by smtp428.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 48a6367b70c9562b572fa45276d573ce; Sun, 17 Mar 2019 18:13:08 +0000 (UTC) In-Reply-To: <23c888a1-66ba-5f98-cd32-567457af84d8@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 77.238.179.83 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234289 Archived-At: ------W24HE6ME8X2N4BL44JUE943RAY80AB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi The version on github is outdated=2E I have a workaround for that backgrow= nd issue in a patch I sent to Eli (in this mailing list) on yesterday=2E Pl= ease try that one and check if you experience the same problems=2E I will update the github code latter because i am doing some changes in th= e lisp interface now=2E On 17 March 2019 18:28:22 CET, Alp Aker w= rote: >>> In graphical interfaces the space after the line is always filled >with >>> the background color of the face of the last produced glyph, even if >I >>> reset it to the saved value after the generation=2E The only solution >I >>> found so far was to add an extra glyph after reset the face to the >>> default (saved) value, but hopefully there is a better way? >> I don't think I understand what face is "the face of the last >produced >> glyph"=2E is that the face of the indicator character, is that the >> default face, or is that something else? Can you show a screenshot? >I noticed an issue with non-default backgrounds that span newlines, >such=20 >as happens with region highlighting=2E I believe I ran into what Ergus is > >describing while working on a fix (see (3) below)=2E=C2=A0 The version of= the=20 >code I looked at was 9dcaa15e5a, from Ergus's Github repo=2E > >You can see the issue with non-default backgrounds in the attached=20 >screenshots mode-off=2Epng and mode-on=2Epng; activating=20 >display-fill-column-indicator-mode truncates the highlighting on each=20 >line=2E=C2=A0 To fix: > >1=2E The stretch glyph needs to be drawn in the current face, not the=20 >fill_column face=2E > >2=2E The default fill-column face should have an unspecified background= =20 >and it should be merged into the current face during display, not into=20 >the default face=2E > >3=2E If the fill-column face specifies a background, we need to reset the > >face to the saved face after producing the indicator glyph=2E Here I >found=20 >it necessary to insert another display element in order for the face=20 >change to take effect before the background is extended to the end of=20 >the line=2E (I used a 0-width stretch glyph=2E)=C2=A0 Without that, the= =20 >fill-column face is used (see the attached c=2Epng for a screenshot)=2E= =C2=A0 I=20 >believe this need to add another display element at the end of the line > >is what Ergus was asking about=2E > > >diff --git a/lisp/faces=2Eel b/lisp/faces=2Eel >index 153e6a208f=2E=2E6b9980a77f 100644 >--- a/lisp/faces=2Eel >+++ b/lisp/faces=2Eel >@@ -2504,7 +2504,7 @@ line-number-current-line > > =C2=A0;; Definition stolen from linum=2Eel=2E > =C2=A0(defface fill-column >-=C2=A0 '((t :inherit (shadow default))) >+=C2=A0 '((t :inherit (shadow))) > =C2=A0=C2=A0 "Face for displaying fill column indicator line=2E > =C2=A0This face is used when `display-fill-column-indicator-mode' is > =C2=A0non-nil=2E > >diff --git a/src/xdisp=2Ec b/src/xdisp=2Ec >index 8ac4be8dc7=2E=2E7c4f9889eb 100644 >--- a/src/xdisp=2Ec >+++ b/src/xdisp=2Ec >@@ -20416,21 +20416,23 @@ extend_face_to_end_of_line (struct it *it) > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int stretch_asce= nt =3D (((it->ascent + it->descent) > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 * FONT_BA= SE (font)) / FONT_HEIGHT (font)); > >-=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->char_to_display = =3D=20 >XFIXNAT(Vdisplay_fill_column_indicator_character); > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 memset (&it->pos= ition, 0, sizeof it->position); > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->avoid_cursor= _p =3D true; >-=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->face_id =3D merge_= faces (it->w, Qfill_column, 0,=20 >DEFAULT_FACE_ID); > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->start_of_box= _run_p =3D false; > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->object =3D Q= nil; > > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 append_stretch_g= lyph (it, Qnil, stretch_width, >=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->ascent + it->descent, >stretch_ascent); > >+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->char_to_display = =3D=20 >XFIXNAT(Vdisplay_fill_column_indicator_character); >+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->face_id =3D merge_= faces (it->w, Qfill_column, 0,=20 >saved_face_id); > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PRODUCE_GLYPHS (= it); > >+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->face_id =3D saved_= face_id; >+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 append_stretch_glyph (= it, Qnil, 0, it->ascent + it->descent, >+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 stretch_ascent); > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->position =3D= saved_pos; > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->avoid_cursor= _p =3D saved_avoid_cursor; >-=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->face_id =3D saved_= face_id; > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->start_of_box= _run_p =3D saved_box_start; > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->char_to_disp= lay =3D saved_char; > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 it->object =3D s= ave_object; >@@ -20566,7 +20568,7 @@ extend_face_to_end_of_line (struct it *it) > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (it->current_= x =3D=3D fill_column_indicator_line) > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 const int saved_face = =3D it->face_id; >-=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 it->face_id =3D merge_faces= (it->w, Qfill_column, 0,=20 >DEFAULT_FACE_ID); >+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 it->face_id =3D merge_faces= (it->w, Qfill_column, 0, >saved_face); > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 it->c =3D it->char_to= _display =3D=20 >XFIXNAT(Vdisplay_fill_column_indicator_character); > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 PRODUCE_GLYPHS (it); > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 it->face_id =3D saved= _face; ------W24HE6ME8X2N4BL44JUE943RAY80AB Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi

The version on github is outdated=2E I h= ave a workaround for that backgrownd issue in a patch I sent to Eli (in thi= s mailing list) on yesterday=2E Please try that one and check if you experi= ence the same problems=2E
I will update the github code latter because i= am doing some changes in the lisp interface now=2E

On 17 March 2019 18:28:22 CET, Alp Aker <alp=2Etekin=2Eaker@g= mail=2Ecom> wrote:
In graphical interfaces the s= pace after the line is always filled with
the background color of the fa= ce of the last produced glyph, even if I
reset it to the saved value aft= er the generation=2E The only solution I
found so far was to add an extr= a glyph after reset the face to the
default (saved) value, but hopefully= there is a better way?
I don't think I understand what fac= e is "the face of the last produced
glyph"=2E is that the face of the i= ndicator character, is that the
default face, or is that something else?= Can you show a screenshot?
I noticed an issue with non-de= fault backgrounds that span newlines, such
as happens with region highl= ighting=2E I believe I ran into what Ergus is
describing while working = on a fix (see (3) below)=2E  The version of the
code I looked at w= as 9dcaa15e5a, from Ergus's Github repo=2E

You can see the issue wit= h non-default backgrounds in the attached
screenshots mode-off=2Epng an= d mode-on=2Epng; activating
display-fill-column-indicator-mode truncate= s the highlighting on each
line=2E  To fix:

1=2E The stretc= h glyph needs to be drawn in the current face, not the
fill_column face= =2E

2=2E The default fill-column face should have an unspecified bac= kground
and it should be merged into the current face during display, n= ot into
the default face=2E

3=2E If the fill-column face specifi= es a background, we need to reset the
face to the saved face after prod= ucing the indicator glyph=2E Here I found
it necessary to insert anothe= r display element in order for the face
change to take effect before th= e background is extended to the end of
the line=2E (I used a 0-width st= retch glyph=2E)  Without that, the
fill-column face is used (see t= he attached c=2Epng for a screenshot)=2E  I
believe this need to a= dd another display element at the end of the line
is what Ergus was ask= ing about=2E


diff --git a/lisp/faces=2Eel b/lisp/faces=2Eel
i= ndex 153e6a208f=2E=2E6b9980a77f 100644
--- a/lisp/faces=2Eel
+++ b/li= sp/faces=2Eel
@@ -2504,7 +2504,7 @@ line-number-current-line

&nb= sp;;; Definition stolen from linum=2Eel=2E
 (defface fill-column-  '((t :inherit (shadow default)))
+  '((t :inherit (shadow= )))
   "Face for displaying fill column indicator line=2E
=  This face is used when `display-fill-column-indicator-mode' is
&= nbsp;non-nil=2E

diff --git a/src/xdisp=2Ec b/src/xdisp=2Ec
index = 8ac4be8dc7=2E=2E7c4f9889eb 100644
--- a/src/xdisp=2Ec
+++ b/src/xdisp= =2Ec
@@ -20416,21 +20416,23 @@ extend_face_to_end_of_line (struct it *it= )
           int stretch_a= scent =3D (((it->ascent + it->descent)
     &= nbsp;       * FONT_BASE (font)) / FONT_HEIGHT (fon= t));

-          it->char_= to_display =3D
XFIXNAT(Vdisplay_fill_column_indicator_character);
&= nbsp;          memset (&it->= position, 0, sizeof it->position);
      &n= bsp;    it->avoid_cursor_p =3D true;
-  &nbs= p;       it->face_id =3D merge_faces (it->w,= Qfill_column, 0,
DEFAULT_FACE_ID);
      =      it->start_of_box_run_p =3D false;
 &nb= sp;         it->object =3D Qnil;
<= br>            append_stretch_= glyph (it, Qnil, stretch_width,
       &n= bsp;            = ;             i= t->ascent + it->descent, stretch_ascent);

+    =       it->char_to_display =3D
XFIXNAT(Vdisp= lay_fill_column_indicator_character);
+      &n= bsp;   it->face_id =3D merge_faces (it->w, Qfill_column, 0,=
saved_face_id);
         &= nbsp; PRODUCE_GLYPHS (it);

+       &nb= sp;  it->face_id =3D saved_face_id;
+     &n= bsp;    append_stretch_glyph (it, Qnil, 0, it->ascent + i= t->descent,
+         &n= bsp;            = ;       stretch_ascent);
  &nbs= p;        it->position =3D saved_pos;
=            it->avoid_cursor= _p =3D saved_avoid_cursor;
-        &= nbsp; it->face_id =3D saved_face_id;
      =      it->start_of_box_run_p =3D saved_box_start;
=            it->char_to_dis= play =3D saved_char;
         &= nbsp; it->object =3D save_object;
@@ -20566,7 +20568,7 @@ extend_face= _to_end_of_line (struct it *it)
       &n= bsp;   if (it->current_x =3D=3D fill_column_indicator_line)              {
=            const int saved_face = =3D it->face_id;
-          it->= ;face_id =3D merge_faces (it->w, Qfill_column, 0,
DEFAULT_FACE_ID);<= br>+          it->face_id =3D merge_f= aces (it->w, Qfill_column, 0, saved_face);
     =       it->c =3D it->char_to_display =3D
XFIXN= AT(Vdisplay_fill_column_indicator_character);
     =       PRODUCE_GLYPHS (it);
    =       it->face_id =3D saved_face;

------W24HE6ME8X2N4BL44JUE943RAY80AB--