Commit e43b6e43 authored by Martin Rudalics's avatar Martin Rudalics

Have overlays with window property respect clone numbers.

* buffer.c (Qclone_number): Declare static and DEFSYM it.
(sort_overlays, overlay_strings): When an overlay's clone number
matches the window's clone number process the overlay even if
the overlay's window property doesn't match the current window.
parent b6458526
2011-06-27 Martin Rudalics <rudalics@gmx.at>
* buffer.c (Qclone_number): Declare static and DEFSYM it.
(sort_overlays, overlay_strings): When an overlay's clone number
matches the window's clone number process the overlay even if
the overlay's window property doesn't match the current window.
2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
* emacsgtkfixed.h: State that this is only used with Gtk+3.
......
......@@ -146,7 +146,7 @@ static Lisp_Object Qoverlayp;
Lisp_Object Qpriority, Qbefore_string, Qafter_string;
static Lisp_Object Qevaporate;
static Lisp_Object Qclone_number, Qevaporate;
Lisp_Object Qmodification_hooks;
Lisp_Object Qinsert_in_front_hooks;
......@@ -2900,10 +2900,13 @@ 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;
Lisp_Object window, clone_number;
window = Foverlay_get (overlay, Qwindow);
if (WINDOWP (window) && XWINDOW (window) != w)
clone_number = Foverlay_get (overlay, Qclone_number);
if (WINDOWP (window) && XWINDOW (window) != w
&& (! NUMBERP (clone_number)
|| XFASTINT (clone_number) != XFASTINT (w->clone_number)))
continue;
}
......@@ -3032,7 +3035,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, str;
Lisp_Object overlay, window, clone_number, str;
struct Lisp_Overlay *ov;
EMACS_INT startpos, endpos;
int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
......@@ -3051,8 +3054,12 @@ overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr)
if (endpos != pos && startpos != pos)
continue;
window = Foverlay_get (overlay, Qwindow);
if (WINDOWP (window) && XWINDOW (window) != w)
clone_number = Foverlay_get (overlay, Qclone_number);
if (WINDOWP (window) && XWINDOW (window) != w
&& (! NUMBERP (clone_number)
|| XFASTINT (clone_number) != XFASTINT (w->clone_number)))
continue;
if (startpos == pos
&& (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)))
record_overlay_string (&overlay_heads, str,
......@@ -3079,7 +3086,10 @@ overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr)
if (endpos != pos && startpos != pos)
continue;
window = Foverlay_get (overlay, Qwindow);
if (WINDOWP (window) && XWINDOW (window) != w)
clone_number = Foverlay_get (overlay, Qclone_number);
if (WINDOWP (window) && XWINDOW (window) != w
&& (! NUMBERP (clone_number)
|| XFASTINT (clone_number) != XFASTINT (w->clone_number)))
continue;
if (startpos == pos
&& (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)))
......@@ -5219,6 +5229,7 @@ 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");
......
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