From: Stefan Monnier Date: Fri, 6 Jun 2014 14:37:05 +0000 (-0400) Subject: * src/window.c (Frecenter): Signal an error if window-buffer is not X-Git-Tag: emacs-25.0.90~2639^2~99 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3da983f8c4ec64a3964ce6ad4d7ae8ef8abe7aec;p=emacs.git * src/window.c (Frecenter): Signal an error if window-buffer is not current-buffer. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c445861a972..5f7390292f7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-06-06 Stefan Monnier + + * mouse.el (mouse-posn-property): Ignore buffer position info when the + even happened elsewhere. + 2014-06-06 Mario Lang * emacs-lisp/tabulated-list.el (tabulated-list-print): Only call @@ -9,8 +14,8 @@ 2014-06-05 Michal Nazarewicz - * textmodes/tildify.el (tildify-foreach-region-outside-env): New - function which calls a callback on portions of the buffer that are + * textmodes/tildify.el (tildify-foreach-region-outside-env): + New function which calls a callback on portions of the buffer that are outside of ignored environments. (tildify-build-regexp): Remove function since it is now incorporated in `tildify-foreach-region-outside-env' where it is @@ -243,14 +248,14 @@ 2014-05-30 Ken Olum (tiny change) - * mail/rmail.el (rmail-delete-forward, rmail-delete-backward): The - argument COUNT is now optional, to be more backward-compatible. + * mail/rmail.el (rmail-delete-forward, rmail-delete-backward): + The argument COUNT is now optional, to be more backward-compatible. Doc fix. (Bug#17560) 2014-05-29 Reuben Thomas - * whitespace.el (whitespace-report-region): Simplify - documentation. + * whitespace.el (whitespace-report-region): + Simplify documentation. (whitespace-report-region): Allow report-if-bogus to take the value `never', for non-interactive use. (whitespace-report): Refer to whitespace-report-region's diff --git a/src/ChangeLog b/src/ChangeLog index 06847a72de3..9c17d3d1dbc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2014-06-06 Stefan Monnier + * window.c (Frecenter): Signal an error if window-buffer is not + current-buffer. + * keyboard.c (make_lispy_position): Don't include a buffer position in mode/header-line mouse events. diff --git a/src/window.c b/src/window.c index 919cc7b1c4e..46024614179 100644 --- a/src/window.c +++ b/src/window.c @@ -4867,7 +4867,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror) /* If PT is not visible in WINDOW, move back one half of the screen. Allow PT to be partially visible, otherwise something like (scroll-down 1) with PT in the line before - the partially visible one would recenter. */ + the partially visible one would recenter. */ if (!pos_visible_p (w, PT, &x, &y, &rtop, &rbot, &rowh, &vpos)) { @@ -4896,7 +4896,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror) } else if (auto_window_vscroll_p) { - if (rtop || rbot) /* partially visible */ + if (rtop || rbot) /* Partially visible. */ { int px; int dy = frame_line_height; @@ -5643,14 +5643,16 @@ and redisplay normally--don't erase and redraw the frame. */) { struct window *w = XWINDOW (selected_window); struct buffer *buf = XBUFFER (w->contents); - struct buffer *obuf = current_buffer; bool center_p = 0; ptrdiff_t charpos, bytepos; EMACS_INT iarg IF_LINT (= 0); int this_scroll_margin; + if (buf != current_buffer) + error ("`recenter'ing a window that does not display current-buffer."); + /* If redisplay is suppressed due to an error, try again. */ - obuf->display_error_modiff = 0; + buf->display_error_modiff = 0; if (NILP (arg)) { @@ -5672,7 +5674,7 @@ and redisplay normally--don't erase and redraw the frame. */) center_p = 1; } - else if (CONSP (arg)) /* Just C-u. */ + else if (CONSP (arg)) /* Just C-u. */ center_p = 1; else { @@ -5681,12 +5683,10 @@ and redisplay normally--don't erase and redraw the frame. */) iarg = XINT (arg); } - set_buffer_internal (buf); - /* Do this after making BUF current in case scroll_margin is buffer-local. */ - this_scroll_margin = - max (0, min (scroll_margin, w->total_lines / 4)); + this_scroll_margin + = max (0, min (scroll_margin, w->total_lines / 4)); /* Handle centering on a graphical frame specially. Such frames can have variable-height lines and centering point on the basis of @@ -5734,7 +5734,7 @@ and redisplay normally--don't erase and redraw the frame. */) h -= it.current_y; else { - /* Last line has no newline */ + /* Last line has no newline. */ h -= line_bottom_y (&it); it.vpos++; } @@ -5813,10 +5813,9 @@ and redisplay normally--don't erase and redraw the frame. */) w->optional_new_start = 1; - w->start_at_line_beg = (bytepos == BEGV_BYTE || - FETCH_BYTE (bytepos - 1) == '\n'); + w->start_at_line_beg = (bytepos == BEGV_BYTE + || FETCH_BYTE (bytepos - 1) == '\n'); - set_buffer_internal (obuf); return Qnil; }