* src/window.c (Frecenter): Signal an error if window-buffer is not

current-buffer.
This commit is contained in:
Stefan Monnier 2014-06-06 10:37:05 -04:00
parent 631de55bc1
commit 3da983f8c4
3 changed files with 26 additions and 19 deletions

View file

@ -1,3 +1,8 @@
2014-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
* mouse.el (mouse-posn-property): Ignore buffer position info when the
even happened elsewhere.
2014-06-06 Mario Lang <mlang@delysid.org>
* emacs-lisp/tabulated-list.el (tabulated-list-print): Only call
@ -9,8 +14,8 @@
2014-06-05 Michal Nazarewicz <mina86@mina86.com>
* 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 <kdo@cosmos.phy.tufts.edu> (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 <rrt@sc3d.org>
* 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

View file

@ -1,5 +1,8 @@
2014-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
* 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.

View file

@ -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;
}