Commit 28545e04 authored by Martin Rudalics's avatar Martin Rudalics

Remove clone-number support. Provide clone-of parameter in window states.

* window.h (window): Remove clone_number slot.
* window.c (Fwindow_clone_number, Fset_window_clone_number):
Remove.
(make_parent_window, make_window, saved_window)
(Fset_window_configuration, save_window_save): Don't deal with
clone numbers.
* buffer.c (Qclone_number): Remove declaration.
(sort_overlays, overlay_strings): Don't deal with clone numbers.

* window.el (window-state-get-1): Don't assign clone numbers.
Add clone-of item to list of window parameters.
(window-state-put-2): Don't process clone numbers.
(display-buffer-alist): Fix doc-string.
parent a9e2a8db
2011-07-02 Martin Rudalics <rudalics@gmx.at>
* window.el (window-state-get-1): Don't assign clone numbers.
Add clone-of item to list of window parameters.
(window-state-put-2): Don't process clone numbers.
(display-buffer-alist): Fix doc-string.
2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (remq): Don't allocate if it's not needed.
......
......@@ -3542,7 +3542,6 @@ specific buffers."
(window-list-no-nils
type
(unless (window-next-sibling window) (cons 'last t))
(cons 'clone-number (window-clone-number window))
(cons 'total-height (window-total-size window))
(cons 'total-width (window-total-size window t))
(cons 'normal-height (window-normal-size window))
......@@ -3554,6 +3553,9 @@ specific buffers."
(unless (memq (car parameter)
window-state-ignored-parameters)
(setq list (cons parameter list))))
(unless (window-parameter window 'clone-of)
;; Make a clone-of parameter.
(setq list (cons (cons 'clone-of window) list)))
(when list
(cons 'parameters list)))
(when buffer
......@@ -3694,13 +3696,10 @@ value can be also stored on disk and read back in a new session."
"Helper function for `window-state-put'."
(dolist (item window-state-put-list)
(let ((window (car item))
(clone-number (cdr (assq 'clone-number item)))
(splits (cdr (assq 'splits item)))
(nest (cdr (assq 'nest item)))
(parameters (cdr (assq 'parameters item)))
(state (cdr (assq 'buffer item))))
;; Put in clone-number.
(when clone-number (set-window-clone-number window clone-number))
(when splits (set-window-splits window splits))
(when nest (set-window-nest window nest))
;; Process parameters.
......@@ -4100,7 +4099,7 @@ A list whose car is the symbol `function' specifies that the
function specified in the second element of the list is
responsible for displaying the buffer. `display-buffer' calls
this function with the buffer as first argument and the remaining
elements of the list as the other arguments.
elements of the list as the second.
The function should choose or create a window, display the buffer
in it, and return the window. It is also responsible for giving
......
2011-07-02 Martin Rudalics <rudalics@gmx.at>
* window.h (window): Remove clone_number slot.
* window.c (Fwindow_clone_number, Fset_window_clone_number):
Remove.
(make_parent_window, make_window, saved_window)
(Fset_window_configuration, save_window_save): Don't deal with
clone numbers.
* buffer.c (Qclone_number): Remove declaration.
(sort_overlays, overlay_strings): Don't deal with clone numbers.
2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
Add multiple inheritance to keymaps.
......
......@@ -146,7 +146,7 @@ static Lisp_Object Qoverlayp;
Lisp_Object Qpriority, Qbefore_string, Qafter_string;
static Lisp_Object Qclone_number, Qevaporate;
static Lisp_Object Qevaporate;
Lisp_Object Qmodification_hooks;
Lisp_Object Qinsert_in_front_hooks;
......@@ -2900,13 +2900,10 @@ sort_overlays (Lisp_Object *overlay_vec, ptrdiff_t noverlays, struct window *w)
overlays that are limited to some other window. */
if (w)
{
Lisp_Object window, clone_number;
Lisp_Object window;
window = Foverlay_get (overlay, Qwindow);
clone_number = Foverlay_get (overlay, Qclone_number);
if (WINDOWP (window) && XWINDOW (window) != w
&& (! NUMBERP (clone_number)
|| XFASTINT (clone_number) != XFASTINT (w->clone_number)))
if (WINDOWP (window) && XWINDOW (window) != w)
continue;
}
......@@ -3035,7 +3032,7 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str,
EMACS_INT
overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr)
{
Lisp_Object overlay, window, clone_number, str;
Lisp_Object overlay, window, str;
struct Lisp_Overlay *ov;
EMACS_INT startpos, endpos;
int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
......@@ -3054,12 +3051,8 @@ overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr)
if (endpos != pos && startpos != pos)
continue;
window = Foverlay_get (overlay, Qwindow);
clone_number = Foverlay_get (overlay, Qclone_number);
if (WINDOWP (window) && XWINDOW (window) != w
&& (! NUMBERP (clone_number)
|| XFASTINT (clone_number) != XFASTINT (w->clone_number)))
if (WINDOWP (window) && XWINDOW (window) != w)
continue;
if (startpos == pos
&& (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)))
record_overlay_string (&overlay_heads, str,
......@@ -3086,10 +3079,7 @@ overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr)
if (endpos != pos && startpos != pos)
continue;
window = Foverlay_get (overlay, Qwindow);
clone_number = Foverlay_get (overlay, Qclone_number);
if (WINDOWP (window) && XWINDOW (window) != w
&& (! NUMBERP (clone_number)
|| XFASTINT (clone_number) != XFASTINT (w->clone_number)))
if (WINDOWP (window) && XWINDOW (window) != w)
continue;
if (startpos == pos
&& (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)))
......@@ -5229,7 +5219,6 @@ syms_of_buffer (void)
DEFSYM (Qinsert_behind_hooks, "insert-behind-hooks");
DEFSYM (Qget_file_buffer, "get-file-buffer");
DEFSYM (Qpriority, "priority");
DEFSYM (Qclone_number, "clone-number");
DEFSYM (Qbefore_string, "before-string");
DEFSYM (Qafter_string, "after-string");
DEFSYM (Qfirst_change_hook, "first-change-hook");
......
......@@ -408,14 +408,6 @@ buffer of the selected window before each command. */)
return select_window (window, norecord, 0);
}
DEFUN ("window-clone-number", Fwindow_clone_number, Swindow_clone_number, 0, 1, 0,
doc: /* Return WINDOW's clone number.
WINDOW can be any window and defaults to the selected one. */)
(Lisp_Object window)
{
return decode_any_window (window)->clone_number;
}
DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
doc: /* Return the buffer that WINDOW is displaying.
WINDOW can be any window and defaults to the selected one.
......@@ -3087,18 +3079,6 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
unbind_to (count, Qnil);
}
DEFUN ("set-window-clone-number", Fset_window_clone_number, Sset_window_clone_number, 2, 2, 0,
doc: /* Set WINDOW's clone number to CLONE-NUMBER.
WINDOW can be any window and defaults to the selected one. */)
(Lisp_Object window, Lisp_Object clone_number)
{
register struct window *w = decode_any_window (window);
CHECK_NUMBER (clone_number);
w->clone_number = clone_number;
return w->clone_number;
}
DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0,
doc: /* Make WINDOW display BUFFER-OR-NAME as its contents.
WINDOW has to be a live window and defaults to the selected one.
......@@ -3289,7 +3269,6 @@ make_parent_window (Lisp_Object window, int horflag)
++sequence_number;
XSETFASTINT (p->sequence_number, sequence_number);
XSETFASTINT (p->clone_number, sequence_number);
replace_window (window, parent, 1);
......@@ -3335,7 +3314,6 @@ make_window (void)
XSETFASTINT (w->use_time, 0);
++sequence_number;
XSETFASTINT (w->sequence_number, sequence_number);
XSETFASTINT (w->clone_number, sequence_number);
w->temslot = w->last_modified = w->last_overlay_modified = Qnil;
XSETFASTINT (w->last_point, 0);
w->last_had_star = w->vertical_scroll_bar = Qnil;
......@@ -5348,8 +5326,7 @@ struct saved_window
{
struct vectorlike_header header;
Lisp_Object window, clone_number;
Lisp_Object buffer, start, pointm, mark;
Lisp_Object window, buffer, start, pointm, mark;
Lisp_Object left_col, top_line, total_cols, total_lines;
Lisp_Object normal_cols, normal_lines;
Lisp_Object hscroll, min_hscroll;
......@@ -5568,7 +5545,6 @@ the return value is nil. Otherwise the value is t. */)
}
}
w->clone_number = p->clone_number;
/* If we squirreled away the buffer in the window's height,
restore it now. */
if (BUFFERP (w->total_lines))
......@@ -5851,7 +5827,6 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
XSETFASTINT (w->temslot, i); i++;
p->window = window;
p->clone_number = w->clone_number;
p->buffer = w->buffer;
p->left_col = w->left_col;
p->top_line = w->top_line;
......@@ -6596,7 +6571,6 @@ function `window-nest' and altered by the function `set-window-nest'. */);
defsubr (&Sset_frame_selected_window);
defsubr (&Spos_visible_in_window_p);
defsubr (&Swindow_line_height);
defsubr (&Swindow_clone_number);
defsubr (&Swindow_buffer);
defsubr (&Swindow_parent);
defsubr (&Swindow_top_child);
......@@ -6646,7 +6620,6 @@ function `window-nest' and altered by the function `set-window-nest'. */);
defsubr (&Sdelete_window_internal);
defsubr (&Sresize_mini_window_internal);
defsubr (&Sset_window_buffer);
defsubr (&Sset_window_clone_number);
defsubr (&Srun_window_configuration_change_hook);
defsubr (&Sselect_window);
defsubr (&Sforce_window_update);
......
......@@ -165,10 +165,6 @@ struct window
/* Unique number of window assigned when it was created. */
Lisp_Object sequence_number;
/* Sequence number of window this window was cloned from. Identic
to sequence number if window was not cloned. */
Lisp_Object clone_number;
/* No permanent meaning; used by save-window-excursion's
bookkeeping. */
Lisp_Object temslot;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment