diff options
| author | Stefan Monnier | 2008-06-20 01:53:32 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-06-20 01:53:32 +0000 |
| commit | 770e2e6ed85e3c3fdf1f770ccbcb7f3120370c05 (patch) | |
| tree | 66a9c8e4873bd1c6455cca1558529877ce2753d2 /src | |
| parent | 22e64f7c64f1e79062eb1f4925ffe54af33d9de5 (diff) | |
| download | emacs-770e2e6ed85e3c3fdf1f770ccbcb7f3120370c05.tar.gz emacs-770e2e6ed85e3c3fdf1f770ccbcb7f3120370c05.zip | |
* w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
for explicit `font' parameters.
* frame.c (x_set_font): Remove unexplained call to fix inf-recursion.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/frame.c | 8 | ||||
| -rw-r--r-- | src/w32fns.c | 15 | ||||
| -rw-r--r-- | src/xfns.c | 13 |
4 files changed, 33 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bd8d02017ae..43f9f1f2154 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2008-06-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param' | ||
| 4 | for explicit `font' parameters. | ||
| 5 | |||
| 6 | * frame.c (x_set_font): Remove unexplained call to fix inf-recursion. | ||
| 7 | |||
| 1 | 2008-06-19 Kenichi Handa <handa@m17n.org> | 8 | 2008-06-19 Kenichi Handa <handa@m17n.org> |
| 2 | 9 | ||
| 3 | * frame.c: Include <ctype.h>. | 10 | * frame.c: Include <ctype.h>. |
diff --git a/src/frame.c b/src/frame.c index 761e6cc9a77..6320d0ca1ff 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -3400,7 +3400,13 @@ x_set_font (f, arg, oldval) | |||
| 3400 | if (FRAME_FACE_CACHE (f)) | 3400 | if (FRAME_FACE_CACHE (f)) |
| 3401 | { | 3401 | { |
| 3402 | XSETFRAME (frame, f); | 3402 | XSETFRAME (frame, f); |
| 3403 | call1 (Qface_set_after_frame_default, frame); | 3403 | /* We used to call face-set-after-frame-default here, but it leads to |
| 3404 | recursive calls (since that function can set the `default' face's | ||
| 3405 | font which in turns changes the frame's `font' parameter). | ||
| 3406 | Also I don't know what this call is meant to do, but it seems the | ||
| 3407 | wrong way to do it anyway (it does a lot more work than what seems | ||
| 3408 | reasonable in response to a change to `font'). */ | ||
| 3409 | /* call1 (Qface_set_after_frame_default, frame); */ | ||
| 3404 | } | 3410 | } |
| 3405 | } | 3411 | } |
| 3406 | 3412 | ||
diff --git a/src/w32fns.c b/src/w32fns.c index 34897314567..9a7e49cf0db 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -4274,8 +4274,13 @@ x_default_font_parameter (f, parms) | |||
| 4274 | Lisp_Object parms; | 4274 | Lisp_Object parms; |
| 4275 | { | 4275 | { |
| 4276 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); | 4276 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); |
| 4277 | Lisp_Object font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font", | 4277 | Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL, |
| 4278 | RES_TYPE_STRING); | 4278 | RES_TYPE_STRING); |
| 4279 | Lisp_Object font; | ||
| 4280 | if (EQ (font_param, Qunbound)) | ||
| 4281 | font_param = Qnil; | ||
| 4282 | font = !NILP (font_param) ? font_param | ||
| 4283 | : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING); | ||
| 4279 | 4284 | ||
| 4280 | if (!STRINGP (font)) | 4285 | if (!STRINGP (font)) |
| 4281 | { | 4286 | { |
| @@ -4296,12 +4301,12 @@ x_default_font_parameter (f, parms) | |||
| 4296 | if (NILP (font)) | 4301 | if (NILP (font)) |
| 4297 | error ("No suitable font was found"); | 4302 | error ("No suitable font was found"); |
| 4298 | } | 4303 | } |
| 4299 | else | 4304 | else if (!NILP (font_param)) |
| 4300 | { | 4305 | { |
| 4301 | /* Remember the explicit font parameter, so we can re-apply it after | 4306 | /* Remember the explicit font parameter, so we can re-apply it after |
| 4302 | we've applied the `default' face settings. */ | 4307 | we've applied the `default' face settings. */ |
| 4303 | x_set_frame_parameters (f, Fcons (Fcons (Qfont_param, font), Qnil)); | 4308 | x_set_frame_parameters (f, Fcons (Fcons (Qfont_param, font_param), Qnil)); |
| 4304 | } | 4309 | } |
| 4305 | x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); | 4310 | x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); |
| 4306 | } | 4311 | } |
| 4307 | 4312 | ||
diff --git a/src/xfns.c b/src/xfns.c index 58b03691e2f..0d31f015b82 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -3060,8 +3060,13 @@ x_default_font_parameter (f, parms) | |||
| 3060 | Lisp_Object parms; | 3060 | Lisp_Object parms; |
| 3061 | { | 3061 | { |
| 3062 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 3062 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 3063 | Lisp_Object font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font", | 3063 | Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL, |
| 3064 | RES_TYPE_STRING); | 3064 | RES_TYPE_STRING); |
| 3065 | Lisp_Object font; | ||
| 3066 | if (EQ (font_param, Qunbound)) | ||
| 3067 | font_param = Qnil; | ||
| 3068 | font = !NILP (font_param) ? font_param | ||
| 3069 | : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING); | ||
| 3065 | 3070 | ||
| 3066 | if (! STRINGP (font)) | 3071 | if (! STRINGP (font)) |
| 3067 | { | 3072 | { |
| @@ -3088,12 +3093,12 @@ x_default_font_parameter (f, parms) | |||
| 3088 | if (NILP (font)) | 3093 | if (NILP (font)) |
| 3089 | error ("No suitable font was found"); | 3094 | error ("No suitable font was found"); |
| 3090 | } | 3095 | } |
| 3091 | else | 3096 | else if (!NILP (font_param)) |
| 3092 | { | 3097 | { |
| 3093 | /* Remember the explicit font parameter, so we can re-apply it after | 3098 | /* Remember the explicit font parameter, so we can re-apply it after |
| 3094 | we've applied the `default' face settings. */ | 3099 | we've applied the `default' face settings. */ |
| 3095 | x_set_frame_parameters (f, Fcons (Fcons (Qfont_param, font), Qnil)); | 3100 | x_set_frame_parameters (f, Fcons (Fcons (Qfont_param, font_param), Qnil)); |
| 3096 | } | 3101 | } |
| 3097 | x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); | 3102 | x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); |
| 3098 | } | 3103 | } |
| 3099 | 3104 | ||