commit 0af1850485f3ad1519e52de2b1694efa922917f4 Author: Pip Cet Date: Sat Jun 22 07:53:28 2019 +0000 snapshot diff --git a/src/callint.c b/src/callint.c index 88a3c348d0..6f2e5d5066 100644 --- a/src/callint.c +++ b/src/callint.c @@ -824,6 +824,7 @@ syms_of_callint (void) DEFSYM (Qlet, "let"); DEFSYM (Qif, "if"); DEFSYM (Qwhen, "when"); + DEFSYM (Qgen, "gen"); DEFSYM (Qletx, "let*"); DEFSYM (Qsave_excursion, "save-excursion"); DEFSYM (Qprogn, "progn"); diff --git a/src/xdisp.c b/src/xdisp.c index 5699aac61b..717fb30ec3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2728,7 +2728,6 @@ safe_call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2) return safe_call (3, fn, arg1, arg2); } - /*********************************************************************** Debugging @@ -4893,6 +4892,7 @@ handle_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, #endif && !EQ (XCAR (spec), Qspace) && !EQ (XCAR (spec), Qwhen) + && !EQ (XCAR (spec), Qgen) && !EQ (XCAR (spec), Qslice) && !EQ (XCAR (spec), Qspace_width) && !EQ (XCAR (spec), Qheight) @@ -4991,6 +4991,8 @@ display_prop_end (struct it *it, Lisp_Object object, struct text_pos start_pos) Value is non-zero if something was found which replaces the display of buffer or string text. */ +extern Lisp_Object *lface_id_to_name; + static int handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, Lisp_Object overlay, struct text_pos *position, @@ -5002,6 +5004,46 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, struct text_pos start_pos = *position; void *itdata = NULL; + if (it != NULL && + CONSP (spec) && + EQ (XCAR (spec), Qgen)) + { + spec = XCDR (spec); + if (!CONSP (spec)) + return 0; + Lisp_Object gen = XCAR (spec); + struct face *face = FACE_FROM_ID (it->f, it->face_id); + Lisp_Object lface = Qnil; + Lisp_Object props[] = { + QCtype, + QCfamily, + QCfoundry, + QCwidth, + QCheight, + QCweight, + QCslant, + QCunderline, + QCinverse_video, + QCforeground, + QCbackground, + QCstipple, + QCoverline, + QCstrike_through, + QCbox, + QCfont, + QCinherit, + QCfontset, + QCdistant_foreground, + }; + for (int i = 0; i < LFACE_VECTOR_SIZE; i++) + lface = Fcons (Fcons (props[i], face->lface[i]), + lface); + Lisp_Object font = Qnil; + XSETFONT (font, face->font); + lface = Fcons (Fcons (QCfont, font), lface); + spec = safe_call1 (gen, lface); + } + /* If SPEC is a list of the form `(when FORM . VALUE)', evaluate FORM. If the result is non-nil, use VALUE instead of SPEC. */ form = Qt; diff --git a/src/xfaces.c b/src/xfaces.c index 012cc96470..47453c2b31 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -294,7 +294,7 @@ #define FACE_CACHE_BUCKETS_SIZE 1001 /* A vector mapping Lisp face Id's to face names. */ -static Lisp_Object *lface_id_to_name; +Lisp_Object *lface_id_to_name; static ptrdiff_t lface_id_to_name_size; #ifdef HAVE_WINDOW_SYSTEM