diff options
| author | Dmitry Antipov | 2013-08-13 12:18:11 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-08-13 12:18:11 +0400 |
| commit | a45543bc75e845c9217130c65ddd00a81c18ffd1 (patch) | |
| tree | 2d09d300e4d7c211389215e2c991c57162689d47 /src/font.c | |
| parent | ae966a860afc2d7ebbb1e96a68c2df3cfbdc2b81 (diff) | |
| download | emacs-a45543bc75e845c9217130c65ddd00a81c18ffd1.tar.gz emacs-a45543bc75e845c9217130c65ddd00a81c18ffd1.zip | |
* font.c (clear_font_cache): New function, stripped from...
(Fclear_font_cache): ...here, which now uses the function
above. Adjust comment.
* font.h (clear_font_cache): Add prototype.
* xfaces.c (clear_face_cache): Use clear_font_cache.
Diffstat (limited to 'src/font.c')
| -rw-r--r-- | src/font.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/font.c b/src/font.c index 073487b540d..6a8262623dc 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -4226,36 +4226,38 @@ the consecutive wildcards are folded into one. */) | |||
| 4226 | return make_string (name, namelen); | 4226 | return make_string (name, namelen); |
| 4227 | } | 4227 | } |
| 4228 | 4228 | ||
| 4229 | void | ||
| 4230 | clear_font_cache (struct frame *f) | ||
| 4231 | { | ||
| 4232 | struct font_driver_list *driver_list = f->font_driver_list; | ||
| 4233 | |||
| 4234 | for (; driver_list; driver_list = driver_list->next) | ||
| 4235 | if (driver_list->on) | ||
| 4236 | { | ||
| 4237 | Lisp_Object val, tmp, cache = driver_list->driver->get_cache (f); | ||
| 4238 | |||
| 4239 | val = XCDR (cache); | ||
| 4240 | while (! NILP (val) | ||
| 4241 | && ! EQ (XCAR (XCAR (val)), driver_list->driver->type)) | ||
| 4242 | val = XCDR (val); | ||
| 4243 | eassert (! NILP (val)); | ||
| 4244 | tmp = XCDR (XCAR (val)); | ||
| 4245 | if (XINT (XCAR (tmp)) == 0) | ||
| 4246 | { | ||
| 4247 | font_clear_cache (f, XCAR (val), driver_list->driver); | ||
| 4248 | XSETCDR (cache, XCDR (val)); | ||
| 4249 | } | ||
| 4250 | } | ||
| 4251 | } | ||
| 4252 | |||
| 4229 | DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0, | 4253 | DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0, |
| 4230 | doc: /* Clear font cache. */) | 4254 | doc: /* Clear font cache of each frame. */) |
| 4231 | (void) | 4255 | (void) |
| 4232 | { | 4256 | { |
| 4233 | Lisp_Object list, frame; | 4257 | Lisp_Object list, frame; |
| 4234 | 4258 | ||
| 4235 | FOR_EACH_FRAME (list, frame) | 4259 | FOR_EACH_FRAME (list, frame) |
| 4236 | { | 4260 | clear_font_cache (XFRAME (frame)); |
| 4237 | struct frame *f = XFRAME (frame); | ||
| 4238 | struct font_driver_list *driver_list = f->font_driver_list; | ||
| 4239 | |||
| 4240 | for (; driver_list; driver_list = driver_list->next) | ||
| 4241 | if (driver_list->on) | ||
| 4242 | { | ||
| 4243 | Lisp_Object cache = driver_list->driver->get_cache (f); | ||
| 4244 | Lisp_Object val, tmp; | ||
| 4245 | |||
| 4246 | val = XCDR (cache); | ||
| 4247 | while (! NILP (val) | ||
| 4248 | && ! EQ (XCAR (XCAR (val)), driver_list->driver->type)) | ||
| 4249 | val = XCDR (val); | ||
| 4250 | eassert (! NILP (val)); | ||
| 4251 | tmp = XCDR (XCAR (val)); | ||
| 4252 | if (XINT (XCAR (tmp)) == 0) | ||
| 4253 | { | ||
| 4254 | font_clear_cache (f, XCAR (val), driver_list->driver); | ||
| 4255 | XSETCDR (cache, XCDR (val)); | ||
| 4256 | } | ||
| 4257 | } | ||
| 4258 | } | ||
| 4259 | 4261 | ||
| 4260 | return Qnil; | 4262 | return Qnil; |
| 4261 | } | 4263 | } |