Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 100682. ------------------------------------------------------------ revno: 100682 committer: Jan D branch nick: trunk timestamp: Thu 2010-07-01 20:09:28 +0200 message: * window.c (Fwindow_absolute_pixel_edges): Doc fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-01 12:34:40 +0000 +++ src/ChangeLog 2010-07-01 18:09:28 +0000 @@ -1,5 +1,7 @@ 2010-07-01 Jan Djärv + * window.c (Fwindow_absolute_pixel_edges): Doc fix. + * window.c (calc_absolute_offset, Fwindow_absolute_pixel_edges) (Fwindow_inside_absolute_pixel_edges): New functions (bug#5721). === modified file 'src/window.c' --- src/window.c 2010-07-01 12:34:40 +0000 +++ src/window.c 2010-07-01 18:09:28 +0000 @@ -679,7 +679,7 @@ BOTTOM is one more than the bottommost y position occupied by WINDOW. The pixel edges include the space used by WINDOW's scroll bar, display margins, fringes, header line, and/or mode line. For the pixel edges -of just the text area, use `window-inside-pixel-edges'. */) +of just the text area, use `window-inside-absolute-pixel-edges'. */) (window) Lisp_Object window; { ------------------------------------------------------------ revno: 100681 committer: Mark A. Hershberger branch nick: trunk timestamp: Thu 2010-07-01 14:02:43 -0400 message: 2010-07-01 Mark A. Hershberger * url-http.el (url-http-create-request): Add a CRLF on the end so that POSTs with content to https urls work. See Prior to this, the following request would not terminate: (let ((url-request-method "POST") (url-request-data "action=login")) (url-retrieve-synchronously "https://example.org/wiki/api.php")) diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2010-06-22 16:48:53 +0000 +++ lisp/url/ChangeLog 2010-07-01 18:02:43 +0000 @@ -1,3 +1,9 @@ +2010-07-01 Mark A. Hershberger + + * url-http.el (url-http-create-request): Add a CRLF on the end so + that POSTs with content to https urls work. See + + 2010-06-22 Mark A. Hershberger * url-parse.el (url-user-for-url, url-password-for-url): === modified file 'lisp/url/url-http.el' --- lisp/url/url-http.el 2010-03-25 01:14:42 +0000 +++ lisp/url/url-http.el 2010-07-01 18:02:43 +0000 @@ -339,7 +339,7 @@ ;; End request "\r\n" ;; Any data - url-http-data)) + url-http-data "\r\n")) "")) (url-http-debug "Request is: \n%s" request) request)) ------------------------------------------------------------ revno: 100680 committer: Jan D branch nick: trunk timestamp: Thu 2010-07-01 14:34:40 +0200 message: New functions that return window edges with absolute coords (bug#5721). * window.c (calc_absolute_offset, Fwindow_absolute_pixel_edges) (Fwindow_inside_absolute_pixel_edges): New functions (bug#5721). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-01 12:20:14 +0000 +++ src/ChangeLog 2010-07-01 12:34:40 +0000 @@ -1,5 +1,8 @@ 2010-07-01 Jan Djärv + * window.c (calc_absolute_offset, Fwindow_absolute_pixel_edges) + (Fwindow_inside_absolute_pixel_edges): New functions (bug#5721). + * nsfns.m (compute_tip_xy): Do not convert coordinates from frame parameters, they are already absolute. === modified file 'src/window.c' --- src/window.c 2010-06-12 11:30:48 +0000 +++ src/window.c 2010-07-01 12:34:40 +0000 @@ -652,6 +652,48 @@ Qnil)))); } +static void +calc_absolute_offset(struct window *w, int *add_x, int *add_y) +{ + struct frame *f = XFRAME (w->frame); + *add_y = f->top_pos; +#ifdef FRAME_MENUBAR_HEIGHT + *add_y += FRAME_MENUBAR_HEIGHT (f); +#endif +#ifdef FRAME_TOOLBAR_HEIGHT + *add_y += FRAME_TOOLBAR_HEIGHT (f); +#endif +#ifdef FRAME_NS_TITLEBAR_HEIGHT + *add_y += FRAME_NS_TITLEBAR_HEIGHT (f); +#endif + *add_x = f->left_pos; +} + +DEFUN ("window-absolute-pixel-edges", Fwindow_absolute_pixel_edges, + Swindow_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. + +RIGHT is one more than the rightmost x position occupied by WINDOW. +BOTTOM is one more than the bottommost y position occupied by WINDOW. +The pixel edges include the space used by WINDOW's scroll bar, display +margins, fringes, header line, and/or mode line. For the pixel edges +of just the text area, use `window-inside-pixel-edges'. */) + (window) + Lisp_Object window; +{ + register struct window *w = decode_any_window (window); + int add_x, add_y; + calc_absolute_offset(w, &add_x, &add_y); + + return Fcons (make_number (WINDOW_LEFT_EDGE_X (w) + add_x), + Fcons (make_number (WINDOW_TOP_EDGE_Y (w) + add_y), + Fcons (make_number (WINDOW_RIGHT_EDGE_X (w) + add_x), + Fcons (make_number (WINDOW_BOTTOM_EDGE_Y (w) + add_y), + Qnil)))); +} + DEFUN ("window-inside-edges", Fwindow_inside_edges, Swindow_inside_edges, 0, 1, 0, doc: /* Return a list of the edge coordinates of WINDOW. The list has the form (LEFT TOP RIGHT BOTTOM). @@ -705,6 +747,36 @@ - WINDOW_MODE_LINE_HEIGHT (w))); } +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. + +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. +The inside edges do not include the space used by WINDOW's scroll bar, +display margins, fringes, header line, and/or mode line. */) + (window) + Lisp_Object window; +{ + register struct window *w = decode_any_window (window); + int add_x, add_y; + calc_absolute_offset(w, &add_x, &add_y); + + return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w) + + WINDOW_LEFT_MARGIN_WIDTH (w) + + WINDOW_LEFT_FRINGE_WIDTH (w) + add_x), + make_number (WINDOW_TOP_EDGE_Y (w) + + WINDOW_HEADER_LINE_HEIGHT (w) + add_y), + make_number (WINDOW_BOX_RIGHT_EDGE_X (w) + - WINDOW_RIGHT_MARGIN_WIDTH (w) + - WINDOW_RIGHT_FRINGE_WIDTH (w) + add_x), + make_number (WINDOW_BOTTOM_EDGE_Y (w) + - WINDOW_MODE_LINE_HEIGHT (w) + add_y)); +} + /* Test if the character at column *X, row *Y is within window W. If it is not, return ON_NOTHING; if it is in the window's text area, @@ -7312,8 +7384,10 @@ defsubr (&Sset_window_redisplay_end_trigger); defsubr (&Swindow_edges); defsubr (&Swindow_pixel_edges); + defsubr (&Swindow_absolute_pixel_edges); defsubr (&Swindow_inside_edges); defsubr (&Swindow_inside_pixel_edges); + defsubr (&Swindow_inside_absolute_pixel_edges); defsubr (&Scoordinates_in_window_p); defsubr (&Swindow_at); defsubr (&Swindow_point); ------------------------------------------------------------ revno: 100679 committer: Jan D branch nick: trunk timestamp: Thu 2010-07-01 14:20:14 +0200 message: * nsfns.m (compute_tip_xy): Do not convert coordinates from frame parameters. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-01 12:16:33 +0000 +++ src/ChangeLog 2010-07-01 12:20:14 +0000 @@ -1,5 +1,8 @@ 2010-07-01 Jan Djärv + * nsfns.m (compute_tip_xy): Do not convert coordinates from frame + parameters, they are already absolute. + * nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT. === modified file 'src/nsfns.m' --- src/nsfns.m 2010-06-29 09:49:20 +0000 +++ src/nsfns.m 2010-07-01 12:20:14 +0000 @@ -2412,22 +2412,27 @@ /* Start with user-specified or mouse position. */ left = Fcdr (Fassq (Qleft, parms)); - if (INTEGERP (left)) - pt.x = XINT (left); - else - pt.x = last_mouse_motion_position.x; top = Fcdr (Fassq (Qtop, parms)); - if (INTEGERP (top)) - pt.y = XINT (top); + + if (!INTEGERP (left) || !INTEGERP (top)) + { + pt = last_mouse_motion_position; + /* Convert to screen coordinates */ + pt = [view convertPoint: pt toView: nil]; + pt = [[view window] convertBaseToScreen: pt]; + } else - pt.y = last_mouse_motion_position.y; - - /* Convert to screen coordinates */ - pt = [view convertPoint: pt toView: nil]; - pt = [[view window] convertBaseToScreen: pt]; - + { + /* Absolute coordinates. */ + pt.x = XINT (left); + pt.y = x_display_pixel_height (FRAME_NS_DISPLAY_INFO (f)) - XINT (top) + - height; + } + /* Ensure in bounds. (Note, screen origin = lower left.) */ - if (pt.x + XINT (dx) <= 0) + if (INTEGERP (left)) + *root_x = pt.x; + else if (pt.x + XINT (dx) <= 0) *root_x = 0; /* Can happen for negative dx */ else if (pt.x + XINT (dx) + width <= x_display_pixel_width (FRAME_NS_DISPLAY_INFO (f))) @@ -2440,7 +2445,9 @@ /* Put it left justified on the screen -- it ought to fit that way. */ *root_x = 0; - if (pt.y - XINT (dy) - height >= 0) + if (INTEGERP (top)) + *root_y = pt.y; + else if (pt.y - XINT (dy) - height >= 0) /* It fits below the pointer. */ *root_y = pt.y - height - XINT (dy); else if (pt.y + XINT (dy) + height ------------------------------------------------------------ revno: 100678 committer: Jan D branch nick: trunk timestamp: Thu 2010-07-01 14:16:33 +0200 message: Rename FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT to aid common code. * nsmenu.m (update_frame_tool_bar, free_frame_tool_bar): Update FRAME_TOOLBAR_HEIGHT. * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGH * nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-01 10:45:26 +0000 +++ src/ChangeLog 2010-07-01 12:16:33 +0000 @@ -1,5 +1,13 @@ 2010-07-01 Jan Djärv + * nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed + FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT. + + * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGH + + * nsmenu.m (update_frame_tool_bar, free_frame_tool_bar): Update + FRAME_TOOLBAR_HEIGHT. + * nsmenu.m (free_frame_tool_bar, update_frame_tool_bar): Add BLOCK/UNBLOCK_INPUT so asserts don't trigger. === modified file 'src/nsmenu.m' --- src/nsmenu.m 2010-07-01 10:45:26 +0000 +++ src/nsmenu.m 2010-07-01 12:16:33 +0000 @@ -1001,6 +1001,7 @@ { BLOCK_INPUT; [[FRAME_NS_VIEW (f) toolbar] setVisible: NO]; + FRAME_TOOLBAR_HEIGHT (f) = 0; UNBLOCK_INPUT; } @@ -1011,7 +1012,9 @@ -------------------------------------------------------------------------- */ { int i; - EmacsToolbar *toolbar = [FRAME_NS_VIEW (f) toolbar]; + EmacsView *view = FRAME_NS_VIEW (f); + NSWindow *window = [view window]; + EmacsToolbar *toolbar = [view toolbar]; BLOCK_INPUT; [toolbar clearActive]; @@ -1097,6 +1100,9 @@ [newDict release]; } + FRAME_TOOLBAR_HEIGHT (f) = + NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)]) + - FRAME_NS_TITLEBAR_HEIGHT (f); UNBLOCK_INPUT; } === modified file 'src/nsterm.h' --- src/nsterm.h 2010-03-31 14:27:50 +0000 +++ src/nsterm.h 2010-07-01 12:16:33 +0000 @@ -606,7 +606,7 @@ #define NS_FACE_FOREGROUND(f) ((f)->foreground) #define NS_FACE_BACKGROUND(f) ((f)->background) #define FRAME_NS_TITLEBAR_HEIGHT(f) ((f)->output_data.ns->titlebar_height) -#define FRAME_NS_TOOLBAR_HEIGHT(f) ((f)->output_data.ns->toolbar_height) +#define FRAME_TOOLBAR_HEIGHT(f) ((f)->output_data.ns->toolbar_height) #define FONT_WIDTH(f) ((f)->max_width) #define FONT_HEIGHT(f) ((f)->height) === modified file 'src/nsterm.m' --- src/nsterm.m 2010-06-02 04:29:53 +0000 +++ src/nsterm.m 2010-07-01 12:16:33 +0000 @@ -1138,15 +1138,15 @@ /* NOTE: previously this would generate wrong result if toolbar not yet displayed and fixing toolbar_height=32 helped, but now (200903) seems no longer needed */ - FRAME_NS_TOOLBAR_HEIGHT (f) = + FRAME_TOOLBAR_HEIGHT (f) = NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)]) - FRAME_NS_TITLEBAR_HEIGHT (f); else - FRAME_NS_TOOLBAR_HEIGHT (f) = 0; + FRAME_TOOLBAR_HEIGHT (f) = 0; wr.size.width = pixelwidth + f->border_width; wr.size.height = pixelheight + FRAME_NS_TITLEBAR_HEIGHT (f) - + FRAME_NS_TOOLBAR_HEIGHT (f); + + FRAME_TOOLBAR_HEIGHT (f); /* constrain to screen if we can */ if (screen) @@ -4894,16 +4894,16 @@ rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, frameSize.height #ifdef NS_IMPL_GNUSTEP - FRAME_NS_TITLEBAR_HEIGHT (emacsframe) + 3 - - FRAME_NS_TOOLBAR_HEIGHT (emacsframe)); + - FRAME_TOOLBAR_HEIGHT (emacsframe)); #else - FRAME_NS_TITLEBAR_HEIGHT (emacsframe) - - FRAME_NS_TOOLBAR_HEIGHT (emacsframe)); + - FRAME_TOOLBAR_HEIGHT (emacsframe)); #endif if (rows < MINHEIGHT) rows = MINHEIGHT; frameSize.height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (emacsframe, rows) + FRAME_NS_TITLEBAR_HEIGHT (emacsframe) - + FRAME_NS_TOOLBAR_HEIGHT (emacsframe); + + FRAME_TOOLBAR_HEIGHT (emacsframe); #ifdef NS_IMPL_COCOA { /* this sets window title to have size in it; the wm does this under GS */ @@ -5114,7 +5114,7 @@ [toggleButton setTarget: self]; [toggleButton setAction: @selector (toggleToolbar: )]; #endif - FRAME_NS_TOOLBAR_HEIGHT (f) = 0; + FRAME_TOOLBAR_HEIGHT (f) = 0; tem = f->icon_name; if (!NILP (tem)) ------------------------------------------------------------ revno: 100677 committer: Jan D branch nick: trunk timestamp: Thu 2010-07-01 12:45:26 +0200 message: * nsmenu.m (free_frame_tool_bar, update_frame_tool_bar): Add BLOCK/UNBLOCK_INPUT so asserts don't trigger. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-01 00:14:17 +0000 +++ src/ChangeLog 2010-07-01 10:45:26 +0000 @@ -1,3 +1,8 @@ +2010-07-01 Jan Djärv + + * nsmenu.m (free_frame_tool_bar, update_frame_tool_bar): Add + BLOCK/UNBLOCK_INPUT so asserts don't trigger. + 2010-06-30 Chong Yidong * frame.c (get_future_frame_param, Fmake_terminal_frame): Don't === modified file 'src/nsmenu.m' --- src/nsmenu.m 2010-04-13 06:01:46 +0000 +++ src/nsmenu.m 2010-07-01 10:45:26 +0000 @@ -999,7 +999,9 @@ Under NS we just hide the toolbar until it might be needed again. -------------------------------------------------------------------------- */ { + BLOCK_INPUT; [[FRAME_NS_VIEW (f) toolbar] setVisible: NO]; + UNBLOCK_INPUT; } void @@ -1011,6 +1013,7 @@ int i; EmacsToolbar *toolbar = [FRAME_NS_VIEW (f) toolbar]; + BLOCK_INPUT; [toolbar clearActive]; /* update EmacsToolbar as in GtkUtils, build items list */ @@ -1094,6 +1097,7 @@ [newDict release]; } + UNBLOCK_INPUT; } ------------------------------------------------------------ revno: 100676 committer: Chong Yidong branch nick: trunk timestamp: Thu 2010-07-01 01:32:01 -0400 message: * ruler-mode.el (ruler--save-header-line-format): Fix typos. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-07-01 00:14:17 +0000 +++ lisp/ChangeLog 2010-07-01 05:32:01 +0000 @@ -1,3 +1,7 @@ +2010-07-01 Chong Yidong + + * ruler-mode.el (ruler--save-header-line-format): Fix typos. + 2010-06-30 Chong Yidong * frame.el (make-frame): Add default-frame-alist to the PARAMETERS === modified file 'lisp/ruler-mode.el' --- lisp/ruler-mode.el 2010-06-30 22:43:52 +0000 +++ lisp/ruler-mode.el 2010-07-01 05:32:01 +0000 @@ -557,15 +557,14 @@ (defun ruler--save-header-line-format () "Install the header line format for Ruler mode. -Unless if Ruler mode is already enabled, save the old header line +Unless Ruler mode is already enabled, save the old header line format first." - (when enable - (when (and (not ruler-mode) - (local-variable-p 'header-line-format) - (not (local-variable-p 'ruler-mode-header-line-format-old))) - (set (make-local-variable 'ruler-mode-header-line-format-old) - header-line-format)) - (setq header-line-format ruler-mode-header-line-format))) + (when (and (not ruler-mode) + (local-variable-p 'header-line-format) + (not (local-variable-p 'ruler-mode-header-line-format-old))) + (set (make-local-variable 'ruler-mode-header-line-format-old) + header-line-format)) + (setq header-line-format ruler-mode-header-line-format)) ;;;###autoload (define-minor-mode ruler-mode