aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c
index a6de34f3db6..6cd3122b43b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6824,19 +6824,25 @@ DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_config
6824} 6824}
6825 6825
6826DEFUN ("set-window-configuration", Fset_window_configuration, 6826DEFUN ("set-window-configuration", Fset_window_configuration,
6827 Sset_window_configuration, 1, 1, 0, 6827 Sset_window_configuration, 1, 2, 0,
6828 doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION. 6828 doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION.
6829CONFIGURATION must be a value previously returned 6829CONFIGURATION must be a value previously returned
6830by `current-window-configuration' (which see). 6830by `current-window-configuration' (which see).
6831
6832Normally, this function selects the frame of the CONFIGURATION, but if
6833DONT-SET-FRAME is non-nil, it leaves selected the frame which was
6834current at the start of the function.
6835
6831If CONFIGURATION was made from a frame that is now deleted, 6836If CONFIGURATION was made from a frame that is now deleted,
6832only frame-independent values can be restored. In this case, 6837only frame-independent values can be restored. In this case,
6833the return value is nil. Otherwise the value is t. */) 6838the return value is nil. Otherwise the value is t. */)
6834 (Lisp_Object configuration) 6839 (Lisp_Object configuration, Lisp_Object dont_set_frame)
6835{ 6840{
6836 register struct save_window_data *data; 6841 register struct save_window_data *data;
6837 struct Lisp_Vector *saved_windows; 6842 struct Lisp_Vector *saved_windows;
6838 Lisp_Object new_current_buffer; 6843 Lisp_Object new_current_buffer;
6839 Lisp_Object frame; 6844 Lisp_Object frame;
6845 Lisp_Object old_frame = selected_frame;
6840 struct frame *f; 6846 struct frame *f;
6841 ptrdiff_t old_point = -1; 6847 ptrdiff_t old_point = -1;
6842 USE_SAFE_ALLOCA; 6848 USE_SAFE_ALLOCA;
@@ -7153,7 +7159,10 @@ the return value is nil. Otherwise the value is t. */)
7153 select_window above totally superfluous; it still sets f's 7159 select_window above totally superfluous; it still sets f's
7154 selected window. */ 7160 selected window. */
7155 if (FRAME_LIVE_P (XFRAME (data->selected_frame))) 7161 if (FRAME_LIVE_P (XFRAME (data->selected_frame)))
7156 do_switch_frame (data->selected_frame, 0, 0, Qnil); 7162 do_switch_frame (NILP (dont_set_frame)
7163 ? data->selected_frame
7164 : old_frame
7165 , 0, 0, Qnil);
7157 } 7166 }
7158 7167
7159 FRAME_WINDOW_CHANGE (f) = true; 7168 FRAME_WINDOW_CHANGE (f) = true;
@@ -7187,11 +7196,13 @@ the return value is nil. Otherwise the value is t. */)
7187 return FRAME_LIVE_P (f) ? Qt : Qnil; 7196 return FRAME_LIVE_P (f) ? Qt : Qnil;
7188} 7197}
7189 7198
7190
7191void 7199void
7192restore_window_configuration (Lisp_Object configuration) 7200restore_window_configuration (Lisp_Object configuration)
7193{ 7201{
7194 Fset_window_configuration (configuration); 7202 if (CONSP (configuration))
7203 Fset_window_configuration (XCDR (configuration), XCAR (configuration));
7204 else
7205 Fset_window_configuration (configuration, Qnil);
7195} 7206}
7196 7207
7197 7208