aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog15
-rw-r--r--src/w32fns.c5
-rw-r--r--src/window.c111
-rw-r--r--src/xdisp.c6
4 files changed, 127 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4fbfa52df3a..aa4e92b4134 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,18 @@
12012-01-16 Martin Rudalics <rudalics@gmx.at>
2
3 * window.c (Vwindow_persistent_parameters): New variable.
4 (Fset_window_configuration, save_window_save): Handle persistent
5 window parameters.
6
72012-01-14 Eli Zaretskii <eliz@gnu.org>
8
9 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10 thrashing the stack of the thread. (Bug#9087)
11
122012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13
14 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15
12012-01-11 Eli Zaretskii <eliz@gnu.org> 162012-01-11 Eli Zaretskii <eliz@gnu.org>
2 17
3 * xdisp.c (rows_from_pos_range): Handle the case where the 18 * xdisp.c (rows_from_pos_range): Handle the case where the
diff --git a/src/w32fns.c b/src/w32fns.c
index 1fcf29fbcfd..510d1e94f16 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2479,6 +2479,10 @@ signal_user_input (void)
2479 if (!NILP (Vthrow_on_input)) 2479 if (!NILP (Vthrow_on_input))
2480 { 2480 {
2481 Vquit_flag = Vthrow_on_input; 2481 Vquit_flag = Vthrow_on_input;
2482 /* Doing a QUIT from this thread is a bad idea, since this
2483 unwinds the stack of the Lisp thread, and the Windows runtime
2484 rightfully barfs. Disabled. */
2485#if 0
2482 /* If we're inside a function that wants immediate quits, 2486 /* If we're inside a function that wants immediate quits,
2483 do it now. */ 2487 do it now. */
2484 if (immediate_quit && NILP (Vinhibit_quit)) 2488 if (immediate_quit && NILP (Vinhibit_quit))
@@ -2486,6 +2490,7 @@ signal_user_input (void)
2486 immediate_quit = 0; 2490 immediate_quit = 0;
2487 QUIT; 2491 QUIT;
2488 } 2492 }
2493#endif
2489 } 2494 }
2490} 2495}
2491 2496
diff --git a/src/window.c b/src/window.c
index 4559734cc8e..3ee731e60bf 100644
--- a/src/window.c
+++ b/src/window.c
@@ -59,7 +59,7 @@ static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window;
59static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; 59static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically;
60static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; 60static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
61static Lisp_Object Qsafe, Qabove, Qbelow; 61static Lisp_Object Qsafe, Qabove, Qbelow;
62static Lisp_Object Qauto_buffer_name; 62static Lisp_Object Qauto_buffer_name, Qclone_of, Qstate;
63 63
64static int displayed_window_lines (struct window *); 64static int displayed_window_lines (struct window *);
65static struct window *decode_window (Lisp_Object); 65static struct window *decode_window (Lisp_Object);
@@ -5415,6 +5415,7 @@ the return value is nil. Otherwise the value is t. */)
5415 { 5415 {
5416 Lisp_Object window; 5416 Lisp_Object window;
5417 Lisp_Object dead_windows = Qnil; 5417 Lisp_Object dead_windows = Qnil;
5418 register Lisp_Object tem, par, pers;
5418 register struct window *w; 5419 register struct window *w;
5419 register struct saved_window *p; 5420 register struct saved_window *p;
5420 struct window *root_window; 5421 struct window *root_window;
@@ -5548,7 +5549,28 @@ the return value is nil. Otherwise the value is t. */)
5548 w->vertical_scroll_bar_type = p->vertical_scroll_bar_type; 5549 w->vertical_scroll_bar_type = p->vertical_scroll_bar_type;
5549 w->dedicated = p->dedicated; 5550 w->dedicated = p->dedicated;
5550 w->combination_limit = p->combination_limit; 5551 w->combination_limit = p->combination_limit;
5551 w->window_parameters = p->window_parameters; 5552 /* Restore any window parameters that have been saved.
5553 Parameters that have not been saved are left alone. */
5554 for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem))
5555 {
5556 pers = XCAR (tem);
5557 if (CONSP (pers))
5558 {
5559 if (NILP (XCDR (pers)))
5560 {
5561 par = Fassq (XCAR (pers), w->window_parameters);
5562 if (CONSP (par) && !NILP (XCDR (par)))
5563 /* Reset a parameter to nil if and only if it
5564 has a non-nil association. Don't make new
5565 associations. */
5566 Fsetcdr (par, Qnil);
5567 }
5568 else
5569 /* Always restore a non-nil value. */
5570 Fset_window_parameter (window, XCAR (pers), XCDR (pers));
5571 }
5572 }
5573
5552 XSETFASTINT (w->last_modified, 0); 5574 XSETFASTINT (w->last_modified, 0);
5553 XSETFASTINT (w->last_overlay_modified, 0); 5575 XSETFASTINT (w->last_overlay_modified, 0);
5554 5576
@@ -5815,7 +5837,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5815{ 5837{
5816 register struct saved_window *p; 5838 register struct saved_window *p;
5817 register struct window *w; 5839 register struct window *w;
5818 register Lisp_Object tem; 5840 register Lisp_Object tem, pers, par;
5819 5841
5820 for (;!NILP (window); window = w->next) 5842 for (;!NILP (window); window = w->next)
5821 { 5843 {
@@ -5843,12 +5865,60 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5843 p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; 5865 p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
5844 p->dedicated = w->dedicated; 5866 p->dedicated = w->dedicated;
5845 p->combination_limit = w->combination_limit; 5867 p->combination_limit = w->combination_limit;
5846 p->window_parameters = w->window_parameters; 5868 p->window_parameters = Qnil;
5869
5870 if (!NILP (Vwindow_persistent_parameters))
5871 {
5872 /* Run cycle detection on Vwindow_persistent_parameters. */
5873 Lisp_Object tortoise, hare;
5874
5875 hare = tortoise = Vwindow_persistent_parameters;
5876 while (CONSP (hare))
5877 {
5878 hare = XCDR (hare);
5879 if (!CONSP (hare))
5880 break;
5881
5882 hare = XCDR (hare);
5883 tortoise = XCDR (tortoise);
5884
5885 if (EQ (hare, tortoise))
5886 /* Reset Vwindow_persistent_parameters to Qnil. */
5887 {
5888 Vwindow_persistent_parameters = Qnil;
5889 break;
5890 }
5891 }
5892
5893 for (tem = Vwindow_persistent_parameters; CONSP (tem);
5894 tem = XCDR (tem))
5895 {
5896 pers = XCAR (tem);
5897 /* Save values for persistent window parameters whose cdr
5898 is either nil or t. */
5899 if (CONSP (pers) && (NILP (XCDR (pers)) || EQ (XCDR (pers), Qt)))
5900 {
5901 par = Fassq (XCAR (pers), w->window_parameters);
5902 if (NILP (par))
5903 /* If the window has no value for the parameter,
5904 make one. */
5905 p->window_parameters = Fcons (Fcons (XCAR (pers), Qnil),
5906 p->window_parameters);
5907 else
5908 /* If the window has a value for the parameter,
5909 save it. */
5910 p->window_parameters = Fcons (Fcons (XCAR (par),
5911 XCDR (par)),
5912 p->window_parameters);
5913 }
5914 }
5915 }
5916
5847 if (!NILP (w->buffer)) 5917 if (!NILP (w->buffer))
5848 { 5918 {
5849 /* Save w's value of point in the window configuration. 5919 /* Save w's value of point in the window configuration. If w
5850 If w is the selected window, then get the value of point 5920 is the selected window, then get the value of point from
5851 from the buffer; pointm is garbage in the selected window. */ 5921 the buffer; pointm is garbage in the selected window. */
5852 if (EQ (window, selected_window)) 5922 if (EQ (window, selected_window))
5853 { 5923 {
5854 p->pointm = Fmake_marker (); 5924 p->pointm = Fmake_marker ();
@@ -6438,6 +6508,8 @@ syms_of_window (void)
6438 DEFSYM (Qabove, "above"); 6508 DEFSYM (Qabove, "above");
6439 DEFSYM (Qbelow, "below"); 6509 DEFSYM (Qbelow, "below");
6440 DEFSYM (Qauto_buffer_name, "auto-buffer-name"); 6510 DEFSYM (Qauto_buffer_name, "auto-buffer-name");
6511 DEFSYM (Qclone_of, "clone-of");
6512 DEFSYM (Qstate, "state");
6441 6513
6442 staticpro (&Vwindow_list); 6514 staticpro (&Vwindow_list);
6443 6515
@@ -6547,6 +6619,31 @@ retrieved via the function `window-combination-limit' and altered by the
6547function `set-window-combination-limit'. */); 6619function `set-window-combination-limit'. */);
6548 Vwindow_combination_limit = Qnil; 6620 Vwindow_combination_limit = Qnil;
6549 6621
6622 DEFVAR_LISP ("window-persistent-parameters", Vwindow_persistent_parameters,
6623 doc: /* Alist of persistent window parameters.
6624Parameters in this list are saved by `current-window-configuration' and
6625`window-state-get' and subsequently restored to their previous values by
6626`set-window-configuration' and `window-state-put'.
6627
6628The car of each entry of this alist is the symbol specifying the
6629parameter. The cdr is one of the following:
6630
6631The symbol `state' means the parameter is saved by `window-state-get'
6632provided its IGNORE argument is nil. `current-window-configuration'
6633does not save this parameter.
6634
6635nil means the parameter is saved by `current-window-configuration' and,
6636provided its IGNORE argument is nil, by `window-state-get'.
6637
6638t means the parameter is saved unconditionally by both
6639`current-window-configuration' and `window-state-get'. Parameters
6640without read syntax (like windows or frames) should not use that.
6641
6642Parameters not saved by `current-window-configuration' or
6643`window-state-get' are left alone by `set-window-configuration'
6644respectively are not installed by `window-state-put'. */);
6645 Vwindow_persistent_parameters = list1 (Fcons (Qclone_of, Qstate));
6646
6550 defsubr (&Sselected_window); 6647 defsubr (&Sselected_window);
6551 defsubr (&Sminibuffer_window); 6648 defsubr (&Sminibuffer_window);
6552 defsubr (&Swindow_minibuffer_p); 6649 defsubr (&Swindow_minibuffer_p);
diff --git a/src/xdisp.c b/src/xdisp.c
index e4a043c4c7b..87aedabd757 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -26170,14 +26170,14 @@ rows_from_pos_range (struct window *w,
26170 while (g < e) 26170 while (g < e)
26171 { 26171 {
26172 if (((BUFFERP (g->object) || INTEGERP (g->object)) 26172 if (((BUFFERP (g->object) || INTEGERP (g->object))
26173 && (start_charpos <= g->charpos && g->charpos < end_charpos 26173 && ((start_charpos <= g->charpos && g->charpos < end_charpos)
26174 /* If the buffer position of the first glyph in 26174 /* If the buffer position of the first glyph in
26175 the row is equal to END_CHARPOS, it means 26175 the row is equal to END_CHARPOS, it means
26176 the last character to be highlighted is the 26176 the last character to be highlighted is the
26177 newline of ROW, and we must consider NEXT as 26177 newline of ROW, and we must consider NEXT as
26178 END, not END+1. */ 26178 END, not END+1. */
26179 || ((!next->reversed_p && g == s 26179 || (((!next->reversed_p && g == s)
26180 || next->reversed_p && g == e - 1) 26180 || (next->reversed_p && g == e - 1))
26181 && (g->charpos == end_charpos 26181 && (g->charpos == end_charpos
26182 /* Special case for when NEXT is an 26182 /* Special case for when NEXT is an
26183 empty line at ZV. */ 26183 empty line at ZV. */