From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alp Aker Newsgroups: gmane.emacs.devel Subject: Re: Fill column indicator functionality Date: Sat, 4 May 2019 12:32:51 -0400 Message-ID: References: <20190407200514.2p6gfucdcdsrqe47@Ergus> <83ef6d8c40.fsf@gnu.org> <20190408085102.ozcuvs323ilfid7n@Ergus> <83bm1g8s02.fsf@gnu.org> <20190412134633.g47vybtpkwxyw7dq@Ergus> <834l73mir0.fsf@gnu.org> <20190501110808.27o64tawy2gyjocr@Ergus> <83sgtvn08w.fsf@gnu.org> <20190503174935.5i2gn2nsxr4aezvf@Ergus> <83ftpvmlg2.fsf@gnu.org> <20190503210508.6jeebxmuocjmgva4@Ergus> <83a7g2n20d.fsf@gnu.org> <6439F397-1E34-4E09-8DD3-C50433D98131@aol.com> <83r29elbux.fsf@gnu.org> <87imuqbgqh.fsf@telefonica.net> <83k1f6ky6u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000cb601c0588126b60" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="3663"; mail-complaints-to="usenet@blaine.gmane.org" Cc: =?UTF-8?Q?=C3=93scar_Fuentes?= , Emacs devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 04 18:34:15 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 1hMxc4-0000kX-RS for ged-emacs-devel@m.gmane.org; Sat, 04 May 2019 18:34:13 +0200 Original-Received: from localhost ([127.0.0.1]:58724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMxc3-0004sx-Rt for ged-emacs-devel@m.gmane.org; Sat, 04 May 2019 12:34:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMxb9-0004pN-EM for emacs-devel@gnu.org; Sat, 04 May 2019 12:33:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMxb8-0002kg-8F for emacs-devel@gnu.org; Sat, 04 May 2019 12:33:15 -0400 Original-Received: from mail-ua1-x92c.google.com ([2607:f8b0:4864:20::92c]:39829) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMxay-0002X0-DJ; Sat, 04 May 2019 12:33:04 -0400 Original-Received: by mail-ua1-x92c.google.com with SMTP id v7so870937ual.6; Sat, 04 May 2019 09:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=It1rKwRhyVTjoteS/MeYCi6c0HnA7vEG9cE+v5WiKWA=; b=Uu/UDPhA3nfKNk+4OHdBnrduklw9VVU6TZOx2R8vmFEce0OibRU5rxrBmmHkcAiqOr GestE/Svwftg1KYoPgpD8Aw5UvleT2lMKgQrfbPAWgcMQz/c0J0KSMcob8U5EIubiNmr cN/sTjTZLkgZsweAi2xavlD7DIxfK4EuBnnViZzI4agdnhMmCpwGjdWUdHyCF1Kr2O3X qbQte1wEqgNEbqjOsi56qIUcdmszKnA7wAgur+LrtUXykbcoYbxeQFCksFHtWBqpqpp7 n9J/AappgtmqREPnP+OuFUaCd6WOhMUeFg60SiRoxltXHEFCa1uQynIXuKsLo02YHz99 aJpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=It1rKwRhyVTjoteS/MeYCi6c0HnA7vEG9cE+v5WiKWA=; b=fXVJW0M0WCoMbrVl0O3npO0Fq+vz/L8TvnjZF6Wf6wzdfuaqVi7fhwIlpeFWmWr3kh b34Qp+wHc8TLSO5IczQY87mvlNq08e8Q5JUHHUwIiYayztXmgw0GP6VHXAx0nQotk3wm 6p50NVxe0FwvofP3jj1Ldhl7UuaEDIvBVTqDj2wXPjXIbjX80NZPQs77wMPj8K3tpXYc MImwi8KONoQLmiDh8CohXkrpMnqgitUzOBHRpU9+ntc5z/FYMvoBY2oGVX/eVMOsabln PMUyFaHFaiQmhbJfMzeYvQmAINqAic6hGtUQvCemLqeq/QLZ5GfFrOphusdbj+wv+OXj MhbQ== X-Gm-Message-State: APjAAAUMNjCCOdLnZ8BlRjsUgj9mzXEHLGBnlv2XlVIzB54s1zbz9T68 j4Cw/n1yGGOvMg4oG9SPMXalBuzXd//Acva1EnyjotA/ X-Google-Smtp-Source: APXvYqxCcsCC4mjbbcoBcEU5fDvCFJutVFmXkClISyILq2vWVgocimZlD9gJAR8bTIklSUlWbZ0/SRAvuKym+Px3GFc= X-Received: by 2002:ab0:63d0:: with SMTP id i16mr8559045uap.73.1556987582831; Sat, 04 May 2019 09:33:02 -0700 (PDT) In-Reply-To: <83k1f6ky6u.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::92c 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:236157 Archived-At: --000000000000cb601c0588126b60 Content-Type: text/plain; charset="UTF-8" > > User customization could be accommodated by something like the below (naive) patch. We define > > fill-column-indicator face to have unspecified background; when displaying the indicator we merge the > > indicator face into the current it->face_id (the same face used for the stretch glyph preceding the indicator). > > What about the case there's no stretch, i.e. the indicator directly > follows the last character of the line? Apologies for my poor phrasing, but I think you might misunderstand the intent. I meant that we use the background that is in effect before we draw anything related to the indicator, not that we take the face *from* the stretch glyph. I did miss that the indicator is also drawn in append_space_for_newline. Revised patch below. diff --git a/lisp/faces.el b/lisp/faces.el index b933279064..207b627f25 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2502,7 +2502,9 @@ line-number-current-line ;; Definition stolen from display-line-numbers. (defface fill-column-indicator - '((t :inherit (shadow default))) + '((t :inherit shadow :weight normal :slant normal + :underline nil :overline nil :strike-through nil + :box nil :invert-video nil :stipple nil)) "Face for displaying fill column indicator. This face is used when `display-fill-column-indicator-mode' is non-nil." diff --git a/src/xdisp.c b/src/xdisp.c index 1782748144..61ea050b4a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20201,7 +20201,7 @@ append_space_for_newline (struct it *it, bool default_face_p) XFIXNAT (Vdisplay_fill_column_indicator_character); it->face_id = merge_faces (it->w, Qfill_column_indicator, - 0, DEFAULT_FACE_ID); + 0, saved_face_id); face = FACE_FROM_ID(it->f, it->face_id); goto produce_glyphs; } @@ -20494,7 +20494,7 @@ extend_face_to_end_of_line (struct it *it) XFIXNAT (Vdisplay_fill_column_indicator_character); it->face_id = merge_faces (it->w, Qfill_column_indicator, - 0, DEFAULT_FACE_ID); + 0, saved_face_id); PRODUCE_GLYPHS (it); } @@ -20658,7 +20658,7 @@ extend_face_to_end_of_line (struct it *it) { const int saved_face = it->face_id; it->face_id = - merge_faces (it->w, Qfill_column_indicator, 0, DEFAULT_FACE_ID); + merge_faces (it->w, Qfill_column_indicator, 0, saved_face); it->c = it->char_to_display = XFIXNAT (Vdisplay_fill_column_indicator_character); PRODUCE_GLYPHS (it); --000000000000cb601c0588126b60 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> > User customization could be acc= ommodated by something like the below (naive) patch.=C2=A0 We define
>= ; > fill-column-indicator face to have unspecified background; when disp= laying the indicator we merge the
> > indicator face into the curr= ent it->face_id (the same face used for the stretch glyph preceding the = indicator).
>
> What about the case there's no stretch, i.e= . the indicator directly
> follows the last character of the line?
Apologies for my poor phrasing, but I think you might misu= nderstand the intent.=C2=A0 I meant that we use the background that is in e= ffect before we draw anything related to the indicator, not that we take th= e face *from* the stretch glyph.=C2=A0=C2=A0

I did= miss that the indicator is also drawn in append_space_for_newline.=C2=A0 R= evised patch below.

diff --git a/lisp/faces.e= l b/lisp/faces.el
index b933279064..207b627f25 100644
-= -- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2502,7 +2502= ,9 @@ line-number-current-line
=C2=A0
=C2=A0;; Definiti= on stolen from display-line-numbers.
=C2=A0(defface fill-column-i= ndicator
-=C2=A0 '((t :inherit (shadow default)))
+= =C2=A0 '((t :inherit shadow :weight normal :slant normal
+=C2= =A0 =C2=A0 =C2=A0 =C2=A0:underline nil :overline nil :strike-through nil
+=C2=A0 =C2=A0 =C2=A0 =C2=A0:box nil :invert-video nil :stipple nil= ))
=C2=A0 =C2=A0"Face for displaying fill column indicator.<= /div>
=C2=A0This face is used when `display-fill-column-indicator-mode&= #39; is
=C2=A0non-nil."
diff --git a/src/xdisp.c b= /src/xdisp.c
index 1782748144..61ea050b4a 100644
--- a/= src/xdisp.c
+++ b/src/xdisp.c
@@ -20201,7 +20201,7 @@ a= ppend_space_for_newline (struct it *it, bool default_face_p)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0XFIXNAT (Vd= isplay_fill_column_indicator_character);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0it->face_= id =3D
=C2=A0 =C2=A0 =C2= =A0 =C2=A0merge_faces (it->w, Qfill_column_indicator,
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 0, DEFAULT_FACE_ID);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 0, saved_face_id);
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0face =3D FACE_FROM_ID(it-&= gt;f, it->face_id);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto produce_glyphs;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0}
@@ -20494,7 +20494,7 @@ extend_face_to_end_of_line (struc= t it *it)
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 XFIXNAT (Vdisplay_fill_col= umn_indicator_character);
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 it->face_id =3D<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 merge_faces (it->w, Qfill_column_= indicator,
- =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=A00, DEFAULT_FACE_ID);
+=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 0, saved_face_id);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 PRODUCE_GLYPHS (it);
=C2=A0 <= /span>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0
@@ -20658,7 +20658,7 @@ extend_face_to_end_of_line (struct it *it)
<= div>=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 it->face_id =3D
- =C2=A0 =C2=A0 merge_faces (it->w, Qfill_column_indi= cator, 0, DEFAULT_FACE_ID);
+ =C2=A0 =C2=A0 merge_faces (it->w, Qfill_column_indicator, 0, saved_= face);
=C2=A0 =C2=A0 it-&= gt;c =3D it->char_to_display =3D
=C2=A0 =C2=A0 =C2=A0 XFIXNAT (Vdisplay_fill_column_indicator_cha= racter);
=C2=A0 =C2=A0 PR= ODUCE_GLYPHS (it);


--000000000000cb601c0588126b60--