aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2011-11-09 22:29:23 +0800
committerChong Yidong <[email protected]>2011-11-09 22:29:23 +0800
commit2fbdc249e6c99b886f2beb38eefabf53b5c3848c (patch)
treec9794c579ff4ddc7d3a1841e4ff672003eb37381
parent1dce71935ccc44369ccc27094be6c5bebc3080b4 (diff)
Disallow calling window-inside-edges and related functions on internal windows.
* src/window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges) (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/window.c18
2 files changed, 14 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 04e58e4742..b14d6752bb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-09 Chong Yidong <[email protected]>
+
+ * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
+ (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
+
2011-11-08 Paul Eggert <[email protected]>
* s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
diff --git a/src/window.c b/src/window.c
index 00e887436d..83a8974e88 100644
--- a/src/window.c
+++ b/src/window.c
@@ -859,7 +859,7 @@ The inside edges do not include the space used by the WINDOW's scroll
bar, display margins, fringes, header line, and/or mode line. */)
(Lisp_Object window)
{
- register struct window *w = decode_any_window (window);
+ register struct window *w = decode_window (window);
return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w)
+ WINDOW_LEFT_MARGIN_COLS (w)
@@ -874,9 +874,9 @@ bar, display margins, fringes, header line, and/or mode line. */)
}
DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0,
- doc: /* Return a list of the edge pixel coordinates of WINDOW.
-The list has the form (LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at
-the top left corner of the frame.
+ doc: /* Return a list of the edge pixel coordinates of WINDOW's text area.
+The list has the form (LEFT TOP RIGHT BOTTOM), all relative to (0,0)
+at the top left corner of the frame's window area.
RIGHT is one more than the rightmost x position of WINDOW's text area.
BOTTOM is one more than the bottommost y position of WINDOW's text area.
@@ -884,7 +884,7 @@ The inside edges do not include the space used by WINDOW's scroll bar,
display margins, fringes, header line, and/or mode line. */)
(Lisp_Object window)
{
- register struct window *w = decode_any_window (window);
+ register struct window *w = decode_window (window);
return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w)
+ WINDOW_LEFT_MARGIN_WIDTH (w)
@@ -901,9 +901,9 @@ display margins, fringes, header line, and/or mode line. */)
DEFUN ("window-inside-absolute-pixel-edges",
Fwindow_inside_absolute_pixel_edges,
Swindow_inside_absolute_pixel_edges, 0, 1, 0,
- doc: /* Return a list of the edge pixel coordinates of WINDOW.
-The list has the form (LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at
-the top left corner of the display.
+ doc: /* Return a list of the edge pixel coordinates of WINDOW's text area.
+The list has the form (LEFT TOP RIGHT BOTTOM), all relative to (0,0)
+at the top left corner of the frame's window area.
RIGHT is one more than the rightmost x position of WINDOW's text area.
BOTTOM is one more than the bottommost y position of WINDOW's text area.
@@ -911,7 +911,7 @@ The inside edges do not include the space used by WINDOW's scroll bar,
display margins, fringes, header line, and/or mode line. */)
(Lisp_Object window)
{
- register struct window *w = decode_any_window (window);
+ register struct window *w = decode_window (window);
int add_x, add_y;
calc_absolute_offset (w, &add_x, &add_y);