Subject: bug#35452: closed (Re: bug#35452: Line number faces should check for remapping of the default face)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 16 May 2019 14:34:01 +0000

Your bug report

#35452: Line number faces should check for remapping of the default face

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
35452: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35452
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#35452: Line number faces should check for remapping of the default face
From: Eli Zaretskii <[email-masked]>
To: Dario Gjorgjevski <[email-masked]>
Cc: [email-masked]
Date: Thu, 16 May 2019 17:32:56 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Dario Gjorgjevski <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 16 May 2019 16:07:25 +0200
> 
> > So you agree that this bug should be closed without changing the
> > current code?
> >
> > Thanks.
> 
> Yes.  Thank you likewise.

Thanks, done.

Subject: Line number faces should check for remapping of the default face
From: Dario Gjorgjevski <[email-masked]>
To: [email-masked]
Date: Sat, 27 Apr 2019 14:52:10 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Currently, the line number faces do not check for remapping of the
default face and use its attributes directly.  In the default
configuration, this has no adverse effects since the `line-number' face
inherits from `default' explicitly, so any remapping is considered there.

However, there is no need to have `line-number' inherit from `default'
explicitly since it already merges DEFAULT_FACE_ID.  Instead, we can
check for remapping of DEFAULT_FACE_ID prior to merging the faces.

The patch shown below accomplishes that.

diff --git a/src/xdisp.c b/src/xdisp.c
index d52d1333a0..1e7e31fb8a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -21176,9 +21176,10 @@ maybe_produce_line_number (struct it *it)
   char lnum_buf[INT_STRLEN_BOUND (ptrdiff_t) + 1];
   bool beyond_zv = IT_BYTEPOS (*it) >= ZV_BYTE ? true : false;
   ptrdiff_t lnum_offset = -1; /* to produce 1-based line numbers */
-  int lnum_face_id = merge_faces (it->w, Qline_number, 0, DEFAULT_FACE_ID);
+  int base_face_id = lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID);
+  int lnum_face_id = merge_faces (it->w, Qline_number, 0, base_face_id);
   int current_lnum_face_id
-    = merge_faces (it->w, Qline_number_current_line, 0, DEFAULT_FACE_ID);
+    = merge_faces (it->w, Qline_number_current_line, 0, base_face_id);
   /* Compute point's line number if needed.  */
   if ((EQ (Vdisplay_line_numbers, Qrelative)
        || EQ (Vdisplay_line_numbers, Qvisual)

-- 
Dario Gjorgjevski :: +389 (0)70 784 142