From 6ba05106f4e29af8434885134306a25ba00ef983 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 9 May 2026 08:58:59 +0300 Subject: [PATCH] Fix display images in the display margins * src/xdisp.c (handle_single_display_spec): Set the iterator face to use 'margin' when displaying in the margins. (Bug#80693) --- src/xdisp.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 773aba2789f..b485d9ccf40 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -6534,10 +6534,19 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, if (NILP (location)) it->area = TEXT_AREA; - else if (EQ (location, Qleft_margin)) - it->area = LEFT_MARGIN_AREA; else - it->area = RIGHT_MARGIN_AREA; + { + if (EQ (location, Qleft_margin)) + it->area = LEFT_MARGIN_AREA; + else + it->area = RIGHT_MARGIN_AREA; + /* Use the 'margin' face for displaying text and images + in the margins. */ + it->face_id = + NILP (Vface_remapping_alist) + ? MARGIN_FACE_ID + : lookup_basic_face (it->w, it->f, MARGIN_FACE_ID); + } if (STRINGP (value)) {