From adc47434a27e5f4a9733e657584823508f8ab952 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Thu, 14 Jul 2011 10:30:34 +0200 Subject: [PATCH] Fix bugs in vertical-motion and display-buffer-normalize-special. * indent.c (Fvertical_motion): Set and restore w->pointm when saving and restoring the window's buffer (Bug#9006). * window.el (display-buffer-normalize-special): Replace `dedicated' by `dedicate' to dedicate window (Bug#9072). --- lisp/ChangeLog | 5 +++++ lisp/window.el | 4 ++-- src/ChangeLog | 5 +++++ src/indent.c | 14 +++++++++++--- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7f86e6ef53f..9814cae16bb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-07-14 Martin Rudalics + + * window.el (display-buffer-normalize-special): Replace + `dedicated' by `dedicate' to dedicate window (Bug#9072). + 2011-07-14 Eli Zaretskii * subr.el (version<, version<=, version=): Mention "-CVS" and diff --git a/lisp/window.el b/lisp/window.el index 593fa14d215..0302a672521 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5317,12 +5317,12 @@ user preferences expressed in `display-buffer-alist'." (unless display-buffer-mark-dedicated ;; Don't make anything created above dedicated unless requested. ;; Otherwise the dedication request below gets in our way. - '((dedicated . nil))) + '((dedicate . nil))) `((pop-up-frame t) ,(append '(pop-up-frame-alist) (when (listp args) args) special-display-frame-alist) - (dedicated . t)))))) + (dedicate . t)))))) (defun display-buffer-normalize-default (buffer-or-name) "Subroutine of `display-buffer-normalize-specifiers'. diff --git a/src/ChangeLog b/src/ChangeLog index 36a7539b888..9a60ac5f541 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-07-14 Martin Rudalics + + * indent.c (Fvertical_motion): Set and restore w->pointm when + saving and restoring the window's buffer (Bug#9006). + 2011-07-13 Lars Magne Ingebrigtsen * editfns.c (Fstring_to_char): Clarify just what is returned diff --git a/src/indent.c b/src/indent.c index 5c5966175aa..02eeb7f17d4 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1985,7 +1985,8 @@ whether or not it is currently displayed in some window. */) struct text_pos pt; struct window *w; Lisp_Object old_buffer; - struct gcpro gcpro1; + EMACS_INT old_charpos, old_bytepos; + struct gcpro gcpro1, gcpro2, gcpro3; Lisp_Object lcols = Qnil; double cols IF_LINT (= 0); @@ -2005,12 +2006,16 @@ whether or not it is currently displayed in some window. */) w = XWINDOW (window); old_buffer = Qnil; - GCPRO1 (old_buffer); + GCPRO3 (old_buffer, old_charpos, old_bytepos); if (XBUFFER (w->buffer) != current_buffer) { /* Set the window's buffer temporarily to the current buffer. */ old_buffer = w->buffer; + old_charpos = XMARKER (w->pointm)->charpos; + old_bytepos = XMARKER (w->pointm)->bytepos; XSETBUFFER (w->buffer, current_buffer); + set_marker_both + (w->pointm, w->buffer, BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer)); } if (noninteractive) @@ -2131,7 +2136,10 @@ whether or not it is currently displayed in some window. */) } if (BUFFERP (old_buffer)) - w->buffer = old_buffer; + { + w->buffer = old_buffer; + set_marker_both (w->pointm, w->buffer, old_charpos, old_bytepos); + } RETURN_UNGCPRO (make_number (it.vpos)); } -- 2.39.2