aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-02-25 02:27:32 +0000
committerStefan Monnier2008-02-25 02:27:32 +0000
commiteeca6f6f4e77ef5c81c481509d08f3fb481fae9a (patch)
treea9f2f0fd199dad7336acb8f92be0028ba8148017
parentae185452070444d89db7f1069c58cfa27a5e15b0 (diff)
downloademacs-eeca6f6f4e77ef5c81c481509d08f3fb481fae9a.tar.gz
emacs-eeca6f6f4e77ef5c81c481509d08f3fb481fae9a.zip
(Fdelete_window, Fadjust_window_trailing_edge):
Handle a nil arg. Use run_window_configuration_change_hook. (delete_window, adjust_window_trailing_edge): Don't handle nil any more. (Fenlarge_window, Fshrink_window, Fset_window_configuration): Use run_window_configuration_change_hook.
-rw-r--r--src/ChangeLog11
-rw-r--r--src/window.c38
2 files changed, 26 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 263168d128b..dd33db7cdf6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12008-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * window.c (Fdelete_window, Fadjust_window_trailing_edge):
4 Handle a nil arg. Use run_window_configuration_change_hook.
5 (delete_window, adjust_window_trailing_edge): Don't handle nil any more.
6 (Fenlarge_window, Fshrink_window, Fset_window_configuration):
7 Use run_window_configuration_change_hook.
8
12008-02-25 Kenichi Handa <handa@ni.aist.go.jp> 92008-02-25 Kenichi Handa <handa@ni.aist.go.jp>
2 10
3 * xdisp.c (fill_glyph_string): Pay attention to glyph->padding_p. 11 * xdisp.c (fill_glyph_string): Pay attention to glyph->padding_p.
@@ -14,8 +22,7 @@
14 22
15 * xftfont.c (xftfont_draw): Pay attention to s->padding_p. 23 * xftfont.c (xftfont_draw): Pay attention to s->padding_p.
16 24
17 * font.c: If the font driver doesn't have `shape' function, return 25 * font.c: If the font driver doesn't have `shape' function, return Qnil.
18 Qnil.
19 26
202008-02-25 Jason Rumney <jasonr@gnu.org> 272008-02-25 Jason Rumney <jasonr@gnu.org>
21 28
diff --git a/src/window.c b/src/window.c
index d1e3225e198..bceb41faf06 100644
--- a/src/window.c
+++ b/src/window.c
@@ -212,8 +212,8 @@ static int window_initialized;
212 212
213/* Hook to run when window config changes. */ 213/* Hook to run when window config changes. */
214 214
215Lisp_Object Qwindow_configuration_change_hook; 215static Lisp_Object Qwindow_configuration_change_hook;
216Lisp_Object Vwindow_configuration_change_hook; 216static Lisp_Object Vwindow_configuration_change_hook;
217 217
218/* Non-nil means scroll commands try to put point 218/* Non-nil means scroll commands try to put point
219 at the same screen height as previously. */ 219 at the same screen height as previously. */
@@ -1483,11 +1483,13 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "",
1483 (window) 1483 (window)
1484 register Lisp_Object window; 1484 register Lisp_Object window;
1485{ 1485{
1486 struct frame *f;
1487 if (NILP (window))
1488 window = selected_window;
1489 f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
1486 delete_window (window); 1490 delete_window (window);
1487 1491
1488 if (! NILP (Vwindow_configuration_change_hook) 1492 run_window_configuration_change_hook (f);
1489 && ! NILP (Vrun_hooks))
1490 call1 (Vrun_hooks, Qwindow_configuration_change_hook);
1491 1493
1492 return Qnil; 1494 return Qnil;
1493} 1495}
@@ -1504,10 +1506,7 @@ delete_window (window)
1504 /* Because this function is called by other C code on non-leaf 1506 /* Because this function is called by other C code on non-leaf
1505 windows, the CHECK_LIVE_WINDOW macro would choke inappropriately, 1507 windows, the CHECK_LIVE_WINDOW macro would choke inappropriately,
1506 so we can't decode_window here. */ 1508 so we can't decode_window here. */
1507 if (NILP (window)) 1509 CHECK_WINDOW (window);
1508 window = selected_window;
1509 else
1510 CHECK_WINDOW (window);
1511 p = XWINDOW (window); 1510 p = XWINDOW (window);
1512 1511
1513 /* It's a no-op to delete an already-deleted window. */ 1512 /* It's a no-op to delete an already-deleted window. */
@@ -3310,6 +3309,8 @@ EXFUN (Fset_window_scroll_bars, 4);
3310void 3309void
3311run_window_configuration_change_hook (struct frame *f) 3310run_window_configuration_change_hook (struct frame *f)
3312{ 3311{
3312 /* FIXME: buffer-local values of Vwindow_configuration_change_hook
3313 aren't handled properly. */
3313 if (! NILP (Vwindow_configuration_change_hook) 3314 if (! NILP (Vwindow_configuration_change_hook)
3314 && ! NILP (Vrun_hooks)) 3315 && ! NILP (Vrun_hooks))
3315 { 3316 {
@@ -4187,8 +4188,7 @@ too small. */)
4187 CHECK_NUMBER (arg); 4188 CHECK_NUMBER (arg);
4188 enlarge_window (selected_window, XINT (arg), !NILP (horizontal)); 4189 enlarge_window (selected_window, XINT (arg), !NILP (horizontal));
4189 4190
4190 if (! NILP (Vwindow_configuration_change_hook)) 4191 run_window_configuration_change_hook (SELECTED_FRAME ());
4191 call1 (Vrun_hooks, Qwindow_configuration_change_hook);
4192 4192
4193 return Qnil; 4193 return Qnil;
4194} 4194}
@@ -4204,8 +4204,7 @@ Only siblings to the right or below are changed. */)
4204 CHECK_NUMBER (arg); 4204 CHECK_NUMBER (arg);
4205 enlarge_window (selected_window, -XINT (arg), !NILP (side)); 4205 enlarge_window (selected_window, -XINT (arg), !NILP (side));
4206 4206
4207 if (! NILP (Vwindow_configuration_change_hook)) 4207 run_window_configuration_change_hook (SELECTED_FRAME ());
4208 call1 (Vrun_hooks, Qwindow_configuration_change_hook);
4209 4208
4210 return Qnil; 4209 return Qnil;
4211} 4210}
@@ -4528,9 +4527,6 @@ adjust_window_trailing_edge (window, delta, horiz_flag)
4528 validity. */ 4527 validity. */
4529 check_min_window_sizes (); 4528 check_min_window_sizes ();
4530 4529
4531 if (NILP (window))
4532 window = Fselected_window ();
4533
4534 CHECK_WINDOW (window); 4530 CHECK_WINDOW (window);
4535 4531
4536 /* Give up if this window cannot be resized. */ 4532 /* Give up if this window cannot be resized. */
@@ -4664,10 +4660,12 @@ are not deleted; instead, we signal an error. */)
4664 Lisp_Object window, delta, horizontal; 4660 Lisp_Object window, delta, horizontal;
4665{ 4661{
4666 CHECK_NUMBER (delta); 4662 CHECK_NUMBER (delta);
4663 if (NILP (window))
4664 window = selected_window;
4667 adjust_window_trailing_edge (window, XINT (delta), !NILP (horizontal)); 4665 adjust_window_trailing_edge (window, XINT (delta), !NILP (horizontal));
4668 4666
4669 if (! NILP (Vwindow_configuration_change_hook)) 4667 run_window_configuration_change_hook
4670 call1 (Vrun_hooks, Qwindow_configuration_change_hook); 4668 (XFRAME (WINDOW_FRAME (XWINDOW (window))));
4671 4669
4672 return Qnil; 4670 return Qnil;
4673} 4671}
@@ -6479,9 +6477,7 @@ the return value is nil. Otherwise the value is t. */)
6479 if (FRAME_LIVE_P (XFRAME (data->selected_frame))) 6477 if (FRAME_LIVE_P (XFRAME (data->selected_frame)))
6480 do_switch_frame (data->selected_frame, 0, 0); 6478 do_switch_frame (data->selected_frame, 0, 0);
6481 6479
6482 if (! NILP (Vwindow_configuration_change_hook) 6480 run_window_configuration_change_hook (f);
6483 && ! NILP (Vrun_hooks))
6484 call1 (Vrun_hooks, Qwindow_configuration_change_hook);
6485 } 6481 }
6486 6482
6487 if (!NILP (new_current_buffer)) 6483 if (!NILP (new_current_buffer))