From: Glenn Morris Date: Sat, 8 Nov 2014 21:32:10 +0000 (-0800) Subject: Merge from emacs-24; up to 117689 X-Git-Tag: emacs-25.0.90~2635^2~532 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=089c6aab18ea8986bfc02ef3e65500b589e7afbe;p=emacs.git Merge from emacs-24; up to 117689 --- 089c6aab18ea8986bfc02ef3e65500b589e7afbe diff --cc lisp/ChangeLog index ab12e064aaa,c3ecb7536e0..0b0192a545d --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@@ -1,4 -1,10 +1,10 @@@ + 2014-11-08 Glenn Morris + + * emacs-lisp/bytecomp.el (byte-compile-report-error): + Allow the argument to be a string. Due to the vague doc, + it was already being used this way. + -2014-11-07 Michael Albinus +2014-11-08 Michael Albinus * net/tramp.el (tramp-check-cached-permissions): Include hop in the constructed Tramp file name. (Bug#18943) diff --cc src/ChangeLog index e3f34e27dfc,7b595b5f9e9..82a9b24876c --- a/src/ChangeLog +++ b/src/ChangeLog @@@ -1,9 -1,12 +1,11 @@@ 2014-11-08 Jan Djärv - * nsterm.m (init): Replace OSX 10.9 check with IMPL_COCOA. - (run): Ditto. Only use non-system event loop if OSX version is + * nsterm.m (run): Only use non-system event loop if OSX version is exactly 10.9 (Bug#18993). + (ns_set_vertical_scroll_bar): Don't call bar setPosition: unless + needed (Bug#18757). -2014-11-07 Michael Albinus +2014-11-08 Michael Albinus * callproc.c (encode_current_directory): Support handling of file names prepended by "/:". (Bug#18891) diff --cc src/nsterm.m index 216678357e7,605baff00b2..318f14acfc8 --- a/src/nsterm.m +++ b/src/nsterm.m @@@ -3756,9 -3798,11 +3756,10 @@@ ns_set_vertical_scroll_bar (struct wind NSRect r, v; struct frame *f = XFRAME (WINDOW_FRAME (window)); EmacsView *view = FRAME_NS_VIEW (f); - int window_y, window_height; - int top, left, height, width, sb_width, sb_left; EmacsScroller *bar; - BOOL fringe_extended_p; + int window_y, window_height; + int top, left, height, width; + BOOL update_p = YES; /* optimization; display engine sends WAY too many of these.. */ if (!NILP (window->vertical_scroll_bar)) @@@ -3824,98 -3882,9 +3827,99 @@@ if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r)) { if (oldRect.origin.x != r.origin.x) - ns_clear_frame_area (f, sb_left, top, width, height); + ns_clear_frame_area (f, left, top, width, height); + [bar setFrame: r]; + } + } + + [bar setPosition: position portion: portion whole: whole]; + unblock_input (); +} + + +static void +ns_set_horizontal_scroll_bar (struct window *window, + int portion, int whole, int position) +/* -------------------------------------------------------------------------- + External (hook): Update or add scrollbar + -------------------------------------------------------------------------- */ +{ + Lisp_Object win; + NSRect r, v; + struct frame *f = XFRAME (WINDOW_FRAME (window)); + EmacsView *view = FRAME_NS_VIEW (f); + EmacsScroller *bar; + int top, height, left, width; + int window_x, window_width; + int pixel_width = WINDOW_PIXEL_WIDTH (window); + + /* optimization; display engine sends WAY too many of these.. */ + if (!NILP (window->horizontal_scroll_bar)) + { + bar = XNS_SCROLL_BAR (window->horizontal_scroll_bar); + if ([bar checkSamePosition: position portion: portion whole: whole]) + { + if (view->scrollbarsNeedingUpdate == 0) + { + if (!windows_or_buffers_changed) + return; + } + else + view->scrollbarsNeedingUpdate--; + } + } + + NSTRACE (ns_set_horizontal_scroll_bar); + + /* Get dimensions. */ + window_box (window, ANY_AREA, 0, &window_x, &window_width, 0); + left = window_x; + width = window_width; + height = WINDOW_CONFIG_SCROLL_BAR_LINES (window) * FRAME_LINE_HEIGHT (f); + top = WINDOW_SCROLL_BAR_AREA_Y (window); + + r = NSMakeRect (left, top, width, height); + /* the parent view is flipped, so we need to flip y value */ + v = [view frame]; + /* ??????? PXW/scrollbars !!!!!!!!!!!!!!!!!!!! */ + r.origin.y = (v.size.height - r.size.height - r.origin.y); + + XSETWINDOW (win, window); + block_input (); + + if (WINDOW_TOTAL_COLS (window) < 5) + { + if (!NILP (window->horizontal_scroll_bar)) + { + bar = XNS_SCROLL_BAR (window->horizontal_scroll_bar); + [bar removeFromSuperview]; + wset_horizontal_scroll_bar (window, Qnil); + } + ns_clear_frame_area (f, left, top, width, height); + unblock_input (); + return; + } + + if (NILP (window->horizontal_scroll_bar)) + { + if (width > 0 && height > 0) + ns_clear_frame_area (f, left, top, width, height); + + bar = [[EmacsScroller alloc] initFrame: r window: win]; + wset_horizontal_scroll_bar (window, make_save_ptr (bar)); + } + else + { + NSRect oldRect; + bar = XNS_SCROLL_BAR (window->horizontal_scroll_bar); + oldRect = [bar frame]; + r.size.width = oldRect.size.width; + if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r)) + { + if (oldRect.origin.x != r.origin.x) + ns_clear_frame_area (f, left, top, width, height); [bar setFrame: r]; + update_p = YES; } }