From: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
To: 35452@debbugs.gnu.org
Subject: bug#35452: Line number faces should check for remapping of the default face
Date: Sat, 27 Apr 2019 14:52:10 +0200 [thread overview]
Message-ID: <878svvehl1.fsf@gmail.com> (raw)
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
next reply other threads:[~2019-04-27 12:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-27 12:52 Dario Gjorgjevski [this message]
2019-05-03 9:01 ` bug#35452: Line number faces should check for remapping of the default face Eli Zaretskii
[not found] ` <87a7fmixj1.fsf@gmail.com>
2019-05-16 9:05 ` bug#35452: Fwd: " Dario Gjorgjevski
2019-05-16 13:57 ` Eli Zaretskii
2019-05-16 14:07 ` Dario Gjorgjevski
2019-05-16 14:32 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878svvehl1.fsf@gmail.com \
--to=dario.gjorgjevski@gmail.com \
--cc=35452@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.