diff options
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2019-06-20 12:12:01 +0900 |
---|---|---|
committer | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2019-06-20 12:12:01 +0900 |
commit | fdbbbf94a5ed233571478d94c812644bdfaeb600 (patch) | |
tree | b2a3da89298a8547c31822af20597872258ea636 | |
parent | 0701634aa788b316f331ccbb6c44dfd8304a271d (diff) | |
download | emacs-fdbbbf94a5ed233571478d94c812644bdfaeb600.tar.gz |
Change font_put_extra value for property removal from Qnil to Qunbound
* font.c (font_put_extra): If VAL is Qunbound, delete the slot for PROP from
the list of extra properties. Previous value Qnil is valid as boolean.
(font_clear_prop): Changed argument of font_put_extra for property removal.
-rw-r--r-- | src/font.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/font.c b/src/font.c index 964028ccf00..992f9e03fea 100644 --- a/src/font.c +++ b/src/font.c @@ -710,7 +710,9 @@ font_prop_validate (int idx, Lisp_Object prop, Lisp_Object val) /* Store VAL as a value of extra font property PROP in FONT while - keeping the sorting order. Don't check the validity of VAL. */ + keeping the sorting order. Don't check the validity of VAL. If + VAL is Qunbound, delete the slot for PROP from the list of extra + properties. */ Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val) @@ -722,6 +724,8 @@ font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val) { Lisp_Object prev = Qnil; + if (EQ (val, Qunbound)) + return val; while (CONSP (extra) && NILP (Fstring_lessp (prop, XCAR (XCAR (extra))))) prev = extra, extra = XCDR (extra); @@ -734,7 +738,7 @@ font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val) return val; } XSETCDR (slot, val); - if (NILP (val)) + if (EQ (val, Qunbound)) ASET (font, FONT_EXTRA_INDEX, Fdelq (slot, extra)); return val; } @@ -3055,7 +3059,7 @@ font_clear_prop (Lisp_Object *attrs, enum font_property_index prop) if (! NILP (Ffont_get (font, QCname))) { font = copy_font_spec (font); - font_put_extra (font, QCname, Qnil); + font_put_extra (font, QCname, Qunbound); } if (NILP (AREF (font, prop)) |